How to detect objects with Nvidia Deepstream 4.0 and YOLO in 5 minutes
YOLO (You only look once) is a state-of-the-art neural network for real-time object detection system.
You can find full documentation about Yolo Neural Network here https://pjreddie.com/darknet/yolo/
Nvidia Deepstream 4.0 comes with native support for YOLO and make it very easy build a gstreamer pipeline to use YOLO for inference on videos and live streams.
To download and install Nvidia Deepstream 4.0 follow guidelines from :
https://developer.nvidia.com/deepstream-download
https://docs.nvidia.com/metropolis/index.html
My inference machine is based on Unbuntu 18.04 with Nvidia Geforce RTX 2080 nvidia dirvers 418.87 cuda 10.1

Follow Nvidia deepstream 4.0 installation guides to install required packages as Gstreamer 1.14.1 and TensorRT 5.1.
For Deepstream 4.0 installation package suggest using deb intallation which take care to install Deepstream 4.0 library and gstreamer plugins in correct paths.
Once Installation is complete Nvidia deestream package sholud be located in : /opt/nvidia/deepstream/deepstream-4.0
Navigate to : /opt/nvidia/deepstream/deepstream-4.0/sources/objectDetector_Yolo
Execute scrpit ./prebuild.sh to donwload YOLO cfg files and weights and make oppurtune calibrations for Tensorrt engine.
Once finished export export CUDA_VER environment variable with your CUDA Version installed and build deepstream YOLO infrerence plugin :
export CUDA_VER=10.1
make -C nvdsinfer_custom_impl_Yolo
That’s all you are ready to urn your inference gstreamer pipeline with suorce video or live rtsp from camera :
gst-launch-1.0 filesrc location=<path to your video> ! qtdemux ! h264parse ! nvv4l2decoder ! m.sink_0 nvstreammux name=m batch-size=1 width=<video width> height=<video height> ! nvinfer config-file-path=/opt/nvidia/deepstream/deepstream-4.0/sources/objectDetector_Yolo/config_infer_primary_yoloV3.txt batch-size=1 unique-id=1 ! nvvideoconvert ! nvdsosd ! nveglglessink
That’s my test on Nvida video sample enjoy :
Looking at the bounding boxes in real time is fun, but how I can access detection result programmatically.
Using opencv I can capture video stream and set up ggstreamer pipeline. But how then I can read bounding boxes from stream?
Hello Konstantin,
You can easy add a Gstreamer listener to GstBin tipically on GstNvOsd when you have all informations about detected buonding boxes berfore getting displayed on OSD.
Look at samples included in Deespstream included in deepstream package and the link of Deepstreamer API reference :
https://docs.nvidia.com/metropolis/deepstream/dev-guide/#page/DeepStream_Development_Guide/deepstream_quick_start.html
Regards
Marco
I’m getting
WARNING: erroneous pipeline: could not link nvdsosd0 to eglglessink0
Hello Brian,
Look at documentation and samples included in Deepstreamer package can be useful to understand errors.
Here the link at Deepstereamer package API reference :
https://docs.nvidia.com/metropolis/deepstream/dev-guide/#page/DeepStream_Development_Guide/deepstream_quick_start.html
Regards
Marco