| Installation | Object Detection | Object Classification |
Note: These instructions assume that your host environment and firmware have already been installed.
Actual results will vary based on configuration and the examples below are for illustration purposes only.
Note: For best results enable performance mode for the CPU.
echo performance | sudo tee /sys/devices/system/cpu/cpu*/cpufreq/scaling_governor
Use the following commands to enable discrete graphics support.
-
Clone Repository
git clone https://github.com/dlstreamer/pipeline-zoo.git pipeline-zoo
-
Build Pipeline Zoo Environment
./pipeline-zoo/tools/docker/build.sh --platform dgpu
Removing intermediate container d186e3cdb2e6 ---> 84423666f6d7 Successfully built 84423666f6d7 Successfully tagged dlstreamer-pipeline-zoo-dgpu:latest
Note: If you need to use a different base image (for example with updated drivers or local modifications) pass the image via the
--base
argument../pipeline-zoo/tools/docker/build.sh --platform dgpu --base <IMAGE_NAME_HERE>
-
Launch Pipeline Zoo
./pipeline-zoo/tools/docker/run.sh --platform dgpu
Running Media Analytics Pipeline Zoo Image: 'dlstreamer-pipeline-zoo-dgpu' Environment: '-e no_proxy -e https_proxy -e http_proxy -e DISPLAY -e DEVICE=/dev/dri/renderD128' Volume Mounts: '-v /home/gta/.netrc:/root/.netrc -v /home/pipeline-zoo:/home/pipeline-zoo/ -v /tmp:/tmp -v /var/tmp:/var/tmp -v /dev:/dev -v /lib/modules:/lib/modules -v /home/gta/.Xauthority:/root/.Xauthority ' Name: 'dlstreamer-pipeline-zoo-dgpu' ...
stateDiagram
direction LR
state Object-Detection {
direction LR
state video_source {
direction LR
demux --> parse
}
state detect {
direction LR
scale --> csc
csc --> inference
inference --> tensors_to_objects
}
media --> video_source
video_source --> decode
decode --> detect
detect --> objects
}
+----------------------------------------------+-----------------------+----------------------------+------------+
| Pipeline | Task | Models | Runners |
+==============================================+=======================+============================+============+
| od-h264-yolov5s-416 | object-detection | yolov5s-416 | mockrun |
| | | | dlstreamer |
+----------------------------------------------+-----------------------+----------------------------+------------+
| od-h264-ssd-mobilenet-v1-coco | object-detection | ssd_mobilenet_v1_coco | mockrun |
| | | | dlstreamer |
+----------------------------------------------+-----------------------+----------------------------+------------+
| od-h264-yolo-v4-tf | object-detection | yolo-v4-tf | mockrun |
| | | | dlstreamer |
+----------------------------------------------+-----------------------+----------------------------+------------+
| od-h265-ssd-mobilenet-v1-coco | object-detection | ssd_mobilenet_v1_coco_INT8 | dlstreamer |
+----------------------------------------------+-----------------------+----------------------------+------------+
| od-h265-ssdlite-mobilenet-v2 | object-detection | ssdlite_mobilenet_v2 | mockrun |
| | | | dlstreamer |
+----------------------------------------------+-----------------------+----------------------------+------------+
| od-h265-yolo-v4-tf | object-detection | yolo-v4-tf | mockrun |
| | | | dlstreamer |
+----------------------------------------------+-----------------------+----------------------------+------------+
| od-h264-yolo-v4-tf-416 | object-detection | yolo-v4-tf-416_INT8 | mockrun |
| | | | dlstreamer |
+----------------------------------------------+-----------------------+----------------------------+------------+
| od-h265-yolo-v4-tf-416 | object-detection | yolo-v4-tf-416_INT8 | mockrun |
| | | | dlstreamer |
+----------------------------------------------+-----------------------+----------------------------+------------+
| od-h264-ssdlite-mobilenet-v2 | object-detection | ssdlite_mobilenet_v2 | mockrun |
| | | | dlstreamer |
+----------------------------------------------+-----------------------+----------------------------+------------+
Using the pipebench tool you can download the object detection pipeline and its accompanying models and sample media.
pipebench download od-h265-ssd-mobilenet-v1-coco
=========================================
Downloading od-h265-ssd-mobilenet-v1-coco
=========================================
===================
Downloading Runners
===================
Download dlstreamer
Building: ⠋
=================
Downloading Media
=================
Downloading: Pexels-Videos-1388365.temp
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 44.4M/44.4M [00:01<00:00, 41.0MiB/s]
FFMPEG Converting
Converting: ⠙
==================
Downloading Models
==================
Download: ssd_mobilenet_v1_coco_INT8
Loading: ⠴
Pipeline Downloaded
The following command reports total throughput running 1 stream (1 process, 1 total stream).
pipebench run od-h265-ssd-mobilenet-v1-coco --platform dgpu --streams 1 --media video/Pexels-Videos-1388365-h265 --duration 300
Pipeline:
od-h265-ssd-mobilenet-v1-coco
Runner:
dlstreamer
dlstreamer.dgpu.runner-settings.yml
Media:
video/Pexels-Videos-1388365-h265
Measurement:
throughput
throughput.measurement-settings.yml
Output Directory:
/home/pipeline-zoo/workspace/od-h265-ssd-mobilenet-v1-coco/measurements/throughput/dlstreamer.dgpu/run-0001
========================================================================
Iteration Streams Processes Minimum Average Maximum Total
========================================================================
0000 0000 0001 0.0000 0.0000 0.0000 0.0000
========================================================================
<SNIP>
========================================================================
Iteration Streams Processes Minimum Average Maximum Total
========================================================================
0000 0001 0001 1369.1581 1369.1581 1369.1581 1369.1581
========================================================================
Pipeline Runner Streams: 1
----------------------------- ---------- -------------------------------------------------------------
od-h265-ssd-mobilenet-v1-coco dlstreamer Min: 1369.1581 Max: 1369.1581 Avg: 1369.1581 Total: 1369.1581
The following command measures stream density using 8 streams (1 process, 8 total streams).
timeout 300 pipebench run --measure density --platform dgpu od-h265-ssd-mobilenet-v1-coco --no-numactl --duration 500 --streams 8 --streams-per-process 8
Pipeline:
od-h265-ssd-mobilenet-v1-coco
Runner:
dlstreamer
dlstreamer.density.dgpu.runner-settings.yml
Media:
video/Pexels-Videos-1388365-h265
Measurement:
density
density.measurement-settings.yml
Output Directory:
/home/pipeline-zoo/workspace/od-h265-ssd-mobilenet-v1-coco/measurements/density/dlstreamer.dgpu/run-0004
========================================================================
Iteration Streams Processes Minimum Average Maximum Total
========================================================================
0000 0000 0001 0.0000 0.0000 0.0000 0.0000
========================================================================
========================================================================
Iteration Streams Processes Minimum Average Maximum Total
========================================================================
0000 0000 0001 0.0000 0.0000 0.0000 0.0000
========================================================================
<SNIP>
========================================================================
Iteration Streams Processes Minimum Average Maximum Total
========================================================================
0000 0008 0001 387.4471 393.1357 412.6040 3145.0855
========================================================================
Pipeline Runner Streams: 8
----------------------------- ---------- ----------------------------------------------------------
od-h265-ssd-mobilenet-v1-coco dlstreamer Min: 387.4471 Max: 412.6040 Avg: 393.1357 Total: 3145.0855
stateDiagram
direction LR
state Object-Classification {
direction LR
state video_source {
direction LR
demux --> parse
}
frames
state classify {
direction LR
frames_1 --> crop_1
objects_1 --> crop_1
crop_1 --> scale_2
scale_2 --> csc_2
csc_2 --> inference_2
inference_2 --> tensors_to_attributes_1
}
state detect {
direction LR
scale --> csc
csc --> inference
inference --> tensors_to_objects
}
state classify_N {
direction LR
frames_N --> crop_N
objects_N --> crop_N
crop_N --> scale_N
scale_N --> csc_N
csc_N --> inference_N
inference_N --> tensors_to_attributes_N
}
state fork <<fork>>
state join <<join>>
objects-->fork
frames-->fork
media --> video_source
video_source --> decode
decode --> detect
detect --> objects
detect --> frames
fork --> classify
fork --> classify_N
classify --> join
classify_N --> join
join --> objects_attributes
}
+----------------------------------------------+-----------------------+----------------------------+------------+
| Pipeline | Task | Models | Runners |
+==============================================+=======================+============================+============+
| oc-h264-full_frame-efficientnet-b0 | object-classification | full_frame | mockrun |
| | | efficientnet-b0 | dlstreamer |
+----------------------------------------------+-----------------------+----------------------------+------------+
| oc-h265-ssdlite-mobilenet-v2-efficientnet-b0 | object-classification | ssdlite_mobilenet_v2 | mockrun |
| | | efficientnet-b0 | dlstreamer |
+----------------------------------------------+-----------------------+----------------------------+------------+
| oc-h264-yolov5s-416-efficientnet-b0 | object-classification | yolov5s-416 | mockrun |
| | | efficientnet-b0 | dlstreamer |
+----------------------------------------------+-----------------------+----------------------------+------------+
| oc-h264-ssdlite-mobilenet-v2-efficientnet-b0 | object-classification | ssdlite_mobilenet_v2 | mockrun |
| | | efficientnet-b0 | dlstreamer |
+----------------------------------------------+-----------------------+----------------------------+------------+
| oc-h265-full_frame-efficientnet-b0 | object-classification | full_frame | mockrun |
| | | efficientnet-b0 | dlstreamer |
+----------------------------------------------+-----------------------+----------------------------+------------+
| oc-h265-yolo-v4-tf-resnet-50-tf | object-classification | yolo-v4-tf | mockrun |
| | | resnet-50-tf | dlstreamer |
+----------------------------------------------+-----------------------+----------------------------+------------+
| oc-h264-full_frame-resnet-50-tf | object-classification | full_frame | mockrun |
| | | resnet-50-tf | dlstreamer |
+----------------------------------------------+-----------------------+----------------------------+------------+
| oc-h265-full_frame-resnet-50-tf | object-classification | full_frame | mockrun |
| | | resnet-50-tf | dlstreamer |
+----------------------------------------------+-----------------------+----------------------------+------------+
| oc-h264-ssd-mobilenet-v1-coco-resnet-50-tf | object-classification | ssd_mobilenet_v1_coco | mockrun |
| | | resnet-50-tf | dlstreamer |
+----------------------------------------------+-----------------------+----------------------------+------------+
| oc-h265-yolo-v4-tf-416-resnet-50-tf | object-classification | yolo-v4-tf-416_INT8 | mockrun |
| | | resnet-50-tf | dlstreamer |
+----------------------------------------------+-----------------------+----------------------------+------------+
| oc-h264-yolo-v4-tf-resnet-50-tf | object-classification | yolo-v4-tf | mockrun |
| | | resnet-50-tf | dlstreamer |
+----------------------------------------------+-----------------------+----------------------------+------------+
| oc-h264-yolo-v4-tf-416-resnet-50-tf | object-classification | yolo-v4-tf-416_INT8 | mockrun |
| | | resnet-50-tf | dlstreamer |
+----------------------------------------------+-----------------------+----------------------------+------------+
| oc-h265-ssd-mobilenet-v1-coco-resnet-50-tf | object-classification | ssd_mobilenet_v1_coco | mockrun |
| | | resnet-50-tf | dlstreamer |
+----------------------------------------------+-----------------------+----------------------------+------------+
Using the pipebench tool you can download an object classification pipeline and its accompanying models and sample media.
pipebench download oc-h265-ssd-mobilenet-v1-coco-resnet-50-tf
======================================================
Downloading oc-h265-ssd-mobilenet-v1-coco-resnet-50-tf
======================================================
===================
Downloading Runners
===================
Download mockrun
Download dlstreamer
Building: ⠋
=================
Downloading Media
=================
Downloading: Pexels-Videos-1388365.temp
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 44.4M/44.4M [00:00<00:00, 58.2MiB/s]
FFMPEG Converting
Downloading: 20200711_dog_bark-1080p.temp
100%|███████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████████| 26.5M/26.5M [00:00<00:00, 46.6MiB/s]
FFMPEG Converting
Converting: ⠹
==================
Downloading Models
==================
Download: resnet-50-tf_INT8
Download: resnet-50-tf
Download: ssd_mobilenet_v1_coco_INT8
Download: ssd_mobilenet_v1_coco
Loading: ⠦
Pipeline Downloaded
The following command reports total throughput running 1 stream (1 process, 1 total stream).
pipebench run oc-h265-ssd-mobilenet-v1-coco-resnet-50-tf --platform dgpu --streams 1 --media video/20200711_dog_bark-1080p-h265
Pipeline:
oc-h265-ssd-mobilenet-v1-coco-resnet-50-tf
Runner:
dlstreamer
dlstreamer.dgpu.runner-settings.yml
Media:
video/20200711_dog_bark-1080p-h265
Measurement:
throughput
throughput.measurement-settings.yml
Output Directory:
/home/pipeline-zoo/workspace/oc-h265-ssd-mobilenet-v1-coco-resnet-50-tf/measurements/throughput/dlstreamer.dgpu/run-0000
========================================================================
Iteration Streams Processes Minimum Average Maximum Total
========================================================================
0000 0000 0001 0.0000 0.0000 0.0000 0.0000
========================================================================
<SNIP>
========================================================================
Iteration Streams Processes Minimum Average Maximum Total
========================================================================
0000 0001 0001 1666.5071 1666.5071 1666.5071 1666.5071
========================================================================
========================================================================
Iteration Streams Processes Minimum Average Maximum Total
========================================================================
0000 0001 0001 1689.3651 1689.3651 1689.3651 1689.3651
========================================================================
Pipeline Runner Streams: 1
------------------------------------------ ---------- -------------------------------------------------------------
oc-h265-ssd-mobilenet-v1-coco-resnet-50-tf dlstreamer Min: 1689.3651 Max: 1689.3651 Avg: 1689.3651 Total: 1689.3651
The following command measures stream density using 8 streams (1 process, 8 total streams).
timeout 300 pipebench run --measure density --platform dgpu oc-h265-ssd-mobilenet-v1-coco-resnet-50-tf --media video/20200711_dog_bark-1080p-h265 --no-numactl --duration 240 --streams 8 --streams-per-process 8
Pipeline:
oc-h265-ssd-mobilenet-v1-coco-resnet-50-tf
Runner:
dlstreamer
dlstreamer.density.dgpu.runner-settings.yml
Media:
video/20200711_dog_bark-1080p-h265
Measurement:
density
density.measurement-settings.yml
Output Directory:
/home/pipeline-zoo/workspace/oc-h265-ssd-mobilenet-v1-coco-resnet-50-tf/measurements/density/dlstreamer.dgpu/run-0001
========================================================================
Iteration Streams Processes Minimum Average Maximum Total
========================================================================
0000 0000 0001 0.0000 0.0000 0.0000 0.0000
========================================================================
<SNIP>
========================================================================
Iteration Streams Processes Minimum Average Maximum Total
========================================================================
0000 0008 0001 296.7597 304.2268 316.2266 2433.8145
========================================================================
========================================================================
Iteration Streams Processes Minimum Average Maximum Total
========================================================================
0000 0008 0001 302.6452 305.9524 316.2266 2447.6194
========================================================================
Pipeline Runner Streams: 8
------------------------------------------ ---------- ----------------------------------------------------------
oc-h265-ssd-mobilenet-v1-coco-resnet-50-tf dlstreamer Min: 302.6452 Max: 316.2266 Avg: 305.9524 Total: 2447.6194