Skip to content

Commit 2027435

Browse files
committed
Update to 1.1.10 Release
This release is compatible with DeepStream SDK 6.4 Ubuntu 22.04 Python 3.10 DeepStream SDK 6.4 Features: - New API for alloc_nvds_event_msg_meta() - see deepstream-test4 and bindschema.cpp for reference - Tracker meta data type names have been updated with DS 6.4 release - see deepstream-test2 for reference - deepstream-test4 has been updated with information on how to run with MQTT protocol adaptor - All app configurations have been updated to use newest model engines that ship with DS 6.4 and latest TAO toolkit - deepstream-test1-rtsp-out has been updated to demonstrate support for Orin Nano by adding an option to use software encoder
1 parent 8178b5e commit 2027435

File tree

116 files changed

+1215
-1328
lines changed

Some content is hidden

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

116 files changed

+1215
-1328
lines changed

.gitmodules

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[submodule "3rdparty/pybind11"]
22
path = 3rdparty/pybind11
33
url = https://github.com/pybind/pybind11.git
4-
[submodule "3rdparty/gst-python"]
5-
path = 3rdparty/gst-python
6-
url = https://github.com/GStreamer/gst-python.git
4+
[submodule "gstreamer"]
5+
path = 3rdparty/gstreamer
6+
url = https://github.com/GStreamer/gstreamer.git

3rdparty/gst-python

Lines changed: 0 additions & 1 deletion
This file was deleted.

FAQ.md

Lines changed: 14 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# Frequently Asked Questions and Troubleshooting Guide
22

