Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
The table of contents is too big for display.
Diff view
Diff view
  •  
  •  
  •  
6 changes: 6 additions & 0 deletions .gitmodules
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
[submodule "src/apps/tao_apps/apps/tao_others/deepstream-nvocdr-app/nvocdr"]
path = src/apps/tao_apps/apps/tao_others/deepstream-nvocdr-app/nvocdr
url = https://github.com/NVIDIA-AI-IOT/NVIDIA-Optical-Character-Detection-and-Recognition-Solution.git
[submodule "src/apps/tao_apps/apps/tao_others/deepstream_custom_preprocessing_app/modules/Lidar_AI_Solution"]
path = src/apps/tao_apps/apps/tao_others/deepstream_custom_preprocessing_app/modules/Lidar_AI_Solution
url = https://github.com/NVIDIA-AI-IOT/Lidar_AI_Solution.git
4 changes: 4 additions & 0 deletions src/apps/reference_apps/.gitattributes
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
deepstream_parallel_inference_app/tritonserver/models/bodypose2d/1/model.onnx filter=lfs diff=lfs merge=lfs -text
deepstream_parallel_inference_app/tritonserver/models/yolov4/1/yolov4_-1_3_416_416_dynamic.onnx.nms.onnx filter=lfs diff=lfs merge=lfs -text
deepstream-tracker-3d-multi-view/assets/datasets.zip filter=lfs diff=lfs merge=lfs -text
deepstream-bodypose-3d/streams/bodypose.mp4 filter=lfs diff=lfs merge=lfs -text
16 changes: 16 additions & 0 deletions src/apps/reference_apps/LICENSE
Original file line number Diff line number Diff line change
@@ -0,0 +1,16 @@
Apache2.0 License

Copyright (c) 2018-2023, NVIDIA CORPORATION. All rights reserved.

Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at

http://www.apache.org/licenses/LICENSE-2.0

Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.

48 changes: 48 additions & 0 deletions src/apps/reference_apps/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,48 @@
# Reference Apps using DeepStream 9.0

This repository contains the reference applications for video analytics tasks using TensorRT and DeepSTream SDK 9.0.

## Getting Started ##
We currently provide three different reference applications:

Preferably copy all the apps from reference_apps dir to
`/opt/nvidia/deepstream/deepstream/sources/apps/sample_apps/`

To clone the project in the above directory, sudo permission may be required.

For further details, please see each project's README.

### Anomaly Detection : [README](anomaly/README.md) ###
The project contains auxiliary dsdirection plugin to show the capability of DeepstreamSDK in anomaly detection.
![sample anomaly output](anomaly/.opticalflow.png)
### Runtime Source Addition Deletion: [README](runtime_source_add_delete/README.md) ###
The project demonstrates addition and deletion of video sources in a live Deepstream pipeline.
### MaskTracker: [README](deepstream-masktracker/README.md) ###
This sample app demonstrates DeepStream MaskTracker for multi-object tracking and segmentation using SAM2.
![sample MaskTracker output](deepstream-masktracker/figures/.retail_osd.gif)
### Single-View 3D Tracking: [README](deepstream-tracker-3d/README.md) ###
The sample app demonstrates single-view 3D tracking with DeepStream multi-object tracking to reconstruct 3D human model in world coordinates under occlusion.
![sample 3D tracking output](deepstream-tracker-3d/figures/.retail_viz.png)
### Multi-View 3D Tracking: [README](deepstream-tracker-3d-multi-view) ###
The samples demonstrate multi-view 3D tracking in DeepStream, a distributed, real-time framework designed for large-scale, calibrated camera networks.

