Skip to content

Commit 441b50d

Browse files
committed
Update to 1.1.6 release
This release is compatible with DeepStream SDK 6.2 Ubuntu 20.04 Python 3.8 DeepStream SDK 6.2 Features: - New app deepstream-imagedata-multistream-cupy added - New app deepstream-segmask added - New app deepstream-custom-binding-test added - New bindings guide now available along with custom user meta guide and example - Updated apps that use nveglglessink to use nv3dsink for Jetson - Updated deepstream-test1 notebook and app - New bindings added: unmap_nvds_buf_surface() - Updated deepstream-imagedata-multistream and deepstream-imagedata-multistream-redaction to use the above new binding
1 parent f70dcc9 commit 441b50d

File tree

125 files changed

+5587
-547
lines changed

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

125 files changed

+5587
-547
lines changed

FAQ.md

+42-15
Original file line numberDiff line numberDiff line change
@@ -1,15 +1,42 @@
11
# Frequently Asked Questions and Troubleshooting Guide
22

3-
* [Git clone fails due to Gstreamer repo access error](#faq9)
4-
* [Application fails to work with mp4 stream](#faq0)
5-
* [Ctrl-C does not stop the app during engine file generation](#faq1)
6-
* [Application fails to create gst elements](#faq2)
7-
* [GStreamer debugging](#faq3)
8-
* [Application stuck with no playback](#faq4)
9-
* [Error on setting string field](#faq5)
10-
* [Pipeline unable to perform at real time](#faq6)
11-
* [Triton container problems with multi-GPU setup](#faq7)
12-
* [ModuleNotFoundError: No module named 'pyds'](#faq8)
3+
- [Frequently Asked Questions and Troubleshooting Guide](#frequently-asked-questions-and-troubleshooting-guide)
4+
- [Using new gst-nvstreammux](#using-new-gst-nvstreammux)
5+
- [Git clone fails due to Gstreamer repo access error](#git-clone-fails-due-to-gstreamer-repo-access-error)
6+
- [Application fails to work with mp4 stream](#application-fails-to-work-with-mp4-stream)
7+
- [Ctrl-C does not stop the app during engine file generation](#ctrl-c-does-not-stop-the-app-during-engine-file-generation)
8+
- [Application fails to create gst elements](#application-fails-to-create-gst-elements)
9+
- [GStreamer debugging](#gstreamer-debugging)
10+
- [Application stuck with no playback](#application-stuck-with-no-playback)
11+
- [Error on setting string field](#error-on-setting-string-field)
12+
- [Pipeline unable to perform at real time](#pipeline-unable-to-perform-at-real-time)
13+
- [Triton container problems with multi-GPU setup](#triton-container-problems-with-multi-gpu-setup)
14+
- [ModuleNotFoundError: No module named 'pyds'](#modulenotfounderror-no-module-named-pyds)
15+
16+
<a name="faq10"></a>
17+
### Using new gst-nvstreammux
18+
Most DeepStream Python apps are written to use the default nvstreammux and have lines of code written to set nvstreammux properties which are deprecated in the new gst-nvstreammux. See the [DeepStream documentation](https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_plugin_gst-nvstreammux2.html) for more information on the new gst-nvstreammux plugin. To use the new nvstreammux, set the `USE_NEW_NVSTREAMMUX` environment variable before running the app. For example:
19+
```bash
20+
$ export USE_NEW_NVSTREAMMUX="yes"
21+
$ python3 deepstream_test_1.py ../../../../samples/streams/sample_720p.h264
22+
```
23+
The app itself must be modified not to set deprecated properties when using the new nvstreammux. See [deepstream-test1](./apps/deepstream-test1/deepstream_test_1.py):
24+
```python
25+
if os.environ.get('USE_NEW_NVSTREAMMUX') != 'yes': # Only set these properties if not using new gst-nvstreammux
26+
streammux.set_property('width', 1920)
27+
streammux.set_property('height', 1080)
28+
streammux.set_property('batched-push-timeout', 4000000)
29+
```
30+
31+
Running apps without this modification will result in such an error:
32+
```
33+
Traceback (most recent call last):
34+
File "deepstream_test_1.py", line 255, in <module>
35+
sys.exit(main(sys.argv))
36+
File "deepstream_test_1.py", line 194, in main
37+
streammux.set_property('width', 1920)
38+
TypeError: object of type `GstNvStreamMux' does not have property `width'
39+
```
1340

1441
<a name="faq9"></a>
1542
### Git clone fails due to Gstreamer repo access error
@@ -43,9 +70,9 @@ https://docs.python.org/3/library/signal.html
4370
To work around this:
4471
1. Use ctrl-z to bg the process
4572
2. Optionally run "jobs" if there are potentially multiple bg processes:
46-
$ jobs
47-
[1]- Stopped python3 deepstream_test_1.py /opt/nvidia/deepstream/deepstream-4.0/samples/streams/sample_720p.h264 (wd: /opt/nvidia/deepstream/deepstream-4.0/sources/apps/python/deepstream-test1)
48-
[2]+ Stopped python3 deepstream_test_2.py /opt/nvidia/deepstream/deepstream-4.0/samples/streams/sample_720p.h264
73+
$ jobs
74+
[1]- Stopped python3 deepstream_test_1.py /opt/nvidia/deepstream/deepstream/samples/streams/sample_720p.h264 (wd: /opt/nvidia/deepstream/deepstream-4.0/sources/apps/python/deepstream-test1)
75+
[2]+ Stopped python3 deepstream_test_2.py /opt/nvidia/deepstream/deepstream/samples/streams/sample_720p.h264
4976
3. Kill the bg job:
5077
$ kill %<job number, 1 or 2 from above. e.g. kill %1>
5178

@@ -125,5 +152,5 @@ The pyds wheel installs the pyds.so library where all the pip packages are store
125152

126153
Command to install the pyds wheel is:
127154
```bash
128-
$ pip3 install ./pyds-1.1.0-py3-none*.whl
129-
```
155+
$ pip3 install ./pyds-1.1.6-py3-none*.whl
156+
```

HOWTO.md

+4-4
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ This guide provides resources for DeepStream application development in Python.
1616
## Prerequisites
1717

1818
* Ubuntu 20.04
19-
* [DeepStream SDK 6.1.1](https://developer.nvidia.com/deepstream-download) or later
19+
* [DeepStream SDK 6.2](https://developer.nvidia.com/deepstream-download) or later
2020
* Python 3.8
2121
* [Gst Python](https://gstreamer.freedesktop.org/modules/gst-python.html) v1.16.2
2222

@@ -46,11 +46,11 @@ Note: Compiling bindings now also generates a pip installable python wheel for t
4646
<a name="run_samples"></a>
4747
## Running Sample Applications
4848

49-
Clone the deepstream_python_apps repo under <DeepStream 6.1.1 ROOT>/sources:
49+
Clone the deepstream_python_apps repo under <DeepStream 6.2 ROOT>/sources:
5050
git clone https://github.com/NVIDIA-AI-IOT/deepstream_python_apps
5151

5252
This will create the following directory:
53-
```<DeepStream 6.1.1 ROOT>/sources/deepstream_python_apps```
53+
```<DeepStream 6.2 ROOT>/sources/deepstream_python_apps```
5454

5555
The Python apps are under the "apps" directory.
5656
Go into each app directory and follow instructions in the README.
@@ -212,5 +212,5 @@ This function populates the input buffer with a timestamp generated according to
212212
<a name="imagedata_access"></a>
213213
## Image Data Access
214214

215-
Decoded images are accessible as NumPy arrays via the `get_nvds_buf_surface` function. This function is documented in the [API Guide](https://docs.nvidia.com/metropolis/deepstream/6.0.1/python-api/index.html).
215+
Decoded images are accessible as NumPy arrays via the `get_nvds_buf_surface` function. This function is documented in the [API Guide](https://docs.nvidia.com/metropolis/deepstream/dev-guide/python-api/index.html).
216216
Please see the [deepstream-imagedata-multistream](apps/deepstream-imagedata-multistream) sample application for an example of image data usage.

README.md

+9-6
Original file line numberDiff line numberDiff line change
@@ -2,11 +2,11 @@
22

33
This repository contains Python bindings and sample applications for the [DeepStream SDK](https://developer.nvidia.com/deepstream-sdk).
44

5-
SDK version supported: 6.1.1
5+
SDK version supported: 6.2
66

7-
<b>The bindings sources along with build instructions are now available under [bindings](bindings)! </b>
7+
<b>The bindings sources along with build instructions are now available under [bindings](bindings)! We now include a [guide](bindings/BINDINGSGUIDE.md) for contributing to bindings and another [guide](bindings/CUSTOMUSERMETAGUIDE.md) for advanced use-cases such as writing bindings for custom data structures.</b>
88

9-
<b>This release comes with Operating System upgrades (from Ubuntu 18.04 to Ubuntu 20.04) for DeepStreamSDK 6.1.1 support. This translates to upgrade in Python version to 3.8 and [gst-python](3rdparty/gst-python/) version has also been upgraded to 1.16.2 !</b>
9+
<b>This release only supports Ubuntu 20.04 for DeepStreamSDK 6.2 with Python 3.8 and [gst-python](3rdparty/gst-python/) 1.16.2! Ubuntu 18.04 support is now deprecrated.</b>
1010

1111
Download the latest release package complete with bindings and sample applications from the [release section](../../releases).
1212

@@ -41,13 +41,13 @@ To run the sample applications or write your own, please consult the [HOW-TO Gui
4141
</p>
4242

4343
We currently provide the following sample applications:
44-
* [deepstream-test1](apps/deepstream-test1) -- 4-class object detection pipeline
44+
* <b>UPDATED</b> [deepstream-test1](apps/deepstream-test1) -- 4-class object detection pipeline - now also demonstrates support for new nvstreammux
4545
* [deepstream-test2](apps/deepstream-test2) -- 4-class object detection, tracking and attribute classification pipeline
4646
* [deepstream-test3](apps/deepstream-test3) -- multi-stream pipeline performing 4-class object detection - now also supports triton inference server, no-display mode, file-loop and silent mode
4747
* [deepstream-test4](apps/deepstream-test4) -- msgbroker for sending analytics results to the cloud
4848
* [deepstream-imagedata-multistream](apps/deepstream-imagedata-multistream) -- multi-stream pipeline with access to image buffers
4949
* [deepstream-ssd-parser](apps/deepstream-ssd-parser) -- SSD model inference via Triton server with output parsing in Python
50-
* [deepstream-test1-usbcam](apps/deepstream-test1-usbcam) -- deepstream-test1 pipelien with USB camera input
50+
* [deepstream-test1-usbcam](apps/deepstream-test1-usbcam) -- deepstream-test1 pipeline with USB camera input
5151
* [deepstream-test1-rtsp-out](apps/deepstream-test1-rtsp-out) -- deepstream-test1 pipeline with RTSP output
5252
* [deepstream-opticalflow](apps/deepstream-opticalflow) -- optical flow and visualization pipeline with flow vectors returned in NumPy array
5353
* [deepstream-segmentation](apps/deepstream-segmentation) -- segmentation and visualization pipeline with segmentation mask returned in NumPy array
@@ -56,7 +56,10 @@ We currently provide the following sample applications:
5656
* [deepstream-imagedata-multistream-redaction](apps/deepstream-imagedata-multistream-redaction) -- multi-stream pipeline with face detection and redaction
5757
* [deepstream-rtsp-in-rtsp-out](apps/deepstream-rtsp-in-rtsp-out) -- multi-stream pipeline with RTSP input/output
5858
* [deepstream-preprocess-test](apps/deepstream-preprocess-test) -- multi-stream pipeline using nvdspreprocess plugin with custom ROIs
59-
* <b>NEW</b> [deepstream-demux-multi-in-multi-out](apps/deepstream-demux-multi-in-multi-out) -- multi-stream pipeline using nvstreamdemux plugin to generated separate buffer outputs
59+
* [deepstream-demux-multi-in-multi-out](apps/deepstream-demux-multi-in-multi-out) -- multi-stream pipeline using nvstreamdemux plugin to generated separate buffer outputs
60+
* [deepstream-imagedata-multistream-cupy](apps/deepstream-imagedata-multistream-cupy) -- access imagedata buffer from GPU in a multistream source as CuPy array - x86 only
61+
* <b>NEW</b> [deepstream-segmask](apps/deepstream-segmask) -- access and interpret segmentation mask information from NvOSD_MaskParams
62+
* <b>NEW</b> [deepstream-custom-binding-test](apps/deepstream-custom-binding-test) -- demonstrate usage of NvDsUserMeta for attaching custom data structure - see also the [Custom User Meta Guide](bindings/CUSTOMUSERMETAGUIDE.md)
6063

6164

6265
Detailed application information is provided in each application's subdirectory under [apps](apps).

apps/README

+4-20
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ DeepStream SDK Python Bindings
2020
================================================================================
2121
Setup pre-requisites:
2222
- Ubuntu 20.04
23-
- NVIDIA DeepStream SDK 6.1.1
23+
- NVIDIA DeepStream SDK 6.2
2424
- Python 3.8
2525
- Gst-python
2626

@@ -31,28 +31,12 @@ Package Contents
3131
with installation instructions in bindings/README.md
3232

3333
2. DeepStream test apps in Python
34-
The following test apps are available:
35-
deepstream-test1
36-
deepstream-test2
37-
deepstream-test3
38-
deepstream-test4
39-
deepstream-imagedata-multistream
40-
deepstream-imagedata-multistream-redaction
41-
deepstream-ssd-parser
42-
deepstream-test1-rtsp-out
43-
deepstream-rtsp-in-rtsp-out
44-
deepstream-test1-usbcam
45-
deepstream-opticalflow
46-
deepstream-segmentation
47-
deepstream-nvdsanalytics
48-
deepstream-preprocess-test
49-
runtime_source_add_delete
5034

5135
--------------------------------------------------------------------------------
5236
Installing Pre-requisites:
5337
--------------------------------------------------------------------------------
5438

55-
DeepStream SDK 6.1.1
39+
DeepStream SDK 6.2
5640
--------------------
5741
Download and install from https://developer.nvidia.com/deepstream-download
5842

@@ -70,7 +54,7 @@ $ sudo apt install python3-gi python3-dev python3-gst-1.0 -y
7054
--------------------------------------------------------------------------------
7155
Running the samples
7256
--------------------------------------------------------------------------------
73-
The apps are configured to work from inside the DeepStream SDK 6.1.1 installation.
57+
The apps are configured to work from inside the DeepStream SDK 6.2 installation.
7458

7559
Clone the deepstream_python_apps repo under <DeepStream ROOT>/sources:
7660
$ git clone https://github.com/NVIDIA-AI-IOT/deepstream_python_apps
@@ -109,4 +93,4 @@ Notes:
10993
--------------------------------------------------------------------------------
11094
As with DeepStream SDK, if the application runs into errors, cannot create gst elements,
11195
try again after removing gstreamer cache
112-
rm ${HOME}/.cache/gstreamer-1.0/*
96+
rm ${HOME}/.cache/gstreamer-1.0/*
+45
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,45 @@
1+
################################################################################
2+
# SPDX-FileCopyrightText: Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3+
# SPDX-License-Identifier: Apache-2.0
4+
#
5+
# Licensed under the Apache License, Version 2.0 (the "License");
6+
# you may not use this file except in compliance with the License.
7+
# You may obtain a copy of the License at
8+
#
9+
# http://www.apache.org/licenses/LICENSE-2.0
10+
#
11+
# Unless required by applicable law or agreed to in writing, software
12+
# distributed under the License is distributed on an "AS IS" BASIS,
13+
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14+
# See the License for the specific language governing permissions and
15+
# limitations under the License.
16+
################################################################################
17+
18+
Prequisites:
19+
- DeepStreamSDK 6.2
20+
- Python 3.8
21+
- Gst-python
22+
23+
To run the test app:
24+
$ python3 deepstream_custom_binding_test.py <h264_elementary_stream>
25+
26+
This document shall describe the sample deepstream-custom-binding-test application.
27+
28+
It is meant for simple demonstration of how to use NvDsUserMeta to attach custom
29+
data structure to the buffer at upstream element's pad using probe function and extract
30+
the same custom data structure later at a downstream element's pad, also using another
31+
probe function.
32+
33+
The elements used in the pipeline are as follows:
34+
FileSrc -> H264Parse -> NvV4l2Decoder -> NvStreammux -> Queue -> Queue -> FakeSink
35+
36+
First probe function attaches custom structure, which is added to the PyDS bindings, to the NvDsUserMeta, which is added to the frame by PyDS using pyds.nvds_add_user_meta_to_frame()
37+
This first probe is added at the srcpad of NvStreamMux.
38+
39+
For copying integers and strings from python data structure to PyDS bindings,
40+
the function pyds.copy_custom_struct() is used.
41+
42+
Second probe function reads the values attached as part of this custom structure after
43+
the buffer reaches sinkpad of FakeSink. The allocated memory is then freed using pyds.release_custom_struct()
44+
45+

0 commit comments

Comments
 (0)