Savant is framework build over Nvidia's DeepStream that provides a flexible solution to provide real time video analytics solution on GPU and edge devices, at much lower latency than using frameworks like PyTorch and Tensorflow.
This particular fork of Savant implements peeople detection and tracking using input video file.
Following is the objective of this forked project:
- This project detects people with faces using PeopleNet.
- If a face is shown, then it blurs it.
- Counts the number of people with shown faces in the frame, as well as the people whose face is not visible, and plots the numbers on the top of frame.
- Assigns unique IDs to people.
- Draw box with green color (representing their face is not visible) and blue color (reprsenting their face is visible) with labels as tracker IDs.
- NvDeepSORT tracks them, which good chance of resiliance of occlusion.
Platform: Linux (Ubuntu 22)
Detector: PeopleNet (Nvidia)
Tracker: NvDeepSORT (Nvidia)
sudo apt-get update
sudo apt-get install -y git git-lfs curl -y
# install docker
curl -fsSL https://get.docker.com -o get-docker.sh
sudo sh get-docker.sh
# intall nvidia driver
sudo apt install --no-install-recommends nvidia-driver-530
sudo reboot
# install nvidia container toolkit
distribution=$(. /etc/os-release;echo $ID$VERSION_ID)
curl -s -L https://nvidia.github.io/nvidia-docker/gpgkey | sudo apt-key add -
curl -s -L https://nvidia.github.io/nvidia-docker/$distribution/nvidia-docker.list | sudo tee /etc/apt/sources.list.d/nvidia-docker.list
sudo apt-get update
sudo apt-get install -y nvidia-container-toolkit
sudo systemctl restart docker
# (Optional) to test if above installation is working correctly
sudo docker run --rm --gpus all nvidia/cuda:12.1.1-base-ubuntu22.04 nvidia-smi
git clone https://github.com/antidianuj/Savant.git
cd Savant/samples/peoplenet_detector
git lfs pull
sudo mv /path/to/ref_vid.mp4 data
If the target video file is of another name, then change the above code accordingly, as well as the name of file in 'docker-compose.x86.yml' in Savant/samples/peoplenet_detector.
sudo docker compose -f docker-compose.x86.yml up
# view the output result by visiting following link in browser
# http://127.0.0.1:888/stream/