33
- [Frequently Asked Questions and Troubleshooting Guide](#frequently-asked-questions-and-troubleshooting-guide)
4+
- [App causes Jetson Orin Nano to freeze and reboot](#app-causes-jetson-orin-nano-to-freeze-and-reboot)
45
- [Using new gst-nvstreammux](#using-new-gst-nvstreammux)
56
- [Git clone fails due to Gstreamer repo access error](#git-clone-fails-due-to-gstreamer-repo-access-error)
67
- [Application fails to work with mp4 stream](#application-fails-to-work-with-mp4-stream)
@@ -13,6 +14,18 @@
1314
- [Triton container problems with multi-GPU setup](#triton-container-problems-with-multi-gpu-setup)
1415
- [ModuleNotFoundError: No module named 'pyds'](#modulenotfounderror-no-module-named-pyds)
1516

17+
<a name="faq11"></a>
18+
### App causes Jetson Orin Nano to freeze and reboot
19+
Most of the DeepStream Python apps are written to use hardware encoders. The Jetson Orin Nano does not have any hardware encoders, so the app must be modified to use software encoders in the pipeline. Please see [deepstream-test1-rtsp-out](./apps/deepstream-test1-rtsp-out/deepstream_test_1_rtsp_out.py):
20+
```python
21+
if codec == "H264":
22+
encoder = Gst.ElementFactory.make("nvv4l2h264enc", "encoder")
23+
if enc_type == 0: # HW encoder
24+
encoder = Gst.ElementFactory.make("nvv4l2h264enc", "encoder")
25+
else: # SW encoder
26+
encoder = Gst.ElementFactory.make("x264enc", "encoder")
27+
```
28+
1629
<a name="faq10"></a>
1730
### Using new gst-nvstreammux
1831
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:
@@ -152,5 +165,5 @@ The pyds wheel installs the pyds.so library where all the pip packages are store
152165

153166
Command to install the pyds wheel is:
154167
```bash
155-
$ pip3 install ./pyds-1.1.8-py3-none*.whl
168+
$ pip3 install ./pyds-1.1.10-py3-none*.whl
156169
```

HOWTO.md

Lines changed: 14 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,10 @@ This guide provides resources for DeepStream application development in Python.
1515
<a name="prereqs"></a>
1616
## Prerequisites
1717

18-
* Ubuntu 20.04
19-
* [DeepStream SDK 6.3](https://developer.nvidia.com/deepstream-download) or later
20-
* Python 3.8
21-
* [Gst Python](https://gstreamer.freedesktop.org/modules/gst-python.html) v1.16.2
18+
* Ubuntu 22.04
19+
* [DeepStream SDK 6.4](https://developer.nvidia.com/deepstream-download) or later
20+
* Python 3.10
21+
* [Gst Python](https://gstreamer.freedesktop.org/modules/gst-python.html) v1.20.3
2222

2323
Gst python should be already installed on Jetson.
2424
If missing, install with the following steps:
@@ -84,12 +84,12 @@ Memory for MetaData is shared by the Python and C/C++ code paths. For example, a
8484

8585
#### Allocations
8686

87-
When MetaData objects are allocated in Python, an allocation function is provided by the bindings to ensure proper memory ownership of the object. If the constructor is used, the the object will be claimed by the garbage collector when its Python references terminate. However, the object will still need to be accessed by C/C++ code downstream, and therefore must persist beyond those Python references.
87+
When MetaData objects are allocated in Python, an allocation function is provided by the bindings to ensure proper memory ownership of the object. If the constructor is used, the object will be claimed by the garbage collector when its Python references terminate. However, the object will still need to be accessed by C/C++ code downstream, and therefore must persist beyond those Python references.
8888

8989
Example:
9090
To allocate an NvDsEventMsgMeta instance, use this:
9191
```python
92-
msg_meta = pyds.alloc_nvds_event_msg_meta() # get reference to allocated instance without claiming memory ownership
92+
msg_meta = pyds.alloc_nvds_event_msg_meta(user_event_meta) # get reference to allocated instance without claiming memory ownership
9393
```
9494
NOT this:
9595
```python
@@ -173,16 +173,21 @@ frame_meta = pyds.NvDsFrameMeta.cast(l_frame.data)
173173

174174
Custom MetaData added to NvDsUserMeta require custom copy and release functions. The MetaData library relies on these custom functions to perform deep-copy of the custom structure, and free allocated resources. These functions are registered as callback function pointers in the NvDsUserMeta structure.
175175

176-
Callback functions are registered using these functions:
176+
##### Deprecation Warning
177+
Previously, Callback functions were registered using these functions:
177178
```python
178179
pyds.set_user_copyfunc(NvDsUserMeta_instance, copy_function)
179180
pyds.set_user_releasefunc(NvDsUserMeta_instance, free_func)
180181
```
181182

182-
*NOTE*: Callbacks need to be unregistered with the bindings library before the application exits. The bindings library currently keeps global references to the registered functions, and these cannot last beyond bindings library unload which happens at application exit. Use the following function to unregister all callbacks:
183+
These are now DEPRECATED and are replaced by similar implementation in the binding itself. These are event_msg_meta_copy_func() and event_msg_meta_release_func() respectively. These can be found inside [bindschema.cpp](bindings/src/bindschema.cpp)
184+
185+
##### Deprecation Warning
186+
*NOTE*: Previously, callbacks needed to be unregistered with the bindings library before the application exits. The bindings library currently keeps global references to the registered functions, and these cannot last beyond bindings library unload which happens at application exit. Use the following function to unregister all callbacks:
183187
```pyds.unset_callback_funcs()```
188+
These callbacks are automatically set inside the alloc_nvds_event_msg_meta() function and should NOT be set from the python application (e.g. deepstream-test4)
184189

185-
See the deepstream-test4 sample application for an example of callback registration and unregistration.
190+
The deepstream-test4 sample application has been updated to show an example of removal of these callback registration and unregistration.
186191

187192
Limitation: the bindings library currently only supports a single set of callback functions for each application. The last registered function will be used.
188193

README.md

Lines changed: 12 additions & 9 deletions
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.3
5+
SDK version supported: 6.4
66

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>
7+
<b>This release only supports Ubuntu 22.04 for DeepStreamSDK 6.4 with Python 3.10 and [gst-python](3rdparty/gst-python/) 1.20.3! Ubuntu 20.04 for DeepStreamSDK 6.3 with Python 3.8 support is NOW DEPRECATED</b>
88

9-
<b>This release only supports Ubuntu 20.04 for DeepStreamSDK 6.3 with Python 3.8 and [gst-python](3rdparty/gst-python/) 1.16.2! Ubuntu 18.04 support is now deprecrated.</b>
9+
The bindings sources along with build instructions are available under [bindings](bindings)! We include one [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.
1010

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

@@ -28,6 +28,9 @@ Python [bindings](bindings) are provided as part of this repository. This module
2828

2929
These bindings support a Python interface to the MetaData structures and functions. Usage of this interface is documented in the [HOW-TO Guide](HOWTO.md) and demonstrated in the sample applications.
3030

31+
### Python Bindings Breaking API Change
32+
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](apps/deepstream-test4) and [bindschema.cpp](bindings/src/bindschema.cpp) for reference.
33+
3134
<a name="sample_applications"></a>
3235
## Sample Applications
3336

@@ -41,20 +44,20 @@ To run the sample applications or write your own, please consult the [HOW-TO Gui
4144
</p>
4245

4346
We currently provide the following sample applications:
44-
* [deepstream-test1](apps/deepstream-test1) -- 4-class object detection pipeline - now also demonstrates support for new nvstreammux
45-
* [deepstream-test2](apps/deepstream-test2) -- 4-class object detection, tracking and attribute classification pipeline
46-
* [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
47-
* [deepstream-test4](apps/deepstream-test4) -- msgbroker for sending analytics results to the cloud
47+
* [deepstream-test1](apps/deepstream-test1) -- 4-class object detection pipeline, also demonstrates support for new nvstreammux
48+
* **UPDATED** [deepstream-test2](apps/deepstream-test2) -- 4-class object detection, tracking and attribute classification pipeline - now uses new names for tracker meta data types in DS 6.4
49+
* [deepstream-test3](apps/deepstream-test3) -- multi-stream pipeline performing 4-class object detection, also supports triton inference server, no-display mode, file-loop and silent mode
50+
* **UPDATED** [deepstream-test4](apps/deepstream-test4) -- msgbroker for sending analytics results to the cloud - now supports MQTT protocol adaptor
4851
* [deepstream-imagedata-multistream](apps/deepstream-imagedata-multistream) -- multi-stream pipeline with access to image buffers
4952
* [deepstream-ssd-parser](apps/deepstream-ssd-parser) -- SSD model inference via Triton server with output parsing in Python
5053
* [deepstream-test1-usbcam](apps/deepstream-test1-usbcam) -- deepstream-test1 pipeline with USB camera input
51-
* [deepstream-test1-rtsp-out](apps/deepstream-test1-rtsp-out) -- deepstream-test1 pipeline with RTSP output
54+
* **UPDATED** [deepstream-test1-rtsp-out](apps/deepstream-test1-rtsp-out) -- deepstream-test1 pipeline with RTSP output - now demonstrates adding software encoder option to support Jetson Orin Nano
5255
* [deepstream-opticalflow](apps/deepstream-opticalflow) -- optical flow and visualization pipeline with flow vectors returned in NumPy array
5356
* [deepstream-segmentation](apps/deepstream-segmentation) -- segmentation and visualization pipeline with segmentation mask returned in NumPy array
5457
* [deepstream-nvdsanalytics](apps/deepstream-nvdsanalytics) -- multistream pipeline with analytics plugin
5558
* [runtime_source_add_delete](apps/runtime_source_add_delete) -- add/delete source streams at runtime
5659
* [deepstream-imagedata-multistream-redaction](apps/deepstream-imagedata-multistream-redaction) -- multi-stream pipeline with face detection and redaction
57-
* <b>UPDATED</b> [deepstream-rtsp-in-rtsp-out](apps/deepstream-rtsp-in-rtsp-out) -- multi-stream pipeline with RTSP input/output -- now takes new command line argument "--rtsp-ts" for configuring the RTSP source to attach the timestamp rather than the streammux
60+
* [deepstream-rtsp-in-rtsp-out](apps/deepstream-rtsp-in-rtsp-out) -- multi-stream pipeline with RTSP input/output - has command line option "--rtsp-ts" for configuring the RTSP source to attach the timestamp rather than the streammux
5861
* [deepstream-preprocess-test](apps/deepstream-preprocess-test) -- multi-stream pipeline using nvdspreprocess plugin with custom ROIs
5962
* [deepstream-demux-multi-in-multi-out](apps/deepstream-demux-multi-in-multi-out) -- multi-stream pipeline using nvstreamdemux plugin to generated separate buffer outputs
6063
* [deepstream-imagedata-multistream-cupy](apps/deepstream-imagedata-multistream-cupy) -- access imagedata buffer from GPU in a multistream source as CuPy array - x86 only

apps/README

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,9 +19,9 @@
1919
DeepStream SDK Python Bindings
2020
================================================================================
2121
Setup pre-requisites:
22-
- Ubuntu 20.04
23-
- NVIDIA DeepStream SDK 6.3
24-
- Python 3.8
22+
- Ubuntu 22.04
23+
- NVIDIA DeepStream SDK 6.4
24+
- Python 3.10
2525
- Gst-python
2626

2727
--------------------------------------------------------------------------------
@@ -36,13 +36,13 @@ Package Contents
3636
Installing Pre-requisites:
3737
--------------------------------------------------------------------------------
3838

39-
DeepStream SDK 6.3
39+
DeepStream SDK 6.4
4040
--------------------
4141
Download and install from https://developer.nvidia.com/deepstream-download
4242

43-
Python 3.8
43+
Python 3.10
4444
----------
45-
Should be already installed with Ubuntu 20.04
45+
Should be already installed with Ubuntu 22.04
4646

4747
Gst-python
4848
----------
@@ -54,7 +54,7 @@ $ sudo apt install python3-gi python3-dev python3-gst-1.0 -y
5454
--------------------------------------------------------------------------------
5555
Running the samples
5656
--------------------------------------------------------------------------------
57-
The apps are configured to work from inside the DeepStream SDK 6.3 installation.
57+
The apps are configured to work from inside the DeepStream SDK 6.4 installation.
5858

5959
Clone the deepstream_python_apps repo under <DeepStream ROOT>/sources:
6060
$ git clone https://github.com/NVIDIA-AI-IOT/deepstream_python_apps

apps/deepstream-custom-binding-test/README

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
################################################################################
1717

1818
Prequisites:
19-
- DeepStreamSDK 6.3
20-
- Python 3.8
19+
- DeepStreamSDK 6.4
20+
- Python 3.10
2121
- Gst-python
2222

2323
To run the test app:

apps/deepstream-demux-multi-in-multi-out/README

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@
1616
################################################################################
1717

1818
Prerequisites:
19-
- DeepStreamSDK 6.3
20-
- Python 3.8
19+
- DeepStreamSDK 6.4
20+
- Python 3.10
2121
- Gst-python
2222

2323
To run:

apps/deepstream-demux-multi-in-multi-out/deepstream_demux_multi_in_multi_out.py

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
#!/usr/bin/env python3
22

33
################################################################################
4-
# SPDX-FileCopyrightText: Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
4+
# SPDX-FileCopyrightText: Copyright (c) 2022-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
55
# SPDX-License-Identifier: Apache-2.0
66
#
77
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -50,7 +50,7 @@
5050
PGIE_CLASS_ID_ROADSIGN = 3
5151
MUXER_OUTPUT_WIDTH = 540
5252
MUXER_OUTPUT_HEIGHT = 540 # 1080
53-
MUXER_BATCH_TIMEOUT_USEC = 4000000
53+
MUXER_BATCH_TIMEOUT_USEC = 33000
5454
TILED_OUTPUT_WIDTH = 640 # 1280
5555
TILED_OUTPUT_HEIGHT = 360 # 720
5656
GST_CAPS_FEATURES_NVMM = "memory:NVMM"
@@ -321,7 +321,7 @@ def main(args, requested_pgie=None, config=None, disable_probe=False):
321321
streammux.set_property("width", 960)
322322
streammux.set_property("height", 540)
323323
streammux.set_property("batch-size", number_sources)
324-
streammux.set_property("batched-push-timeout", 4000000)
324+
streammux.set_property("batched-push-timeout", MUXER_BATCH_TIMEOUT_USEC)
325325
pgie.set_property("config-file-path", "ds_demux_pgie_config.txt")
326326
pgie_batch_size = pgie.get_property("batch-size")
327327
if pgie_batch_size != number_sources:

apps/deepstream-demux-multi-in-multi-out/ds_demux_pgie_config.txt

Lines changed: 16 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
################################################################################
2-
# SPDX-FileCopyrightText: Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
# SPDX-FileCopyrightText: Copyright (c) 2019-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
33
# SPDX-License-Identifier: Apache-2.0
44
#
55
# Licensed under the Apache License, Version 2.0 (the "License");
@@ -26,7 +26,7 @@
2626
#
2727
# Optional properties for detectors:
2828
# cluster-mode(Default=Group Rectangles), interval(Primary mode only, Default=0)
29-
# custom-lib-path
29+
# custom-lib-path,
3030
# parse-bbox-func-name
3131
#
3232
# Mandatory properties for classifiers:
@@ -54,24 +54,30 @@
5454

5555
[property]
5656
gpu-id=0
57-
net-scale-factor=0.0039215697906911373
58-
model-file=../../../../samples/models/Primary_Detector/resnet10.caffemodel
59-
proto-file=../../../../samples/models/Primary_Detector/resnet10.prototxt
60-
model-engine-file=../../../../samples/models/Primary_Detector/resnet10.caffemodel_b1_gpu0_int8.engine
57+
net-scale-factor=0.00392156862745098
58+
tlt-model-key=tlt_encode
59+
tlt-encoded-model=../../../../samples/models/Primary_Detector/resnet18_trafficcamnet.etlt
60+
model-engine-file=../../../../samples/models/Primary_Detector/resnet18_trafficcamnet.etlt_b1_gpu0_int8.engine
6161
labelfile-path=../../../../samples/models/Primary_Detector/labels.txt
6262
int8-calib-file=../../../../samples/models/Primary_Detector/cal_trt.bin
6363
force-implicit-batch-dim=1
64-
batch-size=1
64+
batch-size=30
6565
process-mode=1
6666
model-color-format=0
67+
## 0=FP32, 1=INT8, 2=FP16 mode
6768
network-mode=1
6869
num-detected-classes=4
6970
interval=0
7071
gie-unique-id=1
71-
output-blob-names=conv2d_bbox;conv2d_cov/Sigmoid
72+
uff-input-order=0
73+
uff-input-blob-name=input_1
74+
output-blob-names=output_cov/Sigmoid;output_bbox/BiasAdd
75+
#scaling-filter=0
76+
#scaling-compute-hw=0
7277
cluster-mode=2
78+
infer-dims=3;544;960
7379

7480
[class-attrs-all]
7581
pre-cluster-threshold=0.2
76-
topk=20
77-
nms-iou-threshold=0.5
82+
eps=0.2
83+
group-threshold=1

0 commit comments

Comments
 (0)