Views
No views yet
| Property | Value |
|---|---|
| Category | Object Detection (PPE / Safety Compliance) |
| Base Model | Worker Safety Gear Detection (Intel Edge AI Resources, Geti-trained) |
| Source Framework | Intel Geti (OpenVINO IR) |
| Supported Precisions | FP32 |
| Inference Engine | OpenVINO |
| Hardware | CPU, GPU, NPU |
| Detected Class(es) | safety_jacket (class 0), safety_helmet (class 1) |
safety_jacket (high-visibility vest) and safety_helmet (hard hat).
Frames where expected PPE is not detected indicate non-compliance.safety_helmet or safety_jacket detections are absent for detected persons.1python3 -m venv .venv --system-site-packages
2source .venv/bin/activateNote: The--system-site-packagesflag is required so the virtual environment can access the system-installed OpenVINO and DLStreamer Python packages.
1chmod +x export_and_quantize.sh
2./export_and_quantize.shopenvino).test_video.avi) from Intel Edge AI Resources.worker-safety-gear-detection.zip from the Intel Edge AI Resources repository../models/worker_safety_gear_detection/deployment/Detection/model/model.xml -- FP32 OpenVINO IR used by the DLStreamer sample.Note: The FP32 model is ready for production use on CPU and GPU. An INT8 variant is also available from the INT8 models directory for higher throughput.
gvadetect, overlays bounding boxes with gvawatermark, and saves the
annotated result to output_dlstreamer.mp4.Notes on running this sample:
The Geti-exported model embeds post-processing and labels internally.gvadetectauto-discovers the model type for Geti-exported IRs, so no externalmodel-procJSON is required for this flow. ExportPYTHONPATHso the DLStreamer Python module is importable:bash1source /opt/intel/openvino_2026/setupvars.sh 2source /opt/intel/dlstreamer/scripts/setup_dls_env.sh 3export PYTHONPATH=/opt/intel/dlstreamer/python:\ 4/opt/intel/dlstreamer/gstreamer/lib/python3/dist-packages:${PYTHONPATH:-}
1import gi
2
3gi.require_version("Gst", "1.0")
4gi.require_version("GstAnalytics", "1.0")
5from gi.repository import Gst, GLib, GstAnalytics
6
7Gst.init([])
8
9MODEL_XML = (
10 "models/worker_safety_gear_detection/"
11 "deployment/Detection/model/model.xml"
12)
13INPUT_VIDEO = "test_video.avi"
14
15# For CPU: change device=GPU to device=CPU.
16# For NPU: change device=GPU to device=NPU (batch-size=1, nireq=4 recommended).
17pipeline_str = (
18 f"filesrc location={INPUT_VIDEO} ! decodebin3 ! "
19 f"videoconvert ! "
20 f"gvadetect model={MODEL_XML} device=GPU "
21 f"threshold=0.4 ! queue ! "
22 f"gvawatermark ! videoconvert ! video/x-raw,format=I420 ! "
23 f"openh264enc ! h264parse ! "
24 f"mp4mux ! filesink name=sink location=output_dlstreamer.mp4"
25)
26pipeline = Gst.parse_launch(pipeline_str)
27
28
29def on_buffer(pad, info):
30 buf = info.get_buffer()
31 rmeta = GstAnalytics.buffer_get_analytics_relation_meta(buf)
32 if rmeta is None:
33 return Gst.PadProbeReturn.OK
34 idx = 1
35 while True:
36 ok, od = rmeta.get_od_mtd(idx)
37 if not ok:
38 break
39 label = GLib.quark_to_string(od.get_obj_type())
40 _, x, y, w, h, conf = od.get_location()
41 print(f" [PPE] {label} conf={conf:.2f}", flush=True)
42 idx += 1
43 return Gst.PadProbeReturn.OK
44
45
46sink = pipeline.get_by_name("sink")
47sink_pad = sink.get_static_pad("sink")
48sink_pad.add_probe(Gst.PadProbeType.BUFFER, on_buffer)
49
50pipeline.set_state(Gst.State.PLAYING)
51bus = pipeline.get_bus()
52bus.timed_pop_filtered(
53 Gst.CLOCK_TIME_NONE,
54 Gst.MessageType.EOS | Gst.MessageType.ERROR,
55)
56pipeline.set_state(Gst.State.NULL)export_and_quantize.sh script downloads test_video.avi automatically.
Run the DLStreamer sample above.
The buffer probe prints one line per detected safety item per frame.1 [PPE] safety_helmet conf=0.87
2 [PPE] safety_jacket conf=0.82output_dlstreamer.mp4 with bounding boxes drawn by
gvawatermark around each detected safety_helmet and safety_jacket.Known warning: Theopenh264encelement prints[OpenH264] this = 0x..., Error:CWelsH264SVCEncoder::EncodeFrame(), cmInitParaError.on the first frame. This is a benign initialization message — the output video is encoded correctly. The warning comes from the OpenH264 library's internal logging and does not indicate a real error.

device=GPU -- default in the sample code.device=CPU -- change device=GPU to device=CPU.device=NPU -- change device=GPU to device=NPU; use batch-size=1 and nireq=4 for best NPU utilization.