Commit a8c709a
authored
Automatic Video Frame Resizing in edgeimpulsevideoinfer (#29)
This PR enhances the `edgeimpulsevideoinfer` GStreamer element to automatically handle video frame resizing internally, eliminating the need for users to manually resize frames before inference.
Previously, users were required to ensure video frames matched the ML model's expected input dimensions (e.g., 224x224). This forced complex GStreamer pipelines with external `videoscale` elements and manual resolution management:
```bash
# Old approach - complex pipeline with manual resizing
gst-launch-1.0 qtiqmmfsrc camera=0 ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 ! \
videoconvert ! videoscale ! video/x-raw,format=RGB,width=224,height=224 ! \
edgeimpulsevideoinfer threshold="3.minScore=0.5" ! edgeimpulseoverlay ! \
videoconvert ! videoscale ! video/x-raw,format=RGB,width=1920,height=1080 ! \
waylandsink display="wayland-1" sync=false fullscreen=true
```
```bash
# New approach - clean, simple pipeline
gst-launch-1.0 qtiqmmfsrc camera=0 ! video/x-raw,format=NV12,width=1920,height=1080,framerate=30/1 ! \
videoconvert ! edgeimpulsevideoinfer threshold="3.minScore=0.5" ! \
edgeimpulseoverlay ! waylandsink display="wayland-1" sync=false fullscreen=true
```1 parent eab604a commit a8c709a
File tree
9 files changed
+653
-181
lines changed- examples
- src
- audio
- video
9 files changed
+653
-181
lines changedLarge diffs are not rendered by default.
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
1 | 1 | | |
| 2 | + | |
| 3 | + | |
| 4 | + | |
| 5 | + | |
| 6 | + | |
| 7 | + | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
| 11 | + | |
| 12 | + | |
| 13 | + | |
| 14 | + | |
| 15 | + | |
| 16 | + | |
| 17 | + | |
| 18 | + | |
| 19 | + | |
| 20 | + | |
| 21 | + | |
| 22 | + | |
2 | 23 | | |
3 | 24 | | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
8 | 8 | | |
9 | 9 | | |
10 | 10 | | |
11 | | - | |
| 11 | + | |
12 | 12 | | |
13 | 13 | | |
14 | 14 | | |
| |||
37 | 37 | | |
38 | 38 | | |
39 | 39 | | |
40 | | - | |
| 40 | + | |
41 | 41 | | |
42 | 42 | | |
43 | 43 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
5 | 5 | | |
6 | 6 | | |
7 | 7 | | |
| 8 | + | |
| 9 | + | |
| 10 | + | |
8 | 11 | | |
9 | 12 | | |
10 | 13 | | |
11 | 14 | | |
12 | 15 | | |
13 | 16 | | |
14 | 17 | | |
| 18 | + | |
15 | 19 | | |
16 | 20 | | |
17 | 21 | | |
| |||
42 | 46 | | |
43 | 47 | | |
44 | 48 | | |
45 | | - | |
46 | | - | |
47 | | - | |
48 | | - | |
49 | | - | |
50 | | - | |
51 | | - | |
52 | | - | |
53 | 49 | | |
54 | 50 | | |
55 | 51 | | |
| |||
103 | 99 | | |
104 | 100 | | |
105 | 101 | | |
106 | | - | |
107 | | - | |
108 | 102 | | |
109 | 103 | | |
110 | 104 | | |
| |||
222 | 216 | | |
223 | 217 | | |
224 | 218 | | |
225 | | - | |
226 | 219 | | |
227 | 220 | | |
228 | 221 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
13 | 13 | | |
14 | 14 | | |
15 | 15 | | |
| 16 | + | |
16 | 17 | | |
17 | 18 | | |
18 | 19 | | |
| |||
28 | 29 | | |
29 | 30 | | |
30 | 31 | | |
31 | | - | |
32 | | - | |
33 | | - | |
34 | | - | |
35 | | - | |
36 | | - | |
37 | | - | |
38 | | - | |
39 | 32 | | |
40 | 33 | | |
41 | 34 | | |
| |||
187 | 180 | | |
188 | 181 | | |
189 | 182 | | |
190 | | - | |
| 183 | + | |
191 | 184 | | |
192 | 185 | | |
193 | 186 | | |
| |||
203 | 196 | | |
204 | 197 | | |
205 | 198 | | |
| 199 | + | |
206 | 200 | | |
207 | 201 | | |
208 | | - | |
209 | | - | |
210 | 202 | | |
211 | 203 | | |
212 | 204 | | |
213 | 205 | | |
214 | 206 | | |
215 | 207 | | |
216 | | - | |
217 | | - | |
218 | 208 | | |
219 | 209 | | |
220 | 210 | | |
| |||
223 | 213 | | |
224 | 214 | | |
225 | 215 | | |
226 | | - | |
227 | 216 | | |
228 | 217 | | |
229 | 218 | | |
| |||
259 | 248 | | |
260 | 249 | | |
261 | 250 | | |
262 | | - | |
263 | 251 | | |
264 | 252 | | |
265 | 253 | | |
| |||
0 commit comments