Skip to content

Commit

Permalink
Update to 1.1.8 release
Browse files Browse the repository at this point in the history
This release is compatible with DeepStream SDK 6.3

Ubuntu 20.04
Python 3.8
DeepStream SDK 6.3

Features:
- New interactive Jupyter notebook for LaunchPad demo
- New binding added: configure_source_for_ntp_sync()
- Updated deepstream-rtsp-in-rtsp-out app with new command line argument demonstrating above binding
- Updated apps that use tracker for deprecated configs
  • Loading branch information
nv-camilleh committed Aug 8, 2023
1 parent 441b50d commit 8178b5e
Show file tree
Hide file tree
Showing 62 changed files with 2,223 additions and 2,584 deletions.
2 changes: 1 addition & 1 deletion FAQ.md
Original file line number Diff line number Diff line change
Expand Up @@ -152,5 +152,5 @@ The pyds wheel installs the pyds.so library where all the pip packages are store

Command to install the pyds wheel is:
```bash
$ pip3 install ./pyds-1.1.6-py3-none*.whl
$ pip3 install ./pyds-1.1.8-py3-none*.whl
```
6 changes: 3 additions & 3 deletions HOWTO.md
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ This guide provides resources for DeepStream application development in Python.
## Prerequisites

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

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

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

This will create the following directory:
```<DeepStream 6.2 ROOT>/sources/deepstream_python_apps```
```<DeepStream ROOT>/sources/deepstream_python_apps```

The Python apps are under the "apps" directory.
Go into each app directory and follow instructions in the README.
Expand Down
12 changes: 6 additions & 6 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

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

SDK version supported: 6.2
SDK version supported: 6.3

<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>

<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>
<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>

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

