GPU-accelerated, fault-tolerant Schlieren/PIV shock tracking with interactive ROI, 1-px edges, and resumable training.
End-to-end pipeline to extract shock angle vs time and dominant oscillation frequency from Schlieren frames (PIV-friendly too). Designed for small datasets and Spyder. PyTorch is optional.
- Interactive ROI (OpenCV; Matplotlib fallback)
- 1‑px thin edges (skeletonization) + sub‑pixel
cv2.fitLineangle - (Optional) tiny U‑Net: synthetic pretrain + fine‑tune
- Resumable training (epoch checkpoints, PAUSE file or Ctrl+C)
- Outputs: overlays, time series, FFT/Strouhal, JSON summary
pip install -r requirements.txt- Unzip
demo_schlieren_dataset.zip→ setCONFIG["data_dir"]todemo_schlieren/images/(andmask_dirtodemo_schlieren/masks/). - Run
python shocktrack_roi.py(or in Spyder).
ROI keys: click points → c close → y confirm (u=undo, r=reset, q=cancel). - Results in
runs/exp_roi/→pred/overlays,analysis/*.png,analysis/summary.json.
- Create empty
PAUSEfile in the training dir (e.g.,runs/exp_roi/finetune/PAUSE) to stop after current epoch. - Or press Ctrl+C; a checkpoint is saved.
- Resume: set
CONFIG["resume_finetune_dir"](or pretrain) to that folder and run again.
shocktrack_roi.py— main script (Spyder-friendly)requirements.txt— core deps (no PyTorch)requirements-torch.txt— optional torch depsdemo_schlieren_dataset.zip— tiny synthetic dataset (30 frames with masks)LICENSE(MIT),.gitignore,.gitattributes