<img src="deepstream-tracker-3d-multi-view/figures/4cam_osd.png" alt="sample mulit-view 3D tracking output" width="684"> <img src="deepstream-tracker-3d-multi-view/figures/4cam_bev_fused.png" alt="sample BEV output from multi-view 3D tracking" width="383">
### Parallel Multiple Models Inferencing: [README](deepstream_parallel_inference_app/README.md) ###
The project demonstrate how to implement multiple models inferencing in parallel with DeepStream APIs.
### Bodypose 3D Model Inferencing: [README](deepstream-bodypose-3d/README.md) ###
The sample demonstrate how to customize the multiple input layers model preprocessing and the customization of the bodypose 3D model postprocessing.
![Bodypose 3D sample output](deepstream-bodypose-3d/sources/.screenshot.png)
### Video Buffers sharing between pipelines through IPC: [README](deepstream-ipc-test-sr/README.md) ###
This sample demonstrates how to share video buffers over IPC and how to change output video buffers.
### Multiple Dynamic Sources with Single Decoder:[README](deepstream-dynamicsrcbin-test/README) ###
The sample demonstrates the usage of nvdsdynamicsrcbin in DeepStream pipeline.It helps to construct the application of multiple dynamic sources with a single video decoder to adapt to the high decoder throughput scenarios.
### Custom Video Tiling Config: [README](deepstream-custom-tile-config/README.md) ###
This sample demonstrates the usage of "custom-tile-config" of nvmultistreamtiler to customize the tiling positions and sizes of multiple videos in batch.
### DeepStream VLLM Plugin: [README](deepstream-vllm-plugin/README.md) ###
A GStreamer plugin for NVIDIA DeepStream that integrates Vision-Language Models (VLM) using VLLM for real-time video understanding and analysis.

## Pyservicemaker Sample apps
The apps in pyservicemaker_sample_apps are additional samples demonstrating usage of the Python API for DeepStream Service Maker, either by flow API or by pipeline API. See the [Python Service Maker documentation](https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_service_maker_python.html) for details.

## Legacy DeepStream Reference Samples
Some old samples are not supported any more for different reasons. The legacy samples are moved to the legacy folder /legacy_apps.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added src/apps/reference_apps/anomaly/.opticalflow.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
6 changes: 6 additions & 0 deletions src/apps/reference_apps/anomaly/Makefile
Original file line number Diff line number Diff line change
@@ -0,0 +1,6 @@
all:
make -C apps/deepstream-anomaly-detection-test
make -C plugins/gst-dsdirection
%:
make -C apps/deepstream-anomaly-detection-test $@
make -C plugins/gst-dsdirection $@
80 changes: 80 additions & 0 deletions src/apps/reference_apps/anomaly/README.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,80 @@
# ANOMALY DETECTION REFERENCE APP USING DEEPSTREAMSDK 9.0

## Introduction
The project contains anomaly detection application and auxiliary plug-ins to show the
capability of Deepstream SDK.

## Prequisites:
DeepStream SDK installed which is available at http://developer.nvidia.com/deepstream-sdk
Please follow instructions in the `apps/sample_apps/deepstream-app/README` on how
to install the prequisites for Deepstream SDK apps.

## Getting Started

- Preferably clone the app in
`/opt/nvidia/deepstream/deepstream/sources/apps/sample_apps/`

- Edit the `dsanomaly_pgie_config.txt` or `dsanomaly_pgie_nvinferserver_config.txt` according to the location of the models to be used


## Compilation Steps for dsdirection plugin
```
$ cd plugins/gst-dsdirection/
$ sudo make && sudo make install
```

1. Test direction calculation on one video input, on dGPU, run following commands
```
cd /opt/nvidia/deepstream/deepstream/
gst-launch-1.0 filesrc location=samples/streams/sample_1080p_h264.mp4 ! qtdemux ! h264parse ! nvv4l2decoder ! m.sink_0 \
nvstreammux name=m batch-size=1 width=1920 height=1080 ! nvinfer config-file-path=samples/configs/deepstream-app/config_infer_primary.txt \
! nvof ! tee name=t ! queue ! nvofvisual ! nvmultistreamtiler width=1920 height=1080 ! nveglglessink t. ! queue ! dsdirection ! \
nvmultistreamtiler width=1920 height=1080 ! nvvideoconvert ! nvdsosd ! nveglglessink
```
2. Test direction calculation on one video input, on Jetson, run following commands
```
cd /opt/nvidia/deepstream/deepstream/
gst-launch-1.0 filesrc location=samples/streams/sample_1080p_h264.mp4 ! qtdemux ! h264parse ! nvv4l2decoder ! m.sink_0 \
nvstreammux name=m batch-size=1 width=1280 height=720 ! nvinfer config-file-path=samples/configs/deepstream-app/config_infer_primary.txt \
! nvof ! tee name=t ! queue ! nvofvisual ! nvmultistreamtiler width=1920 height=1080 ! nv3dsink sync=0 t. ! queue ! dsdirection ! \
nvmultistreamtiler width=1920 height=1080 ! nvvideoconvert ! nvdsosd ! nv3dsink sync=0
```

