Skip to content

Instantly share code, notes, and snippets.

@leviethung2103
Last active September 15, 2022 12:07
Show Gist options
  • Star 1 You must be signed in to star a gist
  • Fork 2 You must be signed in to fork a gist
  • Save leviethung2103/490c8bbd8a41e506f45175bac29c5aee to your computer and use it in GitHub Desktop.
Save leviethung2103/490c8bbd8a41e506f45175bac29c5aee to your computer and use it in GitHub Desktop.
Step to run Deepstream Python3 Sample App on X86 PC

How to install the Deepstream via docker container

Install Docker

Skip this step if you already had the docker and nvidia-docker

Pull Docker Image

docker pull nvcr.io/nvidia/deepstream:5.1-21.02-samples

Run the docker

xhost +
docker run -itd --net=host --runtime nvidia -e DISPLAY=$DISPLAY -w /opt/nvidia/deepstream/deepstream-5.1 -v /tmp/.X11-unix/:/tmp/.X11-unix nvcr.io/nvidia/deepstream:5.1-21.02-samples

Package contents

The Deepstream packages include: 1.sources: Sources for sample application and plugin 2.samples: Config files, Models, streams and tools to run the sample app

While running DeepStream with docker, necessary packages are already pre-installed.

Running the samples

Deepstream-Test3

Go inside the docker container via VSCODE

# install some necessary packages
apt-get install gstreamer-1.0
apt-get install python-gi-dev
apt-get install libpython3.6
cd /opt/nvidia/deepstream/deepstream-5.1/sources/
git clone https://github.com/NVIDIA-AI-IOT/deepstream_python_apps.git
cd deepstream_python_apps/apps/deepstream-test3/
python3 deepstream_test_3.py file:///opt/nvidia/deepstream/deepstream-5.1/samples/streams/sample_1080p_h264.mp4

Deepstream Test 1

Install the GstRtspServer

# Install the GstRtspServer
apt-get install libgstrtspserver-1.0-0 gstreamer1.0-rtsp 
apt-get install libgirepository1.0-dev
apt-get install gobject-introspection gir1.2-gst-rtsp-server-1.0
python3 deepstream_test_1.py /opt/nvidia/deepstream/deepstream-5.1/samples/streams/sample_720p.h264

Note that, we should you the file .h264 instead of .mp4 to run the test-1. The test-1 sample only supports the local file. In order to use the H264 stream, please refer to test-3

Deepstream Test 4

Install the Kafka Library

apt-get install libglib2.0 libglib2.0-dev
apt-get install libjansson4  libjansson-dev
apt-get install librdkafka1=0.11.3-1build1
1. Go to samples directory and run
   deepstream-app -c <path to config.txt>
2. Application config files included in `configs/deepstream-app/`
   a. source30_1080p_dec_infer-resnet_tiled_display_int8.txt (30 Decode + Infer)
   b. source4_1080p_dec_infer-resnet_tracker_sgie_tiled_display_int8.txt
      (4 Decode + Infer + SGIE + Tracker)
   c. source4_1080p_dec_infer-resnet_tracker_sgie_tiled_display_int8_gpu1.txt
      (4 Decode + Infer + SGIE + Tracker executed on gpu1)
3. Configuration files for "nvinfer" element in `configs/deepstream-app/`
   a. config_infer_primary.txt (Primary Object Detector)
   b. config_infer_secondary_carcolor.txt (Secondary Car Color Classifier)
   c. config_infer_secondary_carmake.txt (Secondary Car Make Classifier)
   d. config_infer_secondary_vehicletypes.txt (Secondary Vehicle Type Classifier)

Triton Server

# pull the docker 
docker pull nvcr.io/nvidia/deepstream:5.1-21.02-triton
# start the docker 
docker run --gpus all -it --rm -v /tmp/.X11-unix:/tmp/.X11-unix -e DISPLAY=$DISPLAY nvcr.io/nvidia/deepstream:5.1-21.02-triton
@rg321
Copy link

rg321 commented Sep 12, 2022

latest -:
docker pull nvcr.io/nvidia/deepstream:6.1.1-samples
6.1.1-samples

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment