NVIDIA DeepStream SDK 6.0 configuration for YOLO models
NVIDIA DeepStream SDK 7.1 / 7.0 / 6.4 / 6.3 / 6.2 / 6.1.1 / 6.1 / 6.0.1 / 6.0 / 5.1 configuration for YOLO models
git clone https://github.com/marcoslucianops/DeepStream-Yolo.git
cd DeepStream-Yolo
cfg
and weights
files from Darknet repo to the DeepStream-Yolo folder3.1. Set the CUDA_VER
according to your DeepStream version
export CUDA_VER=XY.Z
x86 platform
DeepStream 7.1 = 12.6
DeepStream 7.0 / 6.4 = 12.2
DeepStream 6.3 = 12.1
DeepStream 6.2 = 11.8
DeepStream 6.1.1 = 11.7
DeepStream 6.1 = 11.6
DeepStream 6.0.1 / 6.0 = 11.4
DeepStream 5.1 = 11.1
Jetson platform
DeepStream 7.1 = 12.6
DeepStream 7.0 / 6.4 = 12.2
DeepStream 6.3 / 6.2 / 6.1.1 / 6.1 = 11.4
DeepStream 6.0.1 / 6.0 / 5.1 = 10.2
3.2. Make the lib
make -C nvdsinfer_custom_impl_Yolo clean && make -C nvdsinfer_custom_impl_Yolo
config_infer_primary.txt
file according to your model (example for YOLOv4)[property]
...
custom-network-config=yolov4.cfg
model-file=yolov4.weights
...
NOTE: For Darknet models, by default, the dynamic batch-size is set. To use static batch-size, uncomment the line
...
force-implicit-batch-dim=1
...
deepstream-app -c deepstream_app_config.txt
NOTE: The TensorRT engine file may take a very long time to generate (sometimes more than 10 minutes).
NOTE: If you want to use YOLOv2 or YOLOv2-Tiny models, change the deepstream_app_config.txt
file before run it
...
[primary-gie]
...
config-file=config_infer_primary_yoloV2.txt
...
x86 platform
nvcr.io/nvidia/deepstream:7.1-gc-triton-devel
nvcr.io/nvidia/deepstream:7.1-triton-multiarch
Jetson platform
nvcr.io/nvidia/deepstream:7.1-triton-multiarch
NOTE: To compile the nvdsinfer_custom_impl_Yolo
, you need to install the g++ inside the container
apt-get install build-essential
NOTE: With DeepStream 7.1, the docker containers do not package libraries necessary for certain multimedia operations like audio data parsing, CPU decode, and CPU encode. This change could affect processing certain video streams/files like mp4 that include audio track. Please run the below script inside the docker images to install additional packages that might be necessary to use all of the DeepStreamSDK features:
/opt/nvidia/deepstream/deepstream/user_additional_install.sh
To change the nms-iou-threshold
, pre-cluster-threshold
and topk
values, modify the config_infer file
[class-attrs-all]
nms-iou-threshold=0.45
pre-cluster-threshold=0.25
topk=300
NOTE: Make sure to set cluster-mode=2
in the config_infer file.
Sometimes while running gstreamer pipeline or sample apps, user can encounter error: GLib (gthread-posix.c): Unexpected error from C library during 'pthread_setspecific': Invalid argument. Aborting.
. The issue is caused because of a bug in glib 2.0-2.72
version which comes with Ubuntu 22.04 by default. The issue is addressed in glib 2.76
and its installation is required to fix the issue (https://github.com/GNOME/glib/tree/2.76.6).
Migrate glib
to newer version
pip3 install meson
pip3 install ninja
NOTE: It is recommended to use Python virtualenv.
git clone https://github.com/GNOME/glib.git
cd glib
git checkout 2.76.6
meson build --prefix=/usr
ninja -C build/
cd build/
ninja install
Check and confirm the newly installed glib version:
pkg-config --modversion glib-2.0
Sometimes with RTSP streams the application gets stuck on reaching EOS. This is because of an issue in rtpjitterbuffer component. To fix this issue, a script has been provided with required details to update gstrtpmanager library.
/opt/nvidia/deepstream/deepstream/update_rtpmanager.sh
You can get metadata from DeepStream using Python and C/C++. For C/C++, you can edit the deepstream-app
or deepstream-test
codes. For Python, your can install and edit deepstream_python_apps.
Basically, you need manipulate the NvDsObjectMeta
(Python / C/C++) and NvDsFrameMeta
(Python / C/C++) to get the label, position, etc. of bboxes.
My projects: https://www.youtube.com/MarcosLucianoTV