Skip to content

Commit

Permalink
Merge pull request #1302 from prominenceai/v0.31.b.alpha
Browse files Browse the repository at this point in the history
v0.31.b.alpha
  • Loading branch information
rjhowell44 authored Nov 2, 2024
2 parents e38116a + b0ec396 commit 2957912
Show file tree
Hide file tree
Showing 24 changed files with 1,739 additions and 115 deletions.
2 changes: 1 addition & 1 deletion Makefile
Original file line number Diff line number Diff line change
Expand Up @@ -39,7 +39,7 @@ else
endif

CXX_VERSION:=c++17
DSL_VERSION:='L"v0.31.a.alpha"'
DSL_VERSION:='L"v0.31.b.alpha"'

GLIB_VERSION:=2.0
GSTREAMER_VERSION:=1.0
Expand Down
1 change: 1 addition & 0 deletions Release Notes/dsl-releases.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@

| Release | Date |
| ----------------------------------------------------------- | ----------- |
| [v0.31.b.alpha (patch)](/Release%20Notes/v0.31.b.alpha.md) | 11/02/2024 |
| [v0.31.a.alpha (patch)](/Release%20Notes/v0.31.a.alpha.md) | 09/16/2024 |
| [v0.31.alpha](/Release%20Notes/v0.3`.alpha.md) | 09/04/2024 |
| [v0.30.b.alpha (patch)](/Release%20Notes/v0.30.b.alpha.md) | 08/28/2024 |
Expand Down
20 changes: 20 additions & 0 deletions Release Notes/v0.31.b.alpha.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,20 @@
# v0.31.b.alpha (patch) Release Notes
**Important!**
* `v0.31.b.alpha` is a **patch** release (patch `b` for the `v0.31.alpha` release).

## Purpose
The purpose for this patch release:
1. Remove the invalid guard preventing dynamic ["on-the-fly"](https://docs.nvidia.com/metropolis/deepstream/dev-guide/text/DS_on_the_fly_model.html) model engine updates. Support dynamicl model engine updates with a new "update-complete" listener callback function.
2. Update the "Add IoT Message Meta Action" to add the Trigger name to identify the source of the event.

## Issues-bugs closed in this release
* The GIE and TIS "config-file-path" and "model-engine-file" properties should be writable in any state [#1295](https://github.com/prominenceai/deepstream-services-library/issues/1295)
* Add IoT Message Meta Action must add the Trigger Name in the NvDsEventMsgMeta to identify the event source. [#1298](https://github.com/prominenceai/deepstream-services-library/issues/1298)

## Issues-enhancements closed in this release
* Implement dsl_infer_gie_model_update_listener_add/remove services for async model update notifications [#1297](https://github.com/prominenceai/deepstream-services-library/issues/1297)
* Implement new dynamic "on-the-fly" model-engine update examples using new update-listener callback services. [#1299](https://github.com/prominenceai/deepstream-services-library/issues/1297)

## New Examples in this release
* [dynamically_update_inference_model.py](/examples/python/dynamically_update_inference_model.py)
* [dynamically_update_inference_model.cpp](/examples/cpp/dynamically_update_inference_model.cpp)
281 changes: 191 additions & 90 deletions docs/api-infer.md

Large diffs are not rendered by default.

9 changes: 6 additions & 3 deletions docs/api-reference-list.md
Original file line number Diff line number Diff line change
Expand Up @@ -30,6 +30,7 @@
* [`dsl_sink_window_key_event_handler_cb`](/docs/api-sink.md#dsl_sink_window_key_event_handler_cb)
* [`dsl_sink_window_button_event_handler_cb`](/docs/api-sink.md#dsl_sink_window_button_event_handler_cb)
* [`dsl_sink_window_delete_event_handler_cb`](/docs/api-sink.md#dsl_sink_window_delete_event_handler_cb)
* [`dsl_infer_gie_model_update_listener_cb`](/docs/api-infer.md#dsl_infer_gie_model_update_listener_cb)

## DSL Services API:
* [`dsl_main_loop_run`](/docs/overview.md#main-loop-context)
Expand Down Expand Up @@ -308,13 +309,15 @@
* [`dsl_infer_gie_secondary_new`](/docs/api-infer.md#dsl_infer_gie_secondary_new)
* [`dsl_infer_tis_primary_new`](/docs/api-infer.md#dsl_infer_tis_primary_new)
* [`dsl_infer_tis_secondary_new`](/docs/api-infer.md#dsl_infer_tis_secondary_new)
* [`dsl_infer_batch_size_get`](/docs/api-infer.md#dsl_infer_batch_size_get)
* [`dsl_infer_batch_size_set`](/docs/api-infer.md#dsl_infer_batch_size_set)
* [`dsl_infer_unique_id_get`](/docs/api-infer.md#dsl_infer_unique_id_get)
* [`dsl_infer_gie_model_engine_file_get`](/docs/api-infer.md#dsl_infer_gie_model_engine_file_get)
* [`dsl_infer_gie_model_engine_file_set`](/docs/api-infer.md#dsl_infer_gie_model_engine_file_set)
* [`dsl_infer_gie_model_update_listener_add`](/docs/api-infer.md#dsl_infer_gie_model_update_listener_add)
* [`dsl_infer_gie_model_update_listener_remove`](/docs/api-infer.md#dsl_infer_gie_model_update_listener_remove)
* [`dsl_infer_gie_tensor_meta_settings_get`](/docs/api-infer.md#dsl_infer_gie_tensor_meta_settings_get)
* [`dsl_infer_gie_tensor_meta_settings_set`](/docs/api-infer.md#dsl_infer_gie_tensor_meta_settings_set)
* [`dsl_infer_batch_size_get`](/docs/api-infer.md#dsl_infer_batch_size_get)
* [`dsl_infer_batch_size_set`](/docs/api-infer.md#dsl_infer_batch_size_set)
* [`dsl_infer_unique_id_get`](/docs/api-infer.md#dsl_infer_unique_id_get)
* [`dsl_infer_config_file_get`](/docs/api-infer.md#dsl_infer_config_file_get)
* [`dsl_infer_config_file_set`](/docs/api-infer.md#dsl_infer_config_file_set)
* [`dsl_infer_interval_get`](/docs/api-infer.md#dsl_infer_interval_get)
Expand Down
28 changes: 28 additions & 0 deletions docs/examples-basic-pipelines.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@ This page documents the following "Basic Inference Pipelines" consiting of
* [File Source, Primary GIE, IOU Tracker, OSD, EGL Window Sink, and File Sink](#file-source-primary-gie-iou-tracker-osd-egl-window-sink-and-file-sink)
* [File Source, Primary GIE, IOU Tracker, OSD, EGL Window Sink, and RTSP Sink](#file-source-primary-gie-iou-tracker-osd-egl-window-sink-and-rtsp-sink)
* [File Source, Primary GIE, IOU Tracker, OSD, EGL Window Sink, and V4L2 Sink](#file-source-primary-gie-iou-tracker-osd-egl-window-sink-and-v4l2-sink)
* [File Source, Primary GIE, DCF Tracker, 2 Secondary GIEs, OSD, EGL Windon Sink](#file-source-primary-gie-dcf-tracker-2-secondary-gies-osd-egl-windon-sink)
* [RTSP Source, Primary GIE, IOU Tracker, OSD, EGL Window Sink](#rtsp-source-primary-gie-iou-tracker-osd-egl-window-sink)
* [HTTP Source, Primary GIE, IOU Tracker, OSD, EGL Window Sink](#http-source-primary-gie-iou-tracker-osd-egl-window-sink)
* [File Source, Preprocessor, Primary GIE, IOU Tracker, OSD, EGL Window Sink](#file-source-preprocessor-primary-gie-iou-tracker-osd-egl-window-sink)
Expand Down Expand Up @@ -139,6 +140,33 @@ This page documents the following "Basic Inference Pipelines" consiting of

---

### File Source, Primary GIE, DCF Tracker, 2 Secondary GIEs, OSD, EGL Windon Sink
* [1file_pgie_dcf_tracker_2sgie_window.py](/examples/python/1file_pgie_dcf_tracker_2sgie_window.py)
* [1file_pgie_dcf_tracker_2sgie_window.cpp](/examples/cpp/1file_pgie_dcf_tracker_2sgie_window.cpp)

```python
#
# The simple example demonstrates how to create a set of Pipeline components,
# specifically:
# - File Source
# - Primary GST Inference Engine (PGIE)
# - DCF Tracker
# - 2 Secondary GST Inference Engines (SGIEs)
# - On-Screen Display (OSD)
# - Window Sink
# ...and how to add them to a new Pipeline and play
#
# The example registers handler callback functions with the Pipeline for:
# - key-release events
# - delete-window events
# - end-of-stream EOS events
# - Pipeline change-of-state events
#
```
<br>

---

### RTSP Source, Primary GIE, IOU Tracker, OSD, EGL Window Sink

* [`1rtsp_pgie_dcf_tracker_osd_window.py`](/examples/python/1rtsp_pgie_dcf_tracker_osd_window.py)
Expand Down
49 changes: 49 additions & 0 deletions docs/examples-dynamic-pipelines.md
Original file line number Diff line number Diff line change
@@ -1,12 +1,61 @@
# Dynamic Pipelines
This page documents the following examples:
* [Dynamically Update Inference Model Engine File](#dynamically-update-inference-model-engine-file)
* [Dynamically Add/Remove Sources to/from a Pipeline with a Tiler and Window Sink](#dynamically-addremove-sources-tofrom-a-pipeline-with-a-tiler-and-window-sink)
* [Dynamically Move a Branch from One Demuxer Stream to Another](#dynamically-move-a-branch-from-one-demuxer-stream-to-another)

<br>

---

### Dynamically Update Inference Model Engine File
* [dynamically_update_inference_model.py](/examples/python/dynamically_update_inference_model.py)
* [dynamically_update_inference_model.cpp](/examples/cpp/dynamically_update_inference_model.cpp)

```python
#
# The simple example demonstrates how to create a set of Pipeline components,
# specifically:
# - File Source
# - Primary GST Inference Engine (PGIE)
# - DCF Tracker
# - Secondary GST Inference Engines (SGIEs)
# - On-Screen Display (OSD)
# - Window Sink
# ...and how to dynamically update an Inference Engine's config and model files.
#
# The key-release handler function will dynamically update the Secondary
# Inference Engine's config-file on the key value as follows.
#
# "1" = '../../test/config/config_infer_secondary_vehicletypes.yml'
# "2" = '../../test/config/config_infer_secondary_vehiclemake.yml'
#
# The new model engine is loaded by the SGIE asynchronously. a client listener
# (callback) function is added to the SGIE to be notified when the loading is
# complete. See the "model_update_listener" function defined below.
#
# IMPORTANT! it is best to allow the config file to specify the model engine
# file when updating both the config and model. Set the model_engine_file
# parameter to None when creating the Inference component.
#
# retval = dsl_infer_gie_secondary_new(L"secondary-gie",
# secondary_infer_config_file_1.c_str(), NULL, L"primary-gie", 0);
#
# The Config files used are located under /deepstream-services-library/test/config
# The files reference models created with the file
# /deepstream-services-library/make_trafficcamnet_engine_files.py
#
# The example registers handler callback functions with the Pipeline for:
# - key-release events
# - delete-window events
# - end-of-stream EOS events
# - Pipeline change-of-state events#
#
```
<br>

---

### Dynamically Add/Remove Sources to/from a Pipeline with a Tiler and Window Sink

* [`dynamically_add_remove_sources_with_tiler_window_sink.py`](/examples/python/dynamically_add_remove_sources_with_tiler_window_sink.py)
Expand Down
33 changes: 33 additions & 0 deletions dsl.py
Original file line number Diff line number Diff line change
Expand Up @@ -562,6 +562,10 @@ class dsl_threshold_value(Structure):
DSL_COMPONENT_QUEUE_UNDERRUN_LISTENER = \
CFUNCTYPE(None, c_wchar_p, c_void_p)

#dsl_infer_gie_model_update_listener_cb
DSL_INFER_GIE_MODEL_UPDATE_LISTENER = \
CFUNCTYPE(None, c_wchar_p, c_wchar_p, c_void_p)

##
## TODO: CTYPES callback management needs to be completed before any of
## the callback remove wrapper functions will work correctly.
Expand Down Expand Up @@ -5124,6 +5128,35 @@ def dsl_infer_raw_output_enabled_set(name, enabled, path):
result = _dsl.dsl_infer_raw_output_enabled_set(name, enabled, path)
return int(result)

##
## dsl_infer_gie_model_update_listener_add()
##
_dsl.dsl_infer_gie_model_update_listener_add.argtypes = [c_wchar_p,
DSL_INFER_GIE_MODEL_UPDATE_LISTENER, c_void_p]
_dsl.dsl_infer_gie_model_update_listener_add.restype = c_uint
def dsl_infer_gie_model_update_listener_add(name, listener, client_data):
global _dsl
c_listener = DSL_INFER_GIE_MODEL_UPDATE_LISTENER(listener)
callbacks.append(c_listener)
c_client_data=cast(pointer(py_object(client_data)), c_void_p)
clientdata.append(c_client_data)
result = _dsl.dsl_infer_gie_model_update_listener_add(name,
c_listener, c_client_data)
return int(result)

##
## dsl_infer_gie_model_update_listener_remove()
##
_dsl.dsl_infer_gie_model_update_listener_remove.argtypes = [c_wchar_p,
DSL_INFER_GIE_MODEL_UPDATE_LISTENER]
_dsl.dsl_infer_gie_model_update_listener_remove.restype = c_uint
def dsl_infer_gie_model_update_listener_remove(name, listener):
global _dsl
c_listener = DSL_INFER_GIE_MODEL_UPDATE_LISTENER(listener)
result = _dsl.dsl_infer_gie_model_update_listener_remove(name, c_listener)
return int(result)


##
## dsl_tracker_new()
##
Expand Down
Loading

0 comments on commit 2957912

Please sign in to comment.