vagheshpatel commited on
Commit
aacc916
·
verified ·
1 Parent(s): 55e2d22

Sync worker-safety-detection from metro-analytics-catalog

Browse files
Files changed (3) hide show
  1. .gitattributes +1 -0
  2. README.md +15 -13
  3. expected_output_dlstreamer.gif +3 -0
.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
  # Worker Safety Detection
2
 
3
- > **Validated with:** OpenVINO 2026.1.0, DLStreamer 2026.0, Python 3.11+
4
-
5
  | Property | Value |
6
  |---|---|
7
  | **Category** | Object Detection (PPE / Safety Compliance) |
@@ -80,7 +78,7 @@ Output files:
80
 
81
  The pipeline below runs the worker safety FP32 detector on the sample video via
82
  `gvadetect`, overlays bounding boxes with `gvawatermark`, and saves the
83
- annotated result to `output.mp4`.
84
 
85
  > **Notes on running this sample:**
86
  >
@@ -108,16 +106,16 @@ Gst.init(None)
108
  MODEL_XML = "models/worker-safety-gear-detection/deployment/Detection/model/model.xml"
109
  INPUT_VIDEO = "test_video.avi"
110
 
111
- # For GPU: change device=CPU to device=GPU, add vapostproc !
112
- # video/x-raw(memory:VASurface) after decodebin3, and set
113
- # pre-process-backend=vaapi-surface-sharing on gvadetect.
114
- # For NPU: change device=CPU to device=NPU (batch-size=1, nireq=4 recommended).
115
  pipeline_str = (
116
  f"filesrc location={INPUT_VIDEO} ! decodebin3 ! "
117
- f"gvadetect model={MODEL_XML} device=CPU threshold=0.4 ! queue ! "
 
 
118
  f"gvawatermark ! videoconvert ! video/x-raw,format=I420 ! "
119
  f"openh264enc ! h264parse ! "
120
- f"mp4mux ! filesink name=sink location=output.mp4"
121
  )
122
  pipeline = Gst.parse_launch(pipeline_str)
123
 
@@ -158,7 +156,7 @@ Expected console output (representative):
158
  [PPE] safety_jacket conf=0.82
159
  ```
160
 
161
- The annotated video is saved to `output.mp4` with bounding boxes drawn by
162
  `gvawatermark` around each detected `safety_helmet` and `safety_jacket`.
163
 
164
  > **Known warning:** The `openh264enc` element prints
@@ -167,11 +165,15 @@ The annotated video is saved to `output.mp4` with bounding boxes drawn by
167
  > video is encoded correctly. The warning comes from the OpenH264 library's
168
  > internal logging and does not indicate a real error.
169
 
 
 
 
 
170
  **Device targets:**
171
 
172
- - `device=CPU` -- default in the sample code.
173
- - `device=GPU` -- add `vapostproc ! video/x-raw(memory:VASurface)` after `decodebin3` and set `pre-process-backend=vaapi-surface-sharing` on `gvadetect`.
174
- - `device=NPU` -- use `batch-size=1` and `nireq=4` for best NPU utilization.
175
 
176
  ---
177
 
 
1
  # Worker Safety Detection
2
 
 
 
3
  | Property | Value |
4
  |---|---|
5
  | **Category** | Object Detection (PPE / Safety Compliance) |
 
78
 
79
  The pipeline below runs the worker safety FP32 detector on the sample video via
80
  `gvadetect`, overlays bounding boxes with `gvawatermark`, and saves the
81
+ annotated result to `output_dlstreamer.mp4`.
82
 
83
  > **Notes on running this sample:**
84
  >
 
106
  MODEL_XML = "models/worker-safety-gear-detection/deployment/Detection/model/model.xml"
107
  INPUT_VIDEO = "test_video.avi"
108
 
109
+ # For CPU: change device=GPU to device=CPU.
110
+ # For NPU: change device=GPU to device=NPU (batch-size=1, nireq=4 recommended).
 
 
111
  pipeline_str = (
112
  f"filesrc location={INPUT_VIDEO} ! decodebin3 ! "
113
+ f"videoconvert ! "
114
+ f"gvadetect model={MODEL_XML} device=GPU "
115
+ f"threshold=0.4 ! queue ! "
116
  f"gvawatermark ! videoconvert ! video/x-raw,format=I420 ! "
117
  f"openh264enc ! h264parse ! "
118
+ f"mp4mux ! filesink name=sink location=output_dlstreamer.mp4"
119
  )
120
  pipeline = Gst.parse_launch(pipeline_str)
121
 
 
156
  [PPE] safety_jacket conf=0.82
157
  ```
158
 
159
+ The annotated video is saved to `output_dlstreamer.mp4` with bounding boxes drawn by
160
  `gvawatermark` around each detected `safety_helmet` and `safety_jacket`.
161
 
162
  > **Known warning:** The `openh264enc` element prints
 
165
  > video is encoded correctly. The warning comes from the OpenH264 library's
166
  > internal logging and does not indicate a real error.
167
 
168
+ #### Expected Output
169
+
170
+ ![DLStreamer expected output](expected_output_dlstreamer.gif)
171
+
172
  **Device targets:**
173
 
174
+ - `device=GPU` -- default in the sample code.
175
+ - `device=CPU` -- change `device=GPU` to `device=CPU`.
176
+ - `device=NPU` -- change `device=GPU` to `device=NPU`; use `batch-size=1` and `nireq=4` for best NPU utilization.
177
 
178
  ---
179
 
expected_output_dlstreamer.gif ADDED

Git LFS Details

  • SHA256: 3244025203a0c5103a5f26f29c5b53befa64b08735f270016b0500e5f1d4b503
  • Pointer size: 132 Bytes
  • Size of remote file: 8.77 MB