Sync loitering-detection from metro-analytics-catalog
Browse files- .gitattributes +1 -0
- README.md +14 -5
- expected_output_dlstreamer.gif +3 -0
- export_and_quantize.sh +1 -1
.gitattributes
CHANGED
|
@@ -33,3 +33,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
| 33 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
| 34 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
| 35 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
| 36 |
+
expected_output_dlstreamer.gif filter=lfs diff=lfs merge=lfs -text
|
README.md
CHANGED
|
@@ -1,7 +1,5 @@
|
|
| 1 |
# Loitering Detection
|
| 2 |
|
| 3 |
-
> **Validated with:** OpenVINO 2026.1.0, NNCF 3.0.0, DLStreamer 2026.0, Ultralytics 8.4.46, Python 3.11+
|
| 4 |
-
|
| 5 |
| Property | Value |
|
| 6 |
|---|---|
|
| 7 |
| **Category** | Object Detection + Tracking + Zone Analytics |
|
|
@@ -152,15 +150,16 @@ LOITERING_SECONDS = 5.0
|
|
| 152 |
|
| 153 |
pipeline_str = (
|
| 154 |
f"filesrc location={INPUT_VIDEO} ! decodebin3 ! "
|
|
|
|
| 155 |
f"gvaattachroi roi={ROI} ! "
|
| 156 |
-
f"gvadetect inference-region=1 model={MODEL_XML} device=
|
| 157 |
f"threshold=0.5 ! queue ! "
|
| 158 |
f"gvatrack tracking-type=short-term-imageless ! queue ! "
|
| 159 |
f"gvametaconvert add-empty-results=true ! queue ! "
|
| 160 |
f"gvafpscounter ! "
|
| 161 |
f"gvawatermark ! videoconvert ! video/x-raw,format=I420 ! "
|
| 162 |
f"openh264enc ! h264parse ! "
|
| 163 |
-
f"mp4mux ! filesink name=sink location=
|
| 164 |
)
|
| 165 |
pipeline = Gst.parse_launch(pipeline_str)
|
| 166 |
|
|
@@ -248,7 +247,7 @@ LOITERING id=29 dwell=5.0s anchor=(90,322)
|
|
| 248 |
|
| 249 |
Approximately 10–12 loitering events are expected over the full video.
|
| 250 |
|
| 251 |
-
The annotated video is saved to `
|
| 252 |
track IDs drawn by `gvawatermark` around every detected person.
|
| 253 |
|
| 254 |
> **Known warning:** The `openh264enc` element prints
|
|
@@ -257,6 +256,16 @@ track IDs drawn by `gvawatermark` around every detected person.
|
|
| 257 |
> video is encoded correctly. The warning comes from the OpenH264 library's
|
| 258 |
> internal logging and does not indicate a real error.
|
| 259 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 260 |
---
|
| 261 |
|
| 262 |
## License
|
|
|
|
| 1 |
# Loitering Detection
|
| 2 |
|
|
|
|
|
|
|
| 3 |
| Property | Value |
|
| 4 |
|---|---|
|
| 5 |
| **Category** | Object Detection + Tracking + Zone Analytics |
|
|
|
|
| 150 |
|
| 151 |
pipeline_str = (
|
| 152 |
f"filesrc location={INPUT_VIDEO} ! decodebin3 ! "
|
| 153 |
+
f"videoconvert ! "
|
| 154 |
f"gvaattachroi roi={ROI} ! "
|
| 155 |
+
f"gvadetect inference-region=1 model={MODEL_XML} device=GPU "
|
| 156 |
f"threshold=0.5 ! queue ! "
|
| 157 |
f"gvatrack tracking-type=short-term-imageless ! queue ! "
|
| 158 |
f"gvametaconvert add-empty-results=true ! queue ! "
|
| 159 |
f"gvafpscounter ! "
|
| 160 |
f"gvawatermark ! videoconvert ! video/x-raw,format=I420 ! "
|
| 161 |
f"openh264enc ! h264parse ! "
|
| 162 |
+
f"mp4mux ! filesink name=sink location=output_dlstreamer.mp4"
|
| 163 |
)
|
| 164 |
pipeline = Gst.parse_launch(pipeline_str)
|
| 165 |
|
|
|
|
| 247 |
|
| 248 |
Approximately 10–12 loitering events are expected over the full video.
|
| 249 |
|
| 250 |
+
The annotated video is saved to `output_dlstreamer.mp4` with green bounding boxes and
|
| 251 |
track IDs drawn by `gvawatermark` around every detected person.
|
| 252 |
|
| 253 |
> **Known warning:** The `openh264enc` element prints
|
|
|
|
| 256 |
> video is encoded correctly. The warning comes from the OpenH264 library's
|
| 257 |
> internal logging and does not indicate a real error.
|
| 258 |
|
| 259 |
+
#### Expected Output
|
| 260 |
+
|
| 261 |
+

|
| 262 |
+
|
| 263 |
+
**Device targets:**
|
| 264 |
+
|
| 265 |
+
- `device=GPU` -- default in the sample code.
|
| 266 |
+
- `device=CPU` -- change `device=GPU` to `device=CPU`.
|
| 267 |
+
- `device=NPU` -- change `device=GPU` to `device=NPU`; use `batch-size=1` and `nireq=4` for best NPU utilization.
|
| 268 |
+
|
| 269 |
---
|
| 270 |
|
| 271 |
## License
|
expected_output_dlstreamer.gif
ADDED
|
Git LFS Details
|
export_and_quantize.sh
CHANGED
|
@@ -39,7 +39,7 @@ fi
|
|
| 39 |
echo "--- Downloading sample test video ---"
|
| 40 |
if [[ ! -f VIRAT_S_000101.mp4 ]]; then
|
| 41 |
wget -O VIRAT_S_000101.mp4 \
|
| 42 |
-
https://github.com/
|
| 43 |
echo "Downloaded: VIRAT_S_000101.mp4"
|
| 44 |
else
|
| 45 |
echo "Already present: VIRAT_S_000101.mp4"
|
|
|
|
| 39 |
echo "--- Downloading sample test video ---"
|
| 40 |
if [[ ! -f VIRAT_S_000101.mp4 ]]; then
|
| 41 |
wget -O VIRAT_S_000101.mp4 \
|
| 42 |
+
https://github.com/open-edge-platform/edge-ai-resources/raw/refs/heads/main/videos/VIRAT_S_000101.mp4
|
| 43 |
echo "Downloaded: VIRAT_S_000101.mp4"
|
| 44 |
else
|
| 45 |
echo "Already present: VIRAT_S_000101.mp4"
|