Update native RC1 samples and supported device documentation
Browse files- README.md +16 -2
- dlstreamer_sample.py +62 -0
- export_and_quantize.sh +2 -3
README.md
CHANGED
|
@@ -52,9 +52,13 @@ Typical deployments include:
|
|
| 52 |
|
| 53 |
## Prerequisites
|
| 54 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 55 |
- Python 3.11+
|
| 56 |
- [Install OpenVINO](https://docs.openvino.ai/2026/get-started/install-openvino.html) (latest version)
|
| 57 |
-
- [Install Intel DLStreamer](https://docs.openedgeplatform.intel.com/
|
| 58 |
|
| 59 |
Create and activate a Python virtual environment before running the scripts:
|
| 60 |
|
|
@@ -114,7 +118,16 @@ annotated result to `output_dlstreamer.mp4`.
|
|
| 114 |
> /opt/intel/dlstreamer/gstreamer/lib/python3/dist-packages:${PYTHONPATH:-}
|
| 115 |
> ```
|
| 116 |
|
|
|
|
|
|
|
|
|
|
| 117 |
```python
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 118 |
import gi
|
| 119 |
|
| 120 |
gi.require_version("Gst", "1.0")
|
|
@@ -172,6 +185,7 @@ bus.timed_pop_filtered(
|
|
| 172 |
)
|
| 173 |
pipeline.set_state(Gst.State.NULL)
|
| 174 |
```
|
|
|
|
| 175 |
|
| 176 |
### Try It on a Sample Video
|
| 177 |
|
|
@@ -217,4 +231,4 @@ Licensed under the MIT License. See [LICENSE](LICENSE) for details.
|
|
| 217 |
- [Worker Safety Gear Detection Application (Edge AI Suites)](https://github.com/open-edge-platform/edge-ai-suites/tree/main/manufacturing-ai-suite/industrial-edge-insights-vision)
|
| 218 |
- [Intel Geti Platform](https://geti.intel.com/)
|
| 219 |
- [OpenVINO Documentation](https://docs.openvino.ai/)
|
| 220 |
-
- [Intel DLStreamer](https://docs.openedgeplatform.intel.com/
|
|
|
|
| 52 |
|
| 53 |
## Prerequisites
|
| 54 |
|
| 55 |
+
Target stack: Intel DLStreamer **2026.3.0 RC1** with the matching OpenVINO GenAI bundle **2026.5.0.0.dev20261030** (OpenVINO Runtime **2026.5.0.dev20261030**).
|
| 56 |
+
Use the [native RC1 setup](../README.md#native-rc1-runtime) before running these samples; this is a development stack, not a stable release.
|
| 57 |
+
See the [device validation matrix](../DEVICE_SUPPORT_MATRIX.md) for measured CPU, GPU, and NPU results.
|
| 58 |
+
|
| 59 |
- Python 3.11+
|
| 60 |
- [Install OpenVINO](https://docs.openvino.ai/2026/get-started/install-openvino.html) (latest version)
|
| 61 |
+
- [Install Intel DLStreamer](https://docs.openedgeplatform.intel.com/dev/edge-ai-libraries/dlstreamer/get_started/install/install_guide_ubuntu.html) (latest version)
|
| 62 |
|
| 63 |
Create and activate a Python virtual environment before running the scripts:
|
| 64 |
|
|
|
|
| 118 |
> /opt/intel/dlstreamer/gstreamer/lib/python3/dist-packages:${PYTHONPATH:-}
|
| 119 |
> ```
|
| 120 |
|
| 121 |
+
The full sample is in [dlstreamer_sample.py](dlstreamer_sample.py); run it with `python3 dlstreamer_sample.py` or copy the code below.
|
| 122 |
+
|
| 123 |
+
<!-- sample: dlstreamer_sample.py -->
|
| 124 |
```python
|
| 125 |
+
# SPDX-License-Identifier: MIT
|
| 126 |
+
# Copyright (C) Intel Corporation
|
| 127 |
+
#
|
| 128 |
+
# Worker Safety Detection: DLStreamer pipeline sample.
|
| 129 |
+
# See README.md for prerequisites and inputs. Run: python3 dlstreamer_sample.py
|
| 130 |
+
|
| 131 |
import gi
|
| 132 |
|
| 133 |
gi.require_version("Gst", "1.0")
|
|
|
|
| 185 |
)
|
| 186 |
pipeline.set_state(Gst.State.NULL)
|
| 187 |
```
|
| 188 |
+
<!-- /sample -->
|
| 189 |
|
| 190 |
### Try It on a Sample Video
|
| 191 |
|
|
|
|
| 231 |
- [Worker Safety Gear Detection Application (Edge AI Suites)](https://github.com/open-edge-platform/edge-ai-suites/tree/main/manufacturing-ai-suite/industrial-edge-insights-vision)
|
| 232 |
- [Intel Geti Platform](https://geti.intel.com/)
|
| 233 |
- [OpenVINO Documentation](https://docs.openvino.ai/)
|
| 234 |
+
- [Intel DLStreamer](https://docs.openedgeplatform.intel.com/dev/edge-ai-libraries/dlstreamer/index.html)
|
dlstreamer_sample.py
ADDED
|
@@ -0,0 +1,62 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
# SPDX-License-Identifier: MIT
|
| 2 |
+
# Copyright (C) Intel Corporation
|
| 3 |
+
#
|
| 4 |
+
# Worker Safety Detection: DLStreamer pipeline sample.
|
| 5 |
+
# See README.md for prerequisites and inputs. Run: python3 dlstreamer_sample.py
|
| 6 |
+
|
| 7 |
+
import gi
|
| 8 |
+
|
| 9 |
+
gi.require_version("Gst", "1.0")
|
| 10 |
+
gi.require_version("GstAnalytics", "1.0")
|
| 11 |
+
from gi.repository import Gst, GLib, GstAnalytics
|
| 12 |
+
|
| 13 |
+
Gst.init([])
|
| 14 |
+
|
| 15 |
+
MODEL_XML = (
|
| 16 |
+
"models/worker_safety_gear_detection/"
|
| 17 |
+
"deployment/Detection/model/model.xml"
|
| 18 |
+
)
|
| 19 |
+
INPUT_VIDEO = "test_video.avi"
|
| 20 |
+
|
| 21 |
+
# For CPU: change device=GPU to device=CPU.
|
| 22 |
+
# For NPU: change device=GPU to device=NPU (batch-size=1, nireq=4 recommended).
|
| 23 |
+
pipeline_str = (
|
| 24 |
+
f"filesrc location={INPUT_VIDEO} ! decodebin3 ! "
|
| 25 |
+
f"videoconvert ! "
|
| 26 |
+
f"gvadetect model={MODEL_XML} device=GPU "
|
| 27 |
+
f"threshold=0.4 ! queue ! "
|
| 28 |
+
f"gvawatermark ! videoconvert ! video/x-raw,format=I420 ! "
|
| 29 |
+
f"openh264enc ! h264parse ! "
|
| 30 |
+
f"mp4mux ! filesink name=sink location=output_dlstreamer.mp4"
|
| 31 |
+
)
|
| 32 |
+
pipeline = Gst.parse_launch(pipeline_str)
|
| 33 |
+
|
| 34 |
+
|
| 35 |
+
def on_buffer(pad, info):
|
| 36 |
+
buf = info.get_buffer()
|
| 37 |
+
rmeta = GstAnalytics.buffer_get_analytics_relation_meta(buf)
|
| 38 |
+
if rmeta is None:
|
| 39 |
+
return Gst.PadProbeReturn.OK
|
| 40 |
+
idx = 1
|
| 41 |
+
while True:
|
| 42 |
+
ok, od = rmeta.get_od_mtd(idx)
|
| 43 |
+
if not ok:
|
| 44 |
+
break
|
| 45 |
+
label = GLib.quark_to_string(od.get_obj_type())
|
| 46 |
+
_, x, y, w, h, conf = od.get_location()
|
| 47 |
+
print(f" [PPE] {label} conf={conf:.2f}", flush=True)
|
| 48 |
+
idx += 1
|
| 49 |
+
return Gst.PadProbeReturn.OK
|
| 50 |
+
|
| 51 |
+
|
| 52 |
+
sink = pipeline.get_by_name("sink")
|
| 53 |
+
sink_pad = sink.get_static_pad("sink")
|
| 54 |
+
sink_pad.add_probe(Gst.PadProbeType.BUFFER, on_buffer)
|
| 55 |
+
|
| 56 |
+
pipeline.set_state(Gst.State.PLAYING)
|
| 57 |
+
bus = pipeline.get_bus()
|
| 58 |
+
bus.timed_pop_filtered(
|
| 59 |
+
Gst.CLOCK_TIME_NONE,
|
| 60 |
+
Gst.MessageType.EOS | Gst.MessageType.ERROR,
|
| 61 |
+
)
|
| 62 |
+
pipeline.set_state(Gst.State.NULL)
|
export_and_quantize.sh
CHANGED
|
@@ -15,9 +15,6 @@ ZIP_URL="https://github.com/open-edge-platform/edge-ai-resources/raw/main/models
|
|
| 15 |
ZIP_FILE="${OUTPUT_DIR}/worker-safety-gear-detection.zip"
|
| 16 |
EXPECTED_XML="${MODEL_DIR}/deployment/Detection/model/model.xml"
|
| 17 |
|
| 18 |
-
echo "--- Installing dependencies ---"
|
| 19 |
-
pip install -qU openvino
|
| 20 |
-
|
| 21 |
# Ask for approval before downloading models and sample files
|
| 22 |
echo ""
|
| 23 |
echo "This script will download:"
|
|
@@ -42,6 +39,8 @@ else
|
|
| 42 |
echo "WARNING: HuggingFace tracking ping failed (offline?); continuing." >&2
|
| 43 |
fi
|
| 44 |
echo ""
|
|
|
|
|
|
|
| 45 |
|
| 46 |
echo "--- Downloading sample test video ---"
|
| 47 |
if [[ ! -f test_video.avi ]]; then
|
|
|
|
| 15 |
ZIP_FILE="${OUTPUT_DIR}/worker-safety-gear-detection.zip"
|
| 16 |
EXPECTED_XML="${MODEL_DIR}/deployment/Detection/model/model.xml"
|
| 17 |
|
|
|
|
|
|
|
|
|
|
| 18 |
# Ask for approval before downloading models and sample files
|
| 19 |
echo ""
|
| 20 |
echo "This script will download:"
|
|
|
|
| 39 |
echo "WARNING: HuggingFace tracking ping failed (offline?); continuing." >&2
|
| 40 |
fi
|
| 41 |
echo ""
|
| 42 |
+
echo "--- Installing dependencies ---"
|
| 43 |
+
pip install -qU openvino
|
| 44 |
|
| 45 |
echo "--- Downloading sample test video ---"
|
| 46 |
if [[ ! -f test_video.avi ]]; then
|