Skip to content

Commit

Permalink
Update to 1.0.3 release
Browse files Browse the repository at this point in the history
- Adding runtime_source_add_delete app
- Minor fixes for typos
  • Loading branch information
nv-zhliu committed Jun 9, 2021
1 parent 46bfd6b commit 6aabcaf
Show file tree
Hide file tree
Showing 14 changed files with 1,123 additions and 18 deletions.
2 changes: 1 addition & 1 deletion HOWTO.md
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ See [sample applications](apps/) main functions for pipeline construction exampl
<a name="metadata_access"></a>
## MetaData Access

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/plugin-manual/index.html#page/DeepStream_Plugin_Manual%2Fdeepstream_plugin_metadata.03.1.html) and [API Guide](https://docs.nvidia.com/metropolis/deepstream/python-api/index.html).
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).

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.

Expand Down
10 changes: 3 additions & 7 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -43,19 +43,15 @@ We currently provide the following sample applications:
* [deepstream-test4](apps/deepstream-test4) -- msgbroker for sending analytics results to the cloud
* [deepstream-imagedata-multistream](apps/deepstream-imagedata-multistream) -- multi-stream pipeline with access to image buffers
* [deepstream-ssd-parser](apps/deepstream-ssd-parser) -- SSD model inference via Triton server with output parsing in Python
* [deepstream-test1-usbcam](apps/deepstream-test1-usbcam) -- deepstream-test1 pipeline with USB camera input
* [deepstream-test1-usbcam](apps/deepstream-test1-usbcam) -- deepstream-test1 pipelien with USB camera input
* [deepstream-test1-rtsp-out](apps/deepstream-test1-rtsp-out) -- deepstream-test1 pipeline with RTSP output
* [deepstream-opticalflow](apps/deepstream-opticalflow) -- optical flow and visualization pipeline with flow vectors returned in NumPy array
* [deepstream-segmentation](apps/deepstream-segmentation) -- segmentation and visualization pipeline with segmentation mask returned in NumPy array
* [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

Of these applications, the following have been updated or added in this release:
* deepstream-test2: added option to enable output of past frame tracking data
* deepstream-test4: callback functions are registered only once to avoid race condition
* deepstream-imagedata-multistream: the probe function now modifies images in-place in addition to saving copies of them
* deepstream-opticalflow: new sample application to demonstrate optical flow functionality
* deepstream-segmentation: new sample application to demonstrate segmentation functionality
* deepstream-nvdsnalaytics: new sample application to demonstrate analytics functionality
* runtime_source_add_delete -- add/delete source streams at runtime

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

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -213,9 +213,6 @@ def decodebin_child_added(child_proxy, Object, name, user_data):
print("Decodebin child added:", name, "\n")
if name.find("decodebin") != -1:
Object.connect("child-added", decodebin_child_added, user_data)
if is_aarch64() and name.find("nvv4l2decoder") != -1:
print("Seting bufapi_version\n")
Object.set_property("bufapi-version", True)


def create_source_bin(index, uri):
Expand Down
5 changes: 1 addition & 4 deletions apps/deepstream-nvdsanalytics/deepstream_nvdsanalytics.py
Original file line number Diff line number Diff line change
Expand Up @@ -183,10 +183,7 @@ def cb_newpad(decodebin, decoder_src_pad,data):
def decodebin_child_added(child_proxy,Object,name,user_data):
print("Decodebin child added:", name, "\n")
if(name.find("decodebin") != -1):
Object.connect("child-added",decodebin_child_added,user_data)
if(is_aarch64() and name.find("nvv4l2decoder") != -1):
print("Seting bufapi_version\n")
Object.set_property("bufapi-version",True)
Object.connect("child-added",decodebin_child_added,user_data)

def create_source_bin(index,uri):
print("Creating source bin")
Expand Down
4 changes: 2 additions & 2 deletions apps/deepstream-opticalflow/deepstream-opticalflow.py
Original file line number Diff line number Diff line change
Expand Up @@ -88,7 +88,7 @@ def ofvisual_queue_src_pad_buffer_probe(pad, info, u_data):
# The casting also keeps ownership of the underlying memory
# in the C code, so the Python garbage collector will leave
# it alone.
frame_meta = pyds.glist_get_nvds_frame_meta(l_frame.data)
frame_meta = pyds.NvDsFrameMeta.cast(l_frame.data)
except StopIteration:
break

Expand Down Expand Up @@ -200,7 +200,7 @@ def create_source_bin(index, uri):
def main(args):
# Check input arguments
if len(args) < 2:
sys.stderr.write("usage: %s <uri1> [uri2] ... [uriN]\n" % args[0])
sys.stderr.write("usage: %s <uri1> [uri2] ... [uriN] <output_folder>\n" % args[0])
sys.exit(1)

number_sources = len(args) - 2
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 @@ -34,7 +34,7 @@ For x86_64 and Jetson Docker:
be sure to prepare the detector models.
2. Run the docker with this Python Bindings directory mapped
3. Install required Python packages inside the container:
$ apt install
$ apt update
$ apt install python3-gi python3-dev python3-gst-1.0 python3-numpy -y

For Jetson without Docker:
Expand Down
66 changes: 66 additions & 0 deletions apps/runtime_source_add_delete/README
Original file line number Diff line number Diff line change
@@ -0,0 +1,66 @@
################################################################################
# Copyright (c) 2021, NVIDIA CORPORATION. All rights reserved.
#
# Permission is hereby granted, free of charge, to any person obtaining a
# copy of this software and associated documentation files (the "Software"),
# to deal in the Software without restriction, including without limitation
# the rights to use, copy, modify, merge, publish, distribute, sublicense,
# and/or sell copies of the Software, and to permit persons to whom the
# Software is furnished to do so, subject to the following conditions:
#
# The above copyright notice and this permission notice shall be included in
# all copies or substantial portions of the Software.
#
# THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
# IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
# FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL
# THE AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
# LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING
# FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER
# DEALINGS IN THE SOFTWARE.
################################################################################

Prequisites:
- DeepStreamSDK 5.1
- Python 3.6
- Gst-python

To run the test app:
$ python3 deepstream-test-rt-src-add-del.py <uri>
e.g.
$ python3 deepstream_rt_src_add_del.py \
file:///opt/nvidia/deepstream/deepstream-5.1/samples/streams/sample_720p.mp4

This application demonstrates how to:
* Add and delete sources at runtime.
* Use a uridecodebin so that any type of input (e.g. RTSP/File), any GStreamer
supported container format, and any codec can be used as input.
* Configure the stream-muxer to generate a batch of frames and infer on the
batch for better resource utilization.
* Configure the tracker (referred to as nvtracker in this sample) using
config file dstest_tracker_config.txt

Refer to the deepstream-nvdsanalytics sample documentation for a description
of stream-muxer configuration, tracker configuration, and multi-stream tiling.

The sample generates the following pipeline for single source <uri>

uridecodebin -> nvstreammux -> nvinfer -> nvtracker -> nvtiler -> nvvideoconvert
-> nvdsosd -> displaysink

For reference, here are the config files used for this sample:
1. Primary inference engine: dstest_pgie_config.txt
2. First secondary inference engine: dstest_sgie1_config.txt
3. Second secondary inference engine: dstest_sgie2_config.txt
4. Third secondary inference engine: dstest_sgie3_config.txt

At runtime, after a timeout, a source will be added periodically. All the components
are reconfigured during addition/deletion. After reaching of `MAX_NUM_SOURCES`,
a random source is deleted periodically until a single source is present in the
pipeline. The app exits when End of Stream is reached for the final source or if
the last source is deleted.





Loading

0 comments on commit 6aabcaf

Please sign in to comment.