Image Segmentation
ultralytics
YOLO26
instance-segmentation
shock-wave
shadowgraph
fluid-dynamics
computer-vision
Instructions to use igor3357/shock_waves_segmentation with libraries, inference providers, notebooks, and local apps. Follow these links to get started.
- Libraries
- ultralytics
How to use igor3357/shock_waves_segmentation with ultralytics:
# Couldn't find a valid YOLO version tag. # Replace XX with the correct version. from ultralytics import YOLOvXX model = YOLOvXX.from_pretrained("igor3357/shock_waves_segmentation") source = 'http://images.cocodataset.org/val2017/000000039769.jpg' model.predict(source=source, save=True) - Notebooks
- Google Colab
- Kaggle
File size: 8,269 Bytes
345609e da0af7c c9734d0 da0af7c 345609e da0af7c c9734d0 da0af7c c9734d0 da0af7c c9734d0 da0af7c | 1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61 62 63 64 65 66 67 68 69 70 71 72 73 74 75 76 77 78 79 80 81 82 83 84 85 86 87 88 89 90 91 92 93 94 95 96 97 98 99 100 101 102 103 104 105 106 107 108 109 110 111 112 113 114 115 116 117 118 119 120 121 122 123 124 125 126 127 128 129 130 131 132 133 134 135 136 137 138 139 140 141 142 143 144 145 146 147 148 149 150 151 152 153 154 155 156 157 158 159 160 161 162 163 164 165 166 167 168 169 170 171 172 173 174 175 176 177 178 179 180 181 182 183 184 185 186 187 188 189 190 191 192 193 194 195 196 197 198 199 200 201 202 203 | ---
library_name: ultralytics
pipeline_tag: image-segmentation
license: apache-2.0
tags:
- YOLO26
- ultralytics
- instance-segmentation
- shock-wave
- shadowgraph
- fluid-dynamics
- computer-vision
---
# YOLO26 Model for Shock-Wave Segmentation
This repository contains a YOLO26 model for automatic segmentation of shock waves in experimental shadowgraph images.
The model identifies visible shock-wave structures and returns instance segmentation masks. It is intended for automated processing of high-speed flow-visualization data in gas dynamics and shock-wave experiments.
**Model authors:** Igor Doroshchenko, Pavel Popov, Aleksei Moiseevskii, and Tahir Kuli-Zade.
## Repository Files
- `shock_seg_model_YOLO26.pt` β trained YOLO26 segmentation model.
- `shock_wave_segmentation_yolo26.py` β ready-to-run Python script for processing image sequences.
## Applications
The model can be used for:
- automatic segmentation of shock waves;
- extraction of shock-front geometry;
- tracking shock-wave motion between frames;
- determining the position and shape of shock fronts;
- approximating shock fronts with polynomial curves;
- processing large datasets obtained using high-speed shadowgraph imaging.
## Installation
Install the required Python packages:
```bash
python -m pip install -U ultralytics opencv-python numpy matplotlib
```
A recent version of `ultralytics` with YOLO26 support is required. The accompanying script checks compatibility and can update `ultralytics` in the active Python environment when necessary.
## Input Data
Place the model, script, and input directory in the same project folder:
```text
project/
βββ shock_seg_model_YOLO26.pt
βββ shock_wave_segmentation_yolo26.py
βββ frames/
βββ frame_0001.png
βββ frame_0002.png
βββ frame_0003.jpg
```
The `frames` directory may contain PNG, JPG, or JPEG images. Files are sorted and processed alphabetically.
## Running the Model
Open `shock_wave_segmentation_yolo26.py` in PyCharm, configure the parameters at the top of the script, and run it.
The main parameters include:
- model filename;
- input and output directories;
- confidence and IoU thresholds;
- inference image size and device selection;
- mask transparency and contour settings;
- polynomial approximation degree;
- optional frame-time display;
- first-frame time and time step between frames;
- plot and legend settings for the extracted shock-front lines.
## Output
The script creates three output directories.
### `results`
Contains the original shadowgraph images with predicted segmentation masks.
### `results_with_lines`
Contains the images with thin median lines representing the detected shock-wave fronts. Polynomial equations are not printed on these images.
For each mask, the script extracts a median shock-front line and automatically selects its representation as either:
- `y = f(x)` for predominantly horizontal fronts;
- `x = f(y)` for predominantly vertical fronts.
### `results_lines_on_grid`
Contains separate plots of the extracted shock-front lines on a coordinate grid. The polynomial equation of each fitted line is displayed in the legend.
Pixel coordinates are used, with the origin located at the upper-left corner of the image by default.
## Optional Frame Time
Frame time can be printed in the upper-left corner of the output images:
```python
printTime = True
firstFrameTime = 0.0
timeStep = 6.67
timeUnit = "us"
```
The time of each frame is calculated as:
```text
frame time = firstFrameTime + frame index Γ timeStep
```
The first frame after alphabetical sorting has index 0. The time unit is user-defined and must be consistent for `firstFrameTime` and `timeStep`.
## Model Details
- **Task:** Instance segmentation
- **Architecture:** Ultralytics YOLO26
- **Target class:** Shock wave
- **Input type:** Experimental shadowgraph images
- **Output:** Shock-wave instance masks
- **Weights:** `shock_seg_model_YOLO26.pt`
- **Authors:** Igor Doroshchenko, Pavel Popov, Aleksei Moiseevskii, and Tahir Kuli-Zade
## Limitations
The model was developed for experimental shadowgraph images. Its performance may decrease for schlieren images, numerical visualizations, substantially different optical configurations, low-contrast shock fronts, strong illumination artifacts, or flow regimes not represented in the training dataset.
Predictions should be validated before the model is used for quantitative measurements. Spatial calibration is required to convert pixel coordinates into physical units.
## Citation
If you use the exact model weights or the accompanying script, please cite this model repository:
```bibtex
@misc{doroshchenkoEtAl2026shockwaveyolo26,
author = {Doroshchenko, Igor and Popov, Pavel and Moiseevskii, Aleksei and Kuli-Zade, Tahir},
title = {YOLO26 Model for Shock-Wave Segmentation},
year = {2026},
publisher = {Hugging Face},
howpublished = {Hugging Face model repository},
url = {ADD_HUGGING_FACE_REPOSITORY_URL}
}
```
Replace `ADD_HUGGING_FACE_REPOSITORY_URL` with the public URL of this repository after publication.
## Related Publications
The publications below provide scientific and methodological background for computer-vision analysis of shock waves and other gas-dynamic structures in experimental shadowgraph images. They should not be interpreted as descriptions of the exact YOLO26 weights released in this repository.
If you use this model or the accompanying script in scientific work, please cite the model repository and one or both of the following publications, depending on the focus of your study.
### Analysis of striped structures behind a shock wave
This article presents a computer-vision-based analysis of striped structures developing in the boundary layer behind a shock wave. It is particularly relevant to studies of shock-wave-induced unsteady flow structures and automated processing of high-speed flow-visualization data.
> I. A. Znamenskaya, I. A. Doroshchenko, A. Kopylov, and T. A. Kuli-Zade, βAnalysis of Striped Structures in the Boundary Layer Behind a Shock Wave Using Computer Vision Techniques,β *Journal of Flow Visualization and Image Processing*, vol. 33, no. 2, pp. 1β19, 2026. [https://doi.org/10.1615/JFlowVisImageProc.2025058234](https://doi.org/10.1615/JFlowVisImageProc.2025058234)
```bibtex
@article{znamenskaya2026stripedstructures,
author = {Znamenskaya, Irina A. and Doroshchenko, Igor A. and Kopylov, Anatoly and Kuli-Zade, Tahir A.},
title = {Analysis of Striped Structures in the Boundary Layer Behind a Shock Wave Using Computer Vision Techniques},
journal = {Journal of Flow Visualization and Image Processing},
year = {2026},
volume = {33},
number = {2},
pages = {1--19},
doi = {10.1615/JFlowVisImageProc.2025058234},
url = {https://doi.org/10.1615/JFlowVisImageProc.2025058234}
}
```
### Computer-vision analysis of experimental shadowgraph images
This article is the most directly relevant methodological reference for automatic analysis of shock waves and bow shocks in experimental shadowgraph images. It describes both classical computer-vision algorithms and YOLO-based deep learning for recognizing gas-dynamic structures.
> I. A. Doroshchenko, βAnalysis of the Experimental Flow Shadowgraph Images by Computer Vision Methods,β *Numerical Methods and Programming (Vychislitel'nye Metody i Programmirovanie)*, vol. 24, no. 2, pp. 231β242, 2023. [https://doi.org/10.26089/NumMet.v24r217](https://doi.org/10.26089/NumMet.v24r217)
```bibtex
@article{doroshchenko2023shadowgraph,
author = {Doroshchenko, Igor A.},
title = {Analysis of the Experimental Flow Shadowgraph Images by Computer Vision Methods},
journal = {Numerical Methods and Programming (Vychislitel'nye Metody i Programmirovanie)},
year = {2023},
volume = {24},
number = {2},
pages = {231--242},
doi = {10.26089/NumMet.v24r217},
url = {https://doi.org/10.26089/NumMet.v24r217}
}
```
For work focused specifically on the released YOLO26 weights, cite the model repository. For broader methodological and physical context, cite the most relevant publication above in addition to the repository.
|