Skip to content

Commit b362b17

Browse files
committed
Update to 1.1.0 release
- Add bindings sources and build instructions - Update license to Apache 2.0 - New bindings and apps
1 parent 6aabcaf commit b362b17

File tree

146 files changed

+11715
-1177
lines changed

Some content is hidden

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

146 files changed

+11715
-1177
lines changed

.gitmodules

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,6 @@
1+
[submodule "3rdparty/pybind11"]
2+
path = 3rdparty/pybind11
3+
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

FAQ.md

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

3+
* [Git clone fails due to Gstreamer repo access error](#faq9)
34
* [Application fails to work with mp4 stream](#faq0)
45
* [Ctrl-C does not stop the app during engine file generation](#faq1)
56
* [Application fails to create gst elements](#faq2)
@@ -8,7 +9,21 @@
89
* [Error on setting string field](#faq5)
910
* [Pipeline unable to perform at real time](#faq6)
1011
* [Triton container problems with multi-GPU setup](#faq7)
11-
* [ModuleNotFoundError: No module named 'pyds'] (#faq8)
12+
* [ModuleNotFoundError: No module named 'pyds'](#faq8)
13+
14+
<a name="faq9"></a>
15+
### Git clone fails due to Gstreamer repo access error
16+
If the following error is encountered while cloning:
17+
```
18+
fatal: unable to access 'https://gitlab.freedesktop.org/gstreamer/common.git/': server certificate verification failed. CAfile: /etc/ssl/certs/ca-certificates.crt CRLfile: none
19+
fatal: clone of 'https://gitlab.freedesktop.org/gstreamer/common.git' into submodule path '/opt/nvidia/deepstream/deepstream/sources/ds_python/3rdparty/gst-python/common' failed
20+
```
21+
22+
Temporarily disable git SSL verification by:
23+
```
24+
export GIT_SSL_NO_VERIFY=true
25+
```
26+
before cloning the repo. Unset the variable after cloning.
1227

1328
<a name="faq0"></a>
1429
### Application fails to work with mp4 stream
@@ -106,9 +121,9 @@ e.g.: `--gpus device=0`
106121

107122
<a name="faq8"></a>
108123
### ModuleNotFoundError: No module named 'pyds'
109-
The pyds extension is installed under /opt/nvidia/deepstream/deepstream/lib
110-
The sample applications all include this path via the is_aarch_64 module.
111-
A setup.py is also provided to install this extension into standard path.
112-
Currently this needs to be run manually:
113-
$ cd /opt/nvidia/deepstream/deepstream/lib
114-
$ python3 setup.py install
124+
The pyds wheel installs the pyds.so library where all the pip packages are stored. Make sure the wheel installation succeeds and the pyds.so is present in the correct path (which should be /home/<user>/.local/lib/python<python-version>/site-packages/pyds.so)
125+
126+
Command to install the pyds wheel is:
127+
```bash
128+
$ pip3 install ./pyds-1.1.0-py3-none*.whl
129+
```

HOWTO.md

Lines changed: 13 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -16,8 +16,8 @@ This guide provides resources for DeepStream application development in Python.
1616
## Prerequisites
1717

1818
* Ubuntu 18.04
19-
* [DeepStream SDK 5.1](https://developer.nvidia.com/deepstream-download) or later
20-
* Python 3.6
19+
* [DeepStream SDK 6.0](https://developer.nvidia.com/deepstream-download) or later
20+
* Python 3.6+
2121
* [Gst Python](https://gstreamer.freedesktop.org/modules/gst-python.html) v1.14.5
2222

2323
Gst python should be already installed on Jetson.
@@ -35,14 +35,21 @@ If missing, install with the following steps:
3535
$ sudo make install
3636
```
3737

38+
<a name="compile_bindings"></a>
39+
## Compiling Python Bindings
40+
41+
Please follow instructions for compiling the bindings [here](bindings/README.md)
42+
43+
Note: Compiling bindings now also generates a pip installable python wheel for the platform (x86 or aarch64) it is compiled on.
44+
3845
<a name="run_samples"></a>
3946
## Running Sample Applications
4047

41-
Clone the deepstream_python_apps repo under <DeepStream 5.1 ROOT>/sources:
48+
Clone the deepstream_python_apps repo under <DeepStream 6.0 ROOT>/sources:
4249
git clone https://github.com/NVIDIA-AI-IOT/deepstream_python_apps
4350

4451
This will create the following directory:
45-
```<DeepStream 5.1 ROOT>/sources/deepstream_python_apps```
52+
```<DeepStream 6.0 ROOT>/sources/deepstream_python_apps```
4653

4754
The Python apps are under the "apps" directory.
4855
Go into each app directory and follow instructions in the README.
@@ -60,7 +67,7 @@ See [sample applications](apps/) main functions for pipeline construction exampl
6067

6168
DeepStream MetaData contains inference results and other information used in analytics. The MetaData is attached to the Gst Buffer received by each pipeline component. The metadata format is described in detail in the [SDK MetaData documentation](https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_plugin_metadata.html) and [API Guide](https://docs.nvidia.com/metropolis/deepstream/python-api/index.html).
6269

63-
The SDK MetaData library is developed in C/C++. Python bindings provide access to the MetaData from Python applications. The bindings are provided in a compiled module, available for x86_64 and Jetson platforms. This module, pyds.so, is available as part of the DeepStream SDK installation under <DeepStream Root>/lib directory.
70+
The SDK MetaData library is developed in C/C++. Python bindings provide access to the MetaData from Python applications. The bindings are provided as part of this repository [here](bindings) and can be compiled natively for x86_64 and Jetson platforms. This module, pyds.so, can also be cross-compiled for aarch64 on x86 host by using [Qemu](https://www.qemu.org/) emulator. Dockerfile for the cross-compilation is provided [here](bindings/qemu_docker/ubuntu-cross-aarch64.Dockerfile)
6471

6572
The sample applications gets the import path for this module through common/utils.py. A setup.py is also included for installing the module into standard path:
6673
cd /opt/nvidia/deepstream/deepstream/lib
@@ -204,5 +211,5 @@ This function populates the input buffer with a timestamp generated according to
204211
<a name="imagedata_access"></a>
205212
## Image Data Access
206213

207-
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/5.1/python-api/index.html).
214+
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/python-api/index.html).
208215
Please see the [deepstream-imagedata-multistream](apps/deepstream-imagedata-multistream) sample application for an example of image data usage.

LICENSE

Lines changed: 11 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -1,21 +1,15 @@
1-
MIT License
1+
SPDX-FileCopyrightText: Copyright (c) 2019-2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
2+
SPDX-License-Identifier: Apache-2.0
23

3-
Copyright (c) 2019 - 2021 NVIDIA CORPORATION. All rights reserved.
4+
Licensed under the Apache License, Version 2.0 (the "License");
5+
you may not use this file except in compliance with the License.
6+
You may obtain a copy of the License at
47

5-
Permission is hereby granted, free of charge, to any person obtaining a copy
6-
of this software and associated documentation files (the "Software"), to deal
7-
in the Software without restriction, including without limitation the rights
8-
to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
9-
copies of the Software, and to permit persons to whom the Software is
10-
furnished to do so, subject to the following conditions:
8+
http://www.apache.org/licenses/LICENSE-2.0
119

12-
The above copyright notice and this permission notice shall be included in all
13-
copies or substantial portions of the Software.
10+
Unless required by applicable law or agreed to in writing, software
11+
distributed under the License is distributed on an "AS IS" BASIS,
12+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13+
See the License for the specific language governing permissions and
14+
limitations under the License.
1415

15-
THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
16-
IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
17-
FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
18-
AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
19-
LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
20-
OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE
21-
SOFTWARE.

README.md

Lines changed: 13 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,27 +2,29 @@
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: 5.1
5+
SDK version supported: 6.0
6+
7+
<b>NEW: The bindings sources along with build instructions are now available under [bindings](bindings)! </b>
68

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

9-
Please report any issues or bugs on the [Deepstream SDK Forums](https://devtalk.nvidia.com/default/board/209).
11+
Please report any issues or bugs on the [DeepStream SDK Forums](https://devtalk.nvidia.com/default/board/209). This enables the DeepStream community to find help at a central location.
1012

11-
* [Python Bindings](#metadata_bindings)
12-
* [Sample Applications](#sample_applications)
13+
- [DeepStream Python Apps](#deepstream-python-apps)
14+
- [Python Bindings](#python-bindings)
15+
- [Sample Applications](#sample-applications)
1316

1417
<a name="metadata_bindings"></a>
1518
## Python Bindings
1619

1720
DeepStream pipelines can be constructed using Gst Python, the GStreamer framework's Python bindings. For accessing DeepStream MetaData,
18-
Python bindings are provided in the form of a compiled module which is included in the DeepStream SDK. This module is generated using [Pybind11](https://github.com/pybind/pybind11).
21+
Python [bindings](bindings) are provided as part of this repository. This module is generated using [Pybind11](https://github.com/pybind/pybind11).
1922

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

2427
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.
25-
This release adds bindings for decoded image buffers (NvBufSurface) as well as inference output tensors (NvDsInferTensorMeta).
2628

2729
<a name="sample_applications"></a>
2830
## Sample Applications
@@ -46,12 +48,12 @@ We currently provide the following sample applications:
4648
* [deepstream-test1-usbcam](apps/deepstream-test1-usbcam) -- deepstream-test1 pipelien with USB camera input
4749
* [deepstream-test1-rtsp-out](apps/deepstream-test1-rtsp-out) -- deepstream-test1 pipeline with RTSP output
4850
* [deepstream-opticalflow](apps/deepstream-opticalflow) -- optical flow and visualization pipeline with flow vectors returned in NumPy array
49-
* [deepstream-segmentation](apps/deepstream-segmentation) -- segmentation and visualization pipeline with segmentation mask returned in NumPy array
50-
* [deepstream-nvdsanalytics](apps/deepstream-nvdsanalytics) -- multistream pipeline with analytics plugin
51-
* [runtime_source_add_delete](apps/runtime_source_add_delete) -- add/delete source streams at runtime
51+
* [deepstream-segmentation](apps/deepstream-segmentation) -- segmentation and visualization pipeline with segmentation mask returned in NumPy array
52+
* [deepstream-nvdsanalytics](apps/deepstream-nvdsanalytics) -- multistream pipeline with analytics plugin
53+
* [runtime_source_add_delete](apps/runtime_source_add_delete) -- add/delete source streams at runtime
54+
* [deepstream-imagedata-multistream-redaction](apps/deepstream-imagedata-multistream-redaction) -- multi-stream pipeline with face detection and redaction (<b>NEW</b>)
55+
* [deepstream-rtsp-in-rtsp-out](apps/deepstream-rtsp-in-rtsp-out) -- multi-stream pipeline with RTSP input/output (<b>NEW</b>)
5256

53-
Of these applications, the following have been updated or added in this release:
54-
* runtime_source_add_delete -- add/delete source streams at runtime
5557

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

apps/README

Lines changed: 16 additions & 21 deletions
Original file line numberDiff line numberDiff line change
@@ -1,31 +1,26 @@
11
################################################################################
2-
# Copyright (c) 2019-2021, NVIDIA CORPORATION. All rights reserved.
2+
# SPDX-FileCopyrightText: Copyright (c) 2019-2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3+
# SPDX-License-Identifier: Apache-2.0
34
#
4-
# Permission is hereby granted, free of charge, to any person obtaining a
5-
# copy of this software and associated documentation files (the "Software"),
6-
# to deal in the Software without restriction, including without limitation
7-
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
8-
# and/or sell copies of the Software, and to permit persons to whom the
9-
# Software is furnished to do so, subject to the following conditions:
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
108
#
11-
# The above copyright notice and this permission notice shall be included in
12-
# all copies or substantial portions of the Software.
9+
# http://www.apache.org/licenses/LICENSE-2.0
1310
#
14-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17-
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19-
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20-
# DEALINGS IN THE SOFTWARE.
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.
2116
################################################################################
2217

2318
================================================================================
2419
DeepStream SDK Python Bindings
2520
================================================================================
2621
Setup pre-requisites:
2722
- Ubuntu 18.04
28-
- NVIDIA DeepStream SDK 5.1
23+
- NVIDIA DeepStream SDK 6.0
2924
- Python 3.6
3025
- Gst-python
3126

@@ -63,7 +58,7 @@ The DeepStream Python package includes:
6358
Installing Pre-requisites:
6459
--------------------------------------------------------------------------------
6560

66-
DeepStream SDK 5.1 Developer Preview
61+
DeepStream SDK 6.0
6762
--------------------
6863
Download and install from https://developer.nvidia.com/deepstream-download
6964

@@ -81,12 +76,12 @@ $ sudo apt install python3-gi python3-dev python3-gst-1.0 -y
8176
--------------------------------------------------------------------------------
8277
Running the samples
8378
--------------------------------------------------------------------------------
84-
The apps are configured to work from inside the DeepStream SDK 5.1 installation.
79+
The apps are configured to work from inside the DeepStream SDK 6.0 installation.
8580

86-
Clone the deepstream_python_apps repo under <DeepStream 5.1 ROOT>/sources:
81+
Clone the deepstream_python_apps repo under <DeepStream ROOT>/sources:
8782
$ git clone https://github.com/NVIDIA-AI-IOT/deepstream_python_apps
8883
This will create the following directory:
89-
<DeepStream 5.1 ROOT>/sources/deepstream_python_apps
84+
<DeepStream ROOT>/sources/deepstream_python_apps
9085

9186
Follow README in each app's directory to run the app.
9287

apps/common/FPS.py

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,18 @@
11
################################################################################
2-
# Copyright (c) 2019-2020, NVIDIA CORPORATION. All rights reserved.
2+
# SPDX-FileCopyrightText: Copyright (c) 2019-2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3+
# SPDX-License-Identifier: Apache-2.0
34
#
4-
# Permission is hereby granted, free of charge, to any person obtaining a
5-
# copy of this software and associated documentation files (the "Software"),
6-
# to deal in the Software without restriction, including without limitation
7-
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
8-
# and/or sell copies of the Software, and to permit persons to whom the
9-
# Software is furnished to do so, subject to the following conditions:
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
108
#
11-
# The above copyright notice and this permission notice shall be included in
12-
# all copies or substantial portions of the Software.
9+
# http://www.apache.org/licenses/LICENSE-2.0
1310
#
14-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17-
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19-
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20-
# DEALINGS IN THE SOFTWARE.
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.
2116
################################################################################
2217

2318
import time

apps/common/bus_call.py

Lines changed: 11 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -1,23 +1,18 @@
11
################################################################################
2-
# Copyright (c) 2019-2020, NVIDIA CORPORATION. All rights reserved.
2+
# SPDX-FileCopyrightText: Copyright (c) 2019-2021 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
3+
# SPDX-License-Identifier: Apache-2.0
34
#
4-
# Permission is hereby granted, free of charge, to any person obtaining a
5-
# copy of this software and associated documentation files (the "Software"),
6-
# to deal in the Software without restriction, including without limitation
7-
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
8-
# and/or sell copies of the Software, and to permit persons to whom the
9-
# Software is furnished to do so, subject to the following conditions:
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
108
#
11-
# The above copyright notice and this permission notice shall be included in
12-
# all copies or substantial portions of the Software.
9+
# http://www.apache.org/licenses/LICENSE-2.0
1310
#
14-
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
15-
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
16-
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
17-
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
18-
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
19-
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
20-
# DEALINGS IN THE SOFTWARE.
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.
2116
################################################################################
2217

2318
import gi

0 commit comments

Comments
 (0)