Expand Down Expand Up @@ -41,7 +41,7 @@ To run the sample applications or write your own, please consult the [HOW-TO Gui
</p>

We currently provide the following sample applications:
* <b>UPDATED</b> [deepstream-test1](apps/deepstream-test1) -- 4-class object detection pipeline - now also demonstrates support for new nvstreammux
* [deepstream-test1](apps/deepstream-test1) -- 4-class object detection pipeline - now also demonstrates support for new nvstreammux
* [deepstream-test2](apps/deepstream-test2) -- 4-class object detection, tracking and attribute classification pipeline
* [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
* [deepstream-test4](apps/deepstream-test4) -- msgbroker for sending analytics results to the cloud
Expand All @@ -54,12 +54,12 @@ We currently provide the following sample applications:
* [deepstream-nvdsanalytics](apps/deepstream-nvdsanalytics) -- multistream pipeline with analytics plugin
* [runtime_source_add_delete](apps/runtime_source_add_delete) -- add/delete source streams at runtime
* [deepstream-imagedata-multistream-redaction](apps/deepstream-imagedata-multistream-redaction) -- multi-stream pipeline with face detection and redaction
* [deepstream-rtsp-in-rtsp-out](apps/deepstream-rtsp-in-rtsp-out) -- multi-stream pipeline with RTSP input/output
* <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
* [deepstream-preprocess-test](apps/deepstream-preprocess-test) -- multi-stream pipeline using nvdspreprocess plugin with custom ROIs
* [deepstream-demux-multi-in-multi-out](apps/deepstream-demux-multi-in-multi-out) -- multi-stream pipeline using nvstreamdemux plugin to generated separate buffer outputs
* [deepstream-imagedata-multistream-cupy](apps/deepstream-imagedata-multistream-cupy) -- access imagedata buffer from GPU in a multistream source as CuPy array - x86 only
* <b>NEW</b> [deepstream-segmask](apps/deepstream-segmask) -- access and interpret segmentation mask information from NvOSD_MaskParams
* <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)
* [deepstream-segmask](apps/deepstream-segmask) -- access and interpret segmentation mask information from NvOSD_MaskParams
* [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)


Detailed application information is provided in each application's subdirectory under [apps](apps).
Expand Down
6 changes: 3 additions & 3 deletions apps/README
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ DeepStream SDK Python Bindings
================================================================================
Setup pre-requisites:
- Ubuntu 20.04
- NVIDIA DeepStream SDK 6.2
- NVIDIA DeepStream SDK 6.3
- Python 3.8
- Gst-python

Expand All @@ -36,7 +36,7 @@ Package Contents
Installing Pre-requisites:
--------------------------------------------------------------------------------

DeepStream SDK 6.2
DeepStream SDK 6.3
--------------------
Download and install from https://developer.nvidia.com/deepstream-download

Expand All @@ -54,7 +54,7 @@ $ sudo apt install python3-gi python3-dev python3-gst-1.0 -y
--------------------------------------------------------------------------------
Running the samples
--------------------------------------------------------------------------------
The apps are configured to work from inside the DeepStream SDK 6.2 installation.
The apps are configured to work from inside the DeepStream SDK 6.3 installation.

Clone the deepstream_python_apps repo under <DeepStream ROOT>/sources:
$ git clone https://github.com/NVIDIA-AI-IOT/deepstream_python_apps
Expand Down
2 changes: 1 addition & 1 deletion apps/deepstream-custom-binding-test/README
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
################################################################################

Prequisites:
- DeepStreamSDK 6.2
- DeepStreamSDK 6.3
- Python 3.8
- Gst-python

Expand Down
2 changes: 1 addition & 1 deletion apps/deepstream-demux-multi-in-multi-out/README
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
################################################################################

Prerequisites:
- DeepStreamSDK 6.2
- DeepStreamSDK 6.3
- Python 3.8
- Gst-python

Expand Down
10 changes: 5 additions & 5 deletions apps/deepstream-imagedata-multistream-cupy/README
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
################################################################################
# SPDX-FileCopyrightText: Copyright (c) 2022 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-FileCopyrightText: Copyright (c) 2022-2023 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
Expand All @@ -16,19 +16,19 @@
################################################################################

Prerequisites:
- DeepStreamSDK 6.2
- DeepStreamSDK 6.3
- Python 3.8
- Gst-python
- NumPy package
- OpenCV package
- CuPy for Cuda 11.2 or later
- CuPy for Cuda 12.1 or later

** This application is currently only supported on x86.

To install required packages:
$ sudo apt update
$ sudo apt install python3-numpy python3-opencv -y
$ pip3 install cupy-cuda11x
$ pip3 install cupy-cuda12x

To run:
$ python3 deepstream_imagedata-multistream_cupy.py -i <uri1> [uri2] ... [uriN]
Expand Down Expand Up @@ -92,4 +92,4 @@ broken down into the following steps:
4. Construction of cupy.cuda.MemoryPointer from UnownedMemory
5. Construction of cupy.ndarray from MemoryPointer and other buffer info retrieved from bindings call

When performing operations on the image array, we use a CUDA null stream to prevent access of buffer memory by other CUDA operations.
When performing operations on the image array, we use a CUDA null stream to prevent access of buffer memory by other CUDA operations.
2 changes: 1 addition & 1 deletion apps/deepstream-imagedata-multistream-redaction/README
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
################################################################################

Prerequisites:
- DeepStreamSDK 6.2
- DeepStreamSDK 6.3
- Python 3.8
- Gst-python
- NumPy package
Expand Down
2 changes: 1 addition & 1 deletion apps/deepstream-imagedata-multistream/README
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
################################################################################

Prerequisites:
- DeepStreamSDK 6.2
- DeepStreamSDK 6.3
- Python 3.8
- Gst-python
- NumPy package
Expand Down
2 changes: 1 addition & 1 deletion apps/deepstream-nvdsanalytics/README
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
################################################################################

Prerequisites:
- DeepStreamSDK 6.2
- DeepStreamSDK 6.3
- Python 3.8
- Gst-python

Expand Down
6 changes: 0 additions & 6 deletions apps/deepstream-nvdsanalytics/deepstream_nvdsanalytics.py
Original file line number Diff line number Diff line change
Expand Up @@ -364,12 +364,6 @@ def main(args):
if key == 'll-config-file' :
tracker_ll_config_file = config.get('tracker', key)
tracker.set_property('ll-config-file', tracker_ll_config_file)
if key == 'enable-batch-process' :
tracker_enable_batch_process = config.getint('tracker', key)
tracker.set_property('enable_batch_process', tracker_enable_batch_process)
if key == 'enable-past-frame' :
tracker_enable_past_frame = config.getint('tracker', key)
tracker.set_property('enable_past_frame', tracker_enable_past_frame)

print("Adding elements to Pipeline \n")
pipeline.add(pgie)
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,5 +28,3 @@ tracker-height=384
gpu-id=0
ll-lib-file=/opt/nvidia/deepstream/deepstream/lib/libnvds_nvmultiobjecttracker.so
ll-config-file=config_tracker_NvDCF_perf.yml
#enable-past-frame=1
enable-batch-process=1
2 changes: 1 addition & 1 deletion apps/deepstream-opticalflow/README
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
################################################################################

Prerequisites:
- DeepStreamSDK 6.2
- DeepStreamSDK 6.3
- Python 3.8
- Gst-python
- NumPy package
Expand Down
2 changes: 1 addition & 1 deletion apps/deepstream-opticalflow/deepstream-opticalflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -62,7 +62,7 @@ def visualize_optical_flowvectors(flow):
return bgr


# tiler_sink_pad_buffer_probe will extract metadata received on OSD sink pad
# ofvisual_queue_src_pad_buffer_probe will extract metadata received on OSD sink pad
def ofvisual_queue_src_pad_buffer_probe(pad, info, u_data):
got_visual = False
frame_number = 0
Expand Down
2 changes: 1 addition & 1 deletion apps/deepstream-preprocess-test/README
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
################################################################################

Prerequisites:
- DeepStreamSDK 6.2
- DeepStreamSDK 6.3
- Python 3.8
- Gst-python
- GstRtspServer
Expand Down
4 changes: 3 additions & 1 deletion apps/deepstream-rtsp-in-rtsp-out/README
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
################################################################################

Prequisites:
- DeepStreamSDK 6.2
- DeepStreamSDK 6.3
- Python 3.8
- Gst-python
- GstRtspServer
Expand Down Expand Up @@ -76,3 +76,5 @@ This sample app specifically includes following :
4. Performs post-processing on the generated boxes with NMS (Non-maximum Suppression)
5. Adds detected objects into the pipeline metadata for downstream processing
6. Encodes OSD output and shows visual output over RTSP.

The "--rtsp-ts" option configures the RTSP source to attach the timestamp to the frame, as opposed to the streammux. Before using this option, please make sure the RTSP source sends RTCP Sender Reports. See this documentation for more details on how to check: https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_NTP_Timestamp.html.
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
gi.require_version("GstRtspServer", "1.0")
from gi.repository import Gst, GstRtspServer, GLib
import configparser
import datetime

import argparse

Expand All @@ -48,11 +49,11 @@
OSD_DISPLAY_TEXT = 0
pgie_classes_str = ["Vehicle", "TwoWheeler", "Person", "RoadSign"]

# tiler_sink_pad_buffer_probe will extract metadata received on OSD sink pad
# pgie_src_pad_buffer_probe will extract metadata received on OSD sink pad
# and update params for drawing rectangle, object information etc.


def tiler_src_pad_buffer_probe(pad, info, u_data):
def pgie_src_pad_buffer_probe(pad, info, u_data):
frame_number = 0
num_rects = 0
gst_buffer = info.get_buffer()
Expand All @@ -77,36 +78,13 @@ def tiler_src_pad_buffer_probe(pad, info, u_data):
break

frame_number = frame_meta.frame_num
l_obj = frame_meta.obj_meta_list
num_rects = frame_meta.num_obj_meta
obj_counter = {
PGIE_CLASS_ID_VEHICLE: 0,
PGIE_CLASS_ID_PERSON: 0,
PGIE_CLASS_ID_BICYCLE: 0,
PGIE_CLASS_ID_ROADSIGN: 0,
}
while l_obj is not None:
try:
# Casting l_obj.data to pyds.NvDsObjectMeta
obj_meta = pyds.NvDsObjectMeta.cast(l_obj.data)
except StopIteration:
break
obj_counter[obj_meta.class_id] += 1
try:
l_obj = l_obj.next
except StopIteration:
break

print(
"Frame Number=",
frame_number,
"Number of Objects=",
num_rects,
"Vehicle_count=",
obj_counter[PGIE_CLASS_ID_VEHICLE],
"Person_count=",
obj_counter[PGIE_CLASS_ID_PERSON],
frame_number
)
if ts_from_rtsp:
ts = frame_meta.ntp_timestamp/1000000000 # Retrieve timestamp, put decimal in proper position for Unix format
print("RTSP Timestamp:",datetime.datetime.utcfromtimestamp(ts).strftime('%Y-%m-%d %H:%M:%S')) # Convert timestamp to UTC

try:
l_frame = l_frame.next
Expand Down Expand Up @@ -149,6 +127,10 @@ def decodebin_child_added(child_proxy, Object, name, user_data):
if name.find("decodebin") != -1:
Object.connect("child-added", decodebin_child_added, user_data)

if ts_from_rtsp:
if name.find("source") != -1:
pyds.configure_source_for_ntp_sync(hash(Object))


def create_source_bin(index, uri):
print("Creating source bin")
Expand Down Expand Up @@ -298,8 +280,11 @@ def main(args):

streammux.set_property("width", 1920)
streammux.set_property("height", 1080)
streammux.set_property("batch-size", 1)
streammux.set_property("batch-size", number_sources)
streammux.set_property("batched-push-timeout", 4000000)

if ts_from_rtsp:
streammux.set_property("attach-sys-ts", 0)

if gie=="nvinfer":
pgie.set_property("config-file-path", "dstest1_pgie_config.txt")
Expand Down Expand Up @@ -353,6 +338,12 @@ def main(args):
bus.add_signal_watch()
bus.connect("message", bus_call, loop)

pgie_src_pad=pgie.get_static_pad("src")
if not pgie_src_pad:
sys.stderr.write(" Unable to get src pad \n")
else:
pgie_src_pad.add_probe(Gst.PadProbeType.BUFFER, pgie_src_pad_buffer_probe, 0)

# Start streaming
rtsp_port_num = 8554

Expand Down Expand Up @@ -394,6 +385,8 @@ def parse_args():
help="RTSP Streaming Codec H264/H265 , default=H264", choices=['H264','H265'])
parser.add_argument("-b", "--bitrate", default=4000000,
help="Set the encoding bitrate ", type=int)
parser.add_argument("--rtsp-ts", action="store_true", default=False, dest='rtsp_ts', help="Attach NTP timestamp from RTSP source",
)
# Check input arguments
if len(sys.argv)==1:
parser.print_help(sys.stderr)
Expand All @@ -403,10 +396,12 @@ def parse_args():
global bitrate
global stream_path
global gie
global ts_from_rtsp
gie = args.gie
codec = args.codec
bitrate = args.bitrate
stream_path = args.input
ts_from_rtsp = args.rtsp_ts
return stream_path

if __name__ == '__main__':
Expand Down
3 changes: 1 addition & 2 deletions apps/deepstream-segmask/README
Original file line number Diff line number Diff line change
Expand Up @@ -16,8 +16,7 @@
################################################################################

Prerequisites:
- DeepStreamSDK 6.2
- Python 3.8
- DeepStreamSDK 6.3
- Gst-python
- NumPy package
- OpenCV package
Expand Down
2 changes: 1 addition & 1 deletion apps/deepstream-segmentation/README
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
################################################################################

Prerequisites:
- DeepStreamSDK 6.2
- DeepStreamSDK 6.3
- Python 3.8
- Gst-python
- NumPy package
Expand Down
2 changes: 1 addition & 1 deletion apps/deepstream-ssd-parser/README
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
################################################################################

Prequisites:
- DeepStreamSDK 6.2
- DeepStreamSDK 6.3
- NVIDIA Triton Inference Server
- Python 3.8
- Gst-python
Expand Down
Loading

0 comments on commit 8178b5e

Please sign in to comment.