igor3357 commited on
Commit
da0af7c
Β·
verified Β·
1 Parent(s): a3b6df3

Update README.md

Browse files
Files changed (1) hide show
  1. README.md +197 -0
README.md CHANGED
@@ -1,3 +1,200 @@
1
  ---
 
 
 
 
 
 
 
 
 
 
2
  license: apache-2.0
3
  ---
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
  ---
2
+ library_name: ultralytics
3
+ pipeline_tag: image-segmentation
4
+ tags:
5
+ - YOLO26
6
+ - ultralytics
7
+ - instance-segmentation
8
+ - shock-wave
9
+ - shadowgraph
10
+ - fluid-dynamics
11
+ - computer-vision
12
  license: apache-2.0
13
  ---
14
+
15
+ # YOLO26 Model for Shock-Wave Segmentation
16
+
17
+ This repository contains a YOLO26 model for automatic segmentation of shock waves in experimental shadowgraph images.
18
+
19
+ 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.
20
+
21
+ ## Repository Files
22
+
23
+ - `shock_seg_model_YOLO26.pt` β€” trained YOLO26 segmentation model.
24
+ - `shock_wave_segmentation_yolo26.py` β€” ready-to-run Python script for processing image sequences.
25
+
26
+ ## Applications
27
+
28
+ The model can be used for:
29
+
30
+ - automatic segmentation of shock waves;
31
+ - extraction of shock-front geometry;
32
+ - tracking shock-wave motion between frames;
33
+ - determining the position and shape of shock fronts;
34
+ - approximating shock fronts with polynomial curves;
35
+ - processing large datasets obtained using high-speed shadowgraph imaging.
36
+
37
+ ## Installation
38
+
39
+ Install the required Python packages:
40
+
41
+ ```bash
42
+ python -m pip install -U ultralytics opencv-python numpy matplotlib
43
+ ```
44
+
45
+ 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.
46
+
47
+ ## Input Data
48
+
49
+ Place the model, script, and input directory in the same project folder:
50
+
51
+ ```text
52
+ project/
53
+ β”œβ”€β”€ shock_seg_model_YOLO26.pt
54
+ β”œβ”€β”€ shock_wave_segmentation_yolo26.py
55
+ └── frames/
56
+ β”œβ”€β”€ frame_0001.png
57
+ β”œβ”€β”€ frame_0002.png
58
+ └── frame_0003.jpg
59
+ ```
60
+
61
+ The `frames` directory may contain PNG, JPG, or JPEG images. Files are sorted and processed alphabetically.
62
+
63
+ ## Running the Model
64
+
65
+ Open `shock_wave_segmentation_yolo26.py` in PyCharm, configure the parameters at the top of the script, and run it.
66
+
67
+ The main parameters include:
68
+
69
+ - model filename;
70
+ - input and output directories;
71
+ - confidence and IoU thresholds;
72
+ - inference image size and device selection;
73
+ - mask transparency and contour settings;
74
+ - polynomial approximation degree;
75
+ - optional frame-time display;
76
+ - first-frame time and time step between frames;
77
+ - plot and legend settings for the extracted shock-front lines.
78
+
79
+ ## Output
80
+
81
+ The script creates three output directories.
82
+
83
+ ### `results`
84
+
85
+ Contains the original shadowgraph images with predicted segmentation masks.
86
+
87
+ ### `results_with_lines`
88
+
89
+ Contains the images with thin median lines representing the detected shock-wave fronts. Polynomial equations are not printed on these images.
90
+
91
+ For each mask, the script extracts a median shock-front line and automatically selects its representation as either:
92
+
93
+ - `y = f(x)` for predominantly horizontal fronts;
94
+ - `x = f(y)` for predominantly vertical fronts.
95
+
96
+ ### `results_lines_on_grid`
97
+
98
+ 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.
99
+
100
+ Pixel coordinates are used, with the origin located at the upper-left corner of the image by default.
101
+
102
+ ## Optional Frame Time
103
+
104
+ Frame time can be printed in the upper-left corner of the output images:
105
+
106
+ ```python
107
+ printTime = True
108
+ firstFrameTime = 0.0
109
+ timeStep = 6.67
110
+ timeUnit = "us"
111
+ ```
112
+
113
+ The time of each frame is calculated as:
114
+
115
+ ```text
116
+ frame time = firstFrameTime + frame index Γ— timeStep
117
+ ```
118
+
119
+ The first frame after alphabetical sorting has index 0. The time unit is user-defined and must be consistent for `firstFrameTime` and `timeStep`.
120
+
121
+ ## Model Details
122
+
123
+ - **Task:** Instance segmentation
124
+ - **Architecture:** Ultralytics YOLO26
125
+ - **Target class:** Shock wave
126
+ - **Input type:** Experimental shadowgraph images
127
+ - **Output:** Shock-wave instance masks
128
+ - **Weights:** `shock_seg_model_YOLO26.pt`
129
+
130
+ ## Limitations
131
+
132
+ 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.
133
+
134
+ Predictions should be validated before the model is used for quantitative measurements. Spatial calibration is required to convert pixel coordinates into physical units.
135
+
136
+ ## Citation
137
+
138
+ If you use the exact model weights or the accompanying script, please cite this model repository:
139
+
140
+ ```bibtex
141
+ @misc{doroshchenko2026shockwaveyolo26,
142
+ author = {Doroshchenko, Igor A.},
143
+ title = {YOLO26 Model for Shock-Wave Segmentation},
144
+ year = {2026},
145
+ publisher = {Hugging Face},
146
+ howpublished = {Hugging Face model repository},
147
+ url = {ADD_HUGGING_FACE_REPOSITORY_URL}
148
+ }
149
+ ```
150
+
151
+ Replace `ADD_HUGGING_FACE_REPOSITORY_URL` with the public URL of this repository after publication.
152
+
153
+ ## Related Publications
154
+
155
+ 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.
156
+
157
+ 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.
158
+
159
+ ### Analysis of striped structures behind a shock wave
160
+
161
+ 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.
162
+
163
+ > 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)
164
+
165
+ ```bibtex
166
+ @article{znamenskaya2026stripedstructures,
167
+ author = {Znamenskaya, Irina A. and Doroshchenko, Igor A. and Kopylov, Anatoly and Kuli-Zade, Tahir A.},
168
+ title = {Analysis of Striped Structures in the Boundary Layer Behind a Shock Wave Using Computer Vision Techniques},
169
+ journal = {Journal of Flow Visualization and Image Processing},
170
+ year = {2026},
171
+ volume = {33},
172
+ number = {2},
173
+ pages = {1--19},
174
+ doi = {10.1615/JFlowVisImageProc.2025058234},
175
+ url = {https://doi.org/10.1615/JFlowVisImageProc.2025058234}
176
+ }
177
+ ```
178
+
179
+ ### Computer-vision analysis of experimental shadowgraph images
180
+
181
+ 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.
182
+
183
+ > 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)
184
+
185
+ ```bibtex
186
+ @article{doroshchenko2023shadowgraph,
187
+ author = {Doroshchenko, Igor A.},
188
+ title = {Analysis of the Experimental Flow Shadowgraph Images by Computer Vision Methods},
189
+ journal = {Numerical Methods and Programming (Vychislitel'nye Metody i Programmirovanie)},
190
+ year = {2023},
191
+ volume = {24},
192
+ number = {2},
193
+ pages = {231--242},
194
+ doi = {10.26089/NumMet.v24r217},
195
+ url = {https://doi.org/10.26089/NumMet.v24r217}
196
+ }
197
+ ```
198
+
199
+ 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.
200
+