removed-openvino-op
#1
by vagheshpatel - opened
- LICENSE +57 -21
- README.md +23 -38
- export_and_quantize.sh +2 -24
LICENSE
CHANGED
|
@@ -1,21 +1,57 @@
|
|
| 1 |
-
|
| 2 |
-
|
| 3 |
-
|
| 4 |
-
|
| 5 |
-
|
| 6 |
-
|
| 7 |
-
|
| 8 |
-
|
| 9 |
-
|
| 10 |
-
|
| 11 |
-
|
| 12 |
-
|
| 13 |
-
|
| 14 |
-
|
| 15 |
-
|
| 16 |
-
|
| 17 |
-
|
| 18 |
-
|
| 19 |
-
|
| 20 |
-
|
| 21 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
This directory contains two categories of content under different licenses.
|
| 2 |
+
|
| 3 |
+
|
| 4 |
+
Scripts and Documentation
|
| 5 |
+
-------------------------
|
| 6 |
+
|
| 7 |
+
The scripts (export_and_quantize.sh) and documentation (README.md) in this
|
| 8 |
+
directory are original works by Intel Corporation, licensed under the
|
| 9 |
+
MIT License.
|
| 10 |
+
|
| 11 |
+
Copyright (C) Intel Corporation
|
| 12 |
+
|
| 13 |
+
Permission is hereby granted, free of charge, to any person obtaining a copy
|
| 14 |
+
of this software and associated documentation files (the "Software"), to deal
|
| 15 |
+
in the Software without restriction, including without limitation the rights
|
| 16 |
+
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
|
| 17 |
+
copies of the Software, and to permit persons to whom the Software is
|
| 18 |
+
furnished to do so, subject to the following conditions:
|
| 19 |
+
|
| 20 |
+
The above copyright notice and this permission notice shall be included in
|
| 21 |
+
all copies or substantial portions of the Software.
|
| 22 |
+
|
| 23 |
+
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
|
| 24 |
+
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
|
| 25 |
+
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
|
| 26 |
+
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
|
| 27 |
+
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
|
| 28 |
+
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
|
| 29 |
+
THE SOFTWARE.
|
| 30 |
+
|
| 31 |
+
|
| 32 |
+
YOLO26 Model
|
| 33 |
+
------------
|
| 34 |
+
|
| 35 |
+
The YOLO26 model weights and the Ultralytics framework are developed by
|
| 36 |
+
Ultralytics and licensed under the GNU Affero General Public License v3.0
|
| 37 |
+
(AGPL-3.0).
|
| 38 |
+
|
| 39 |
+
Source: https://github.com/ultralytics/ultralytics
|
| 40 |
+
License: https://github.com/ultralytics/ultralytics/blob/main/LICENSE
|
| 41 |
+
Docs: https://docs.ultralytics.com/models/yolo26/
|
| 42 |
+
|
| 43 |
+
Users must comply with the AGPL-3.0 license terms when using, modifying,
|
| 44 |
+
or distributing the YOLO26 model weights or Ultralytics software.
|
| 45 |
+
For commercial licensing options, see https://www.ultralytics.com/license.
|
| 46 |
+
|
| 47 |
+
|
| 48 |
+
BoT-SORT / ByteTrack Trackers
|
| 49 |
+
------------------------------
|
| 50 |
+
|
| 51 |
+
The BoT-SORT and ByteTrack tracking algorithms are integrated into the
|
| 52 |
+
Ultralytics framework. Original implementations:
|
| 53 |
+
|
| 54 |
+
BoT-SORT: https://github.com/NirAharon/BoT-SORT
|
| 55 |
+
ByteTrack: https://github.com/FoundationVision/ByteTrack
|
| 56 |
+
|
| 57 |
+
Users should consult the respective repositories for license terms.
|
README.md
CHANGED
|
@@ -1,5 +1,6 @@
|
|
| 1 |
---
|
| 2 |
-
license:
|
|
|
|
| 3 |
license_link: LICENSE
|
| 4 |
library_name: openvino
|
| 5 |
pipeline_tag: object-detection
|
|
@@ -10,9 +11,12 @@ tags:
|
|
| 10 |
- yolo26
|
| 11 |
- motion-tracking
|
| 12 |
- multi-object-tracking
|
|
|
|
| 13 |
- edge-ai
|
| 14 |
- metro
|
| 15 |
- dlstreamer
|
|
|
|
|
|
|
| 16 |
language:
|
| 17 |
- en
|
| 18 |
---
|
|
@@ -22,7 +26,7 @@ language:
|
|
| 22 |
| Property | Value |
|
| 23 |
|---|---|
|
| 24 |
| **Category** | Object Detection + Multi-Object Tracking |
|
| 25 |
-
| **Base Model** | [YOLO26](https://docs.ultralytics.com/models/yolo26/) (Ultralytics) +
|
| 26 |
| **Source Framework** | PyTorch (Ultralytics) |
|
| 27 |
| **Supported Precisions** | FP32, FP16, INT8 (mixed-precision) |
|
| 28 |
| **Inference Engine** | OpenVINO |
|
|
@@ -51,8 +55,7 @@ Typical Metro deployments include:
|
|
| 51 |
|
| 52 |
Available YOLO26 variants: `yolo26n`, `yolo26s`, `yolo26m`, `yolo26l`, `yolo26x`.
|
| 53 |
Smaller variants (`yolo26n`, `yolo26s`) are recommended for high-FPS edge deployment.
|
| 54 |
-
The default tracker is
|
| 55 |
-
DLStreamer also supports `tracking-type=deep-sort` for more robust re-identification using a feature extraction model (e.g., mars-small128).
|
| 56 |
|
| 57 |
---
|
| 58 |
|
|
@@ -151,17 +154,15 @@ polylines are drawn with OpenCV, and the result is muxed to `output_dlstreamer.m
|
|
| 151 |
import subprocess
|
| 152 |
from collections import defaultdict
|
| 153 |
|
|
|
|
| 154 |
import numpy as np
|
| 155 |
import gi
|
| 156 |
|
| 157 |
gi.require_version("Gst", "1.0")
|
| 158 |
-
gi.
|
| 159 |
-
from
|
| 160 |
-
|
| 161 |
-
Gst.init([])
|
| 162 |
|
| 163 |
-
|
| 164 |
-
import cv2
|
| 165 |
|
| 166 |
# For CPU: change device=GPU to device=CPU.
|
| 167 |
# For NPU: change device=GPU to device=NPU (batch-size=1, nireq=4 recommended).
|
|
@@ -211,34 +212,16 @@ while True:
|
|
| 211 |
stdin=subprocess.PIPE, stderr=subprocess.DEVNULL,
|
| 212 |
)
|
| 213 |
|
| 214 |
-
# Read detection / tracking metadata
|
| 215 |
-
|
| 216 |
regions_data = []
|
| 217 |
-
|
| 218 |
-
|
| 219 |
-
|
| 220 |
-
|
| 221 |
-
|
| 222 |
-
|
| 223 |
-
|
| 224 |
-
if not ok_od and not ok_trk:
|
| 225 |
-
break
|
| 226 |
-
if ok_od:
|
| 227 |
-
label = GLib.quark_to_string(od.get_obj_type())
|
| 228 |
-
_, x, y, w, h, conf = od.get_location()
|
| 229 |
-
od_entries.append((idx, label, int(x + w / 2), int(y + h / 2)))
|
| 230 |
-
if ok_trk:
|
| 231 |
-
ok2, tid, _, _, _ = trk.get_info()
|
| 232 |
-
if ok2:
|
| 233 |
-
trk_map[idx] = tid
|
| 234 |
-
idx += 1
|
| 235 |
-
for od_id, label, cx, cy in od_entries:
|
| 236 |
-
tid = 0
|
| 237 |
-
for trk_meta_id, tracking_id in trk_map.items():
|
| 238 |
-
if rmeta.get_relation(od_id, trk_meta_id) != GstAnalytics.RelTypes.NONE:
|
| 239 |
-
tid = tracking_id
|
| 240 |
-
break
|
| 241 |
-
regions_data.append((tid, label, cx, cy))
|
| 242 |
|
| 243 |
# Map buffer read-only and copy pixels to a writable numpy array.
|
| 244 |
success, map_info = buf.map(Gst.MapFlags.READ)
|
|
@@ -282,14 +265,16 @@ print("Wrote output_dlstreamer.mp4", flush=True)
|
|
| 282 |
|
| 283 |
## License
|
| 284 |
|
|
|
|
| 285 |
Licensed under the MIT License. See [LICENSE](LICENSE) for details.
|
| 286 |
|
| 287 |
## References
|
| 288 |
|
| 289 |
- [YOLO26 Documentation](https://docs.ultralytics.com/models/yolo26/)
|
| 290 |
- [Ultralytics Multi-Object Tracking](https://docs.ultralytics.com/modes/track/)
|
|
|
|
|
|
|
| 291 |
- [Intel DLStreamer gvatrack](https://docs.openedgeplatform.intel.com/2026.0/edge-ai-libraries/dlstreamer/elements/gvatrack.html)
|
| 292 |
-
- [DLStreamer Object Tracking Guide](https://docs.openedgeplatform.intel.com/2026.0/edge-ai-libraries/dlstreamer/dev_guide/object_tracking.html)
|
| 293 |
- [OpenVINO Documentation](https://docs.openvino.ai/)
|
| 294 |
- [NNCF Post-Training Quantization](https://docs.openvino.ai/latest/nncf_ptq_introduction.html)
|
| 295 |
- [Intel DLStreamer](https://docs.openedgeplatform.intel.com/2026.0/edge-ai-libraries/dlstreamer/index.html)
|
|
|
|
| 1 |
---
|
| 2 |
+
license: other
|
| 3 |
+
license_name: intel-custom
|
| 4 |
license_link: LICENSE
|
| 5 |
library_name: openvino
|
| 6 |
pipeline_tag: object-detection
|
|
|
|
| 11 |
- yolo26
|
| 12 |
- motion-tracking
|
| 13 |
- multi-object-tracking
|
| 14 |
+
- bot-sort
|
| 15 |
- edge-ai
|
| 16 |
- metro
|
| 17 |
- dlstreamer
|
| 18 |
+
datasets:
|
| 19 |
+
- detection-datasets/coco
|
| 20 |
language:
|
| 21 |
- en
|
| 22 |
---
|
|
|
|
| 26 |
| Property | Value |
|
| 27 |
|---|---|
|
| 28 |
| **Category** | Object Detection + Multi-Object Tracking |
|
| 29 |
+
| **Base Model** | [YOLO26](https://docs.ultralytics.com/models/yolo26/) (Ultralytics) + [BoT-SORT](https://github.com/NirAharon/BoT-SORT) tracker |
|
| 30 |
| **Source Framework** | PyTorch (Ultralytics) |
|
| 31 |
| **Supported Precisions** | FP32, FP16, INT8 (mixed-precision) |
|
| 32 |
| **Inference Engine** | OpenVINO |
|
|
|
|
| 55 |
|
| 56 |
Available YOLO26 variants: `yolo26n`, `yolo26s`, `yolo26m`, `yolo26l`, `yolo26x`.
|
| 57 |
Smaller variants (`yolo26n`, `yolo26s`) are recommended for high-FPS edge deployment.
|
| 58 |
+
The default tracker is BoT-SORT; ByteTrack is available as an alternative with lower computational overhead.
|
|
|
|
| 59 |
|
| 60 |
---
|
| 61 |
|
|
|
|
| 154 |
import subprocess
|
| 155 |
from collections import defaultdict
|
| 156 |
|
| 157 |
+
import cv2
|
| 158 |
import numpy as np
|
| 159 |
import gi
|
| 160 |
|
| 161 |
gi.require_version("Gst", "1.0")
|
| 162 |
+
from gi.repository import Gst
|
| 163 |
+
from gstgva import VideoFrame
|
|
|
|
|
|
|
| 164 |
|
| 165 |
+
Gst.init(None)
|
|
|
|
| 166 |
|
| 167 |
# For CPU: change device=GPU to device=CPU.
|
| 168 |
# For NPU: change device=GPU to device=NPU (batch-size=1, nireq=4 recommended).
|
|
|
|
| 212 |
stdin=subprocess.PIPE, stderr=subprocess.DEVNULL,
|
| 213 |
)
|
| 214 |
|
| 215 |
+
# Read detection / tracking metadata.
|
| 216 |
+
frame = VideoFrame(buf, caps=caps)
|
| 217 |
regions_data = []
|
| 218 |
+
for region in frame.regions():
|
| 219 |
+
tid = region.object_id()
|
| 220 |
+
label = region.label()
|
| 221 |
+
rect = region.rect()
|
| 222 |
+
cx = int(rect.x + rect.w / 2)
|
| 223 |
+
cy = int(rect.y + rect.h / 2)
|
| 224 |
+
regions_data.append((tid, label, cx, cy))
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 225 |
|
| 226 |
# Map buffer read-only and copy pixels to a writable numpy array.
|
| 227 |
success, map_info = buf.map(Gst.MapFlags.READ)
|
|
|
|
| 265 |
|
| 266 |
## License
|
| 267 |
|
| 268 |
+
Copyright (C) Intel Corporation. All rights reserved.
|
| 269 |
Licensed under the MIT License. See [LICENSE](LICENSE) for details.
|
| 270 |
|
| 271 |
## References
|
| 272 |
|
| 273 |
- [YOLO26 Documentation](https://docs.ultralytics.com/models/yolo26/)
|
| 274 |
- [Ultralytics Multi-Object Tracking](https://docs.ultralytics.com/modes/track/)
|
| 275 |
+
- [BoT-SORT Tracker](https://github.com/NirAharon/BoT-SORT)
|
| 276 |
+
- [ByteTrack Tracker](https://github.com/FoundationVision/ByteTrack)
|
| 277 |
- [Intel DLStreamer gvatrack](https://docs.openedgeplatform.intel.com/2026.0/edge-ai-libraries/dlstreamer/elements/gvatrack.html)
|
|
|
|
| 278 |
- [OpenVINO Documentation](https://docs.openvino.ai/)
|
| 279 |
- [NNCF Post-Training Quantization](https://docs.openvino.ai/latest/nncf_ptq_introduction.html)
|
| 280 |
- [Intel DLStreamer](https://docs.openedgeplatform.intel.com/2026.0/edge-ai-libraries/dlstreamer/index.html)
|
export_and_quantize.sh
CHANGED
|
@@ -33,22 +33,11 @@ fi
|
|
| 33 |
|
| 34 |
echo "--- Installing dependencies ---"
|
| 35 |
if [[ "${PRECISION}" == "INT8" ]]; then
|
| 36 |
-
pip install -qU openvino nncf ultralytics
|
| 37 |
else
|
| 38 |
-
pip install -qU openvino ultralytics
|
| 39 |
fi
|
| 40 |
|
| 41 |
-
# Ask for approval before downloading models and sample files
|
| 42 |
-
echo ""
|
| 43 |
-
echo "This script will download:"
|
| 44 |
-
echo " - Model weights and/or sample files"
|
| 45 |
-
echo ""
|
| 46 |
-
read -p "Continue with downloads? (yes/no): " APPROVAL
|
| 47 |
-
if [[ "${APPROVAL}" != "yes" ]]; then
|
| 48 |
-
echo "Download cancelled by user."
|
| 49 |
-
exit 0
|
| 50 |
-
fi
|
| 51 |
-
echo ""
|
| 52 |
echo "--- Downloading sample test video ---"
|
| 53 |
if [[ ! -f test_video.mp4 ]]; then
|
| 54 |
wget -q -O test_video.mp4 \
|
|
@@ -58,17 +47,6 @@ else
|
|
| 58 |
echo "Already present: test_video.mp4"
|
| 59 |
fi
|
| 60 |
|
| 61 |
-
# Ask for approval before downloading models and sample files
|
| 62 |
-
echo ""
|
| 63 |
-
echo "This script will download:"
|
| 64 |
-
echo " - Model weights and/or sample files"
|
| 65 |
-
echo ""
|
| 66 |
-
read -p "Continue with downloads? (yes/no): " APPROVAL
|
| 67 |
-
if [[ "${APPROVAL}" != "yes" ]]; then
|
| 68 |
-
echo "Download cancelled by user."
|
| 69 |
-
exit 0
|
| 70 |
-
fi
|
| 71 |
-
echo ""
|
| 72 |
echo "--- Downloading sample test image ---"
|
| 73 |
if [[ ! -f test.jpg ]]; then
|
| 74 |
wget -q -O test.jpg https://ultralytics.com/images/bus.jpg
|
|
|
|
| 33 |
|
| 34 |
echo "--- Installing dependencies ---"
|
| 35 |
if [[ "${PRECISION}" == "INT8" ]]; then
|
| 36 |
+
pip install -qU "openvino>=2026.0.0" "nncf>=3.0.0" ultralytics
|
| 37 |
else
|
| 38 |
+
pip install -qU "openvino>=2026.0.0" ultralytics
|
| 39 |
fi
|
| 40 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 41 |
echo "--- Downloading sample test video ---"
|
| 42 |
if [[ ! -f test_video.mp4 ]]; then
|
| 43 |
wget -q -O test_video.mp4 \
|
|
|
|
| 47 |
echo "Already present: test_video.mp4"
|
| 48 |
fi
|
| 49 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 50 |
echo "--- Downloading sample test image ---"
|
| 51 |
if [[ ! -f test.jpg ]]; then
|
| 52 |
wget -q -O test.jpg https://ultralytics.com/images/bus.jpg
|