This Deepstream application showcases Multi-camera Object Detection and Live Tracking using YOLOv4 model running at High FPS throughput!
This post assumes you have a fully functional Jetson device. If not, you can refer the documentation here.
Enter the command:
docker pull nvcr.io/nvidia/deepstream:5.1-21.02-devel
docker run --name=ds-522 --gpus all -it --net=host --privileged -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=$DISPLAY -v <local_dir>:/workspace/user -w /opt/nvidia/deepstream/deepstream-5.1 nvcr.io/nvidia/deepstream:5.1-21.02-devel
For more information, go to the get started page of Deepstream here.
This is a straightforward step, however, if you are new to git, I recommend glancing threw the steps.
First, install git
sudo apt install gitNext, clone the repository
# Using HTTPS
git clone https://github.com/NMadhub/Deepstream_multicamera.git
# Using SSH
[email protected]:NMadhub/Deepstream_multicamera.gitDownload the weights file from google-drive and place it in models/YOLOv4 directory.
Please ensure you have your CUDA libraries and paths are proper before proceeding further. If not please do as follows:
Go to vi ~/.bashrc. Then Add the following lines:
# CUDA
export CUDA=11.1
export PATH=/usr/local/cuda-$CUDA/bin${PATH:+:${PATH}}
export CUDA_PATH=/usr/local/cuda-$CUDA
export CUDA_HOME=/usr/local/cuda-$CUDA
export LIBRARY_PATH=$CUDA_HOME/lib64:$LIBRARY_PATH
export LD_LIBRARY_PATH=/usr/local/cuda-$CUDA/lib64${LD_LIBRARY_PATH:+:${LD_LIBRARY_PATH}}
export LD_LIBRARY_PATH=/usr/local/cuda/extras/CUPTI/lib64:$LD_LIBRARY_PATH
export NVCC=/usr/local/cuda-$CUDA/bin/nvcc
export CFLAGS="-I$CUDA_HOME/include $CFLAGS"Then do source ~/.bashrc
First, build the application by running the following command:
make clean && make -j$(nproc)This will generate the binary called ds-yolo. This is a one-time step and you need to do this only when you make source-code changes.
For some common errors & fixes:
apt install libopencv-dev
apt-get install libboost-all-dev
apt install libgnutls28-devNext, create a file called inputsources.txt and paste the path of videos or rtsp url.
file:///home/nmadhab/Videos/sample_qHD.mp4
rtsp://admin:admin%[email protected]:554/streamNow, run the application by running the following command:
./ds-yolo