Home

Awesome

DeepStream Python Apps

This repository contains Python bindings and sample applications for the DeepStream SDK.

SDK version supported: 7.1

<b>This release only supports Ubuntu 22.04 for DeepStreamSDK 7.1 with Python 3.10 and gst-python 1.20.3! Ubuntu 20.04 for DeepStreamSDK 6.3 with Python 3.8 support is NOW DEPRECATED</b>

The bindings sources along with build instructions are available under bindings! PyDS 1.2.0 for DeepStream 7.1 uses an updated build system for PyPA to support pip 24.2, which deprecated setup.py command line. We include one guide for contributing to bindings and another guide for advanced use-cases such as writing bindings for custom data structures.

Please report any issues or bugs on the DeepStream SDK Forums. This enables the DeepStream community to find help at a central location.

<b>NOTE:<b> numpy 2.x is not supported. If you have numpy 2.x installed, please downgrade by running

pip3 install --force-reinstall numpy==1.26.0

<b>NOTE:<b> deepstream-segmask and deepstream-segmentation applications are not currently supported by DeepStream 7.1, due to removal of segmentation models.

<b>NOTE for DeepStream dockers:<b> If you installed PyDS by running the user_deepstream_python_apps_install.sh script, be sure you also run the <b>user_additional_install.sh script<b>.

Setup

Once you have DeepStreamSDK pre-requisites and DeepStreamSDK installed on the system, navigate to <DS_ROOT>/sources/ dir which is /opt/nvidia/deepstream/deepstream/sources/ and git clone deepstream_python_apps repo here.

The latest bindings can be installed from release section. You can also build the bindings from source using the instructions in the bindings readme if needed.

<a name="metadata_bindings"></a>

Python Bindings

DeepStream pipelines can be constructed using Gst Python, the GStreamer framework's Python bindings. For accessing DeepStream MetaData, Python bindings are provided as part of this repository. This module is generated using Pybind11.

<p align="center"> <img src=".python-app-pipeline.png" alt="bindings pipeline" height="600px"/> </p>

These bindings support a Python interface to the MetaData structures and functions. Usage of this interface is documented in the HOW-TO Guide and demonstrated in the sample applications.

Python Bindings Breaking API Change

The binding for function alloc_nvds_event_msg_meta() now expects a NvDsUserMeta pointer which the NvDsEventMsgMeta is associated with. Please refer to deepstream-test4 and bindschema.cpp for reference.

<a name="sample_applications"></a>

Sample Applications

Sample applications provided here demonstrate how to work with DeepStream pipelines using Python.
The sample applications require MetaData Bindings to work.

To run the sample applications or write your own, please consult the HOW-TO Guide

<p align="center"> <img src=".test3-app.png" alt="deepstream python app screenshot" height="400px"/> </p>

We currently provide the following sample applications:

Detailed application information is provided in each application's subdirectory under apps.