3. Test direction calculation using optical flow on two video inputs on dGPU, run following commands
```
cd /opt/nvidia/deepstream/deepstream/
gst-launch-1.0 filesrc location=samples/streams/sample_1080p_h264.mp4 ! qtdemux ! h264parse ! nvv4l2decoder ! m.sink_0 \
nvstreammux name=m batch-size=2 width=1920 height=1080 ! nvinfer config-file-path=samples/configs/deepstream-app/config_infer_primary.txt ! \
nvof ! tee name=t ! queue ! nvofvisual ! nvmultistreamtiler width=1920 height=540 ! nveglglessink t. ! queue ! dsdirection ! \
nvmultistreamtiler width=1920 height=540 ! nvvideoconvert ! nvdsosd ! nveglglessink filesrc location=samples/streams/sample_1080p_h264.mp4 ! \
qtdemux ! h264parse ! nvv4l2decoder ! m.sink_1 --gst-debug=3

```
Anomaly detection app pipeline:
![DS Anomaly Detection Pipeline](.dsdirection_pipeline.png)

## Compilation Steps and Execution:
```
$ cd sources/apps/sample_apps/deepstream_reference_apps/anomaly/
$ cd apps/deepstream-anomaly-detection-test/
$ Set CUDA_VER in the MakeFile as per platform.
For x86, CUDA_VER=13.1
For jetson, CUDA_VER=13.0
$ sudo make

$ ./deepstream-anomaly-detection-app <uri1> [uri2] ... [uriN]
Ex.: ./deepstream-anomaly-detection-app file:///opt/nvidia/deepstream/deepstream/samples/streams/sample_1080p_h264.mp4

Use option "-t inferserver" to select nvinferserver as the inference plugin
$ ./deepstream-anomaly-detection-app -t inferserver <uri1> [uri2] ... [uriN]
Ex.: ./deepstream-anomaly-detection-app -t inferserver file:///opt/nvidia/deepstream/deepstream/samples/streams/sample_1080p_h264.mp4
```
The result should be like below:
![DS Anomaly Detection Screenshot](.opticalflow.png)

## NOTE:
- Minimum supported resolution: DGPU - 160 x 64, Jetson - 256 x 96
- Due to an issue in nvofvisual plugin, when using nvofvisual along with nvof
plugin, the width of input to nvof should be multiple of 32 on DGPU and multiple
of 256 on Jetson. This will be fixed in the nvofvisual plugin in the next DeepStream
release.
Original file line number Diff line number Diff line change
@@ -0,0 +1,62 @@
################################################################################
# SPDX-FileCopyrightText: Copyright (c) 2020-2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
# SPDX-License-Identifier: Apache-2.0
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
# http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.
################################################################################

CUDA_VER?=
ifeq ($(CUDA_VER),)
$(error "CUDA_VER is not set")
endif

APP:= deepstream-anomaly-detection-app


DS_SDK_ROOT:=/opt/nvidia/deepstream/deepstream

LIB_INSTALL_DIR?=$(DS_SDK_ROOT)/lib/
APP_INSTALL_DIR?=$(DS_SDK_ROOT)/bin/

SRCS:= $(wildcard *.c)

INCS:= $(wildcard *.h)

PKGS:= gstreamer-1.0

OBJS:= $(SRCS:.c=.o)

CFLAGS+= -I$(DS_SDK_ROOT)/sources/includes \
-I /usr/local/cuda-$(CUDA_VER)/include

CFLAGS+= `pkg-config --cflags $(PKGS)`

LIBS:= `pkg-config --libs $(PKGS)`

LIBS+= -L$(LIB_INSTALL_DIR) -lnvdsgst_meta -lnvds_meta -lnvdsgst_helper -lm \
-L/usr/local/cuda-$(CUDA_VER)/lib64/ -lcudart \
-lcuda -Wl,-rpath,$(LIB_INSTALL_DIR)

all: $(APP)

%.o: %.c $(INCS) Makefile
$(CC) -c -o $@ $(CFLAGS) $<

$(APP): $(OBJS) Makefile
$(CC) -o $(APP) $(OBJS) $(LIBS)

clean:
rm -rf $(OBJS) $(APP)

install: $(APP)
cp -rv $(APP) $(APP_INSTALL_DIR)
Loading