Skip to content

Commit 2957912

Browse files
authored
Merge pull request #1302 from prominenceai/v0.31.b.alpha
v0.31.b.alpha
2 parents e38116a + b0ec396 commit 2957912

24 files changed

+1739
-115
lines changed

Makefile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -39,7 +39,7 @@ else
3939
endif
4040

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

4444
GLIB_VERSION:=2.0
4545
GSTREAMER_VERSION:=1.0

Release Notes/dsl-releases.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,7 @@
22

33
| Release | Date |
44
| ----------------------------------------------------------- | ----------- |
5+
| [v0.31.b.alpha (patch)](/Release%20Notes/v0.31.b.alpha.md) | 11/02/2024 |
56
| [v0.31.a.alpha (patch)](/Release%20Notes/v0.31.a.alpha.md) | 09/16/2024 |
67
| [v0.31.alpha](/Release%20Notes/v0.3`.alpha.md) | 09/04/2024 |
78
| [v0.30.b.alpha (patch)](/Release%20Notes/v0.30.b.alpha.md) | 08/28/2024 |

Release Notes/v0.31.b.alpha.md

Lines changed: 20 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,20 @@
1+
# v0.31.b.alpha (patch) Release Notes
2+
**Important!**
3+
* `v0.31.b.alpha` is a **patch** release (patch `b` for the `v0.31.alpha` release).
4+
5+
## Purpose
6+
The purpose for this patch release:
7+
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.
8+
2. Update the "Add IoT Message Meta Action" to add the Trigger name to identify the source of the event.
9+
10+
## Issues-bugs closed in this release
11+
* 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)
12+
* 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)
13+
14+
## Issues-enhancements closed in this release
15+
* 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)
16+
* 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)
17+
18+
## New Examples in this release
19+
* [dynamically_update_inference_model.py](/examples/python/dynamically_update_inference_model.py)
20+
* [dynamically_update_inference_model.cpp](/examples/cpp/dynamically_update_inference_model.cpp)

docs/api-infer.md

Lines changed: 191 additions & 90 deletions
Large diffs are not rendered by default.

docs/api-reference-list.md

Lines changed: 6 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -30,6 +30,7 @@
3030
* [`dsl_sink_window_key_event_handler_cb`](/docs/api-sink.md#dsl_sink_window_key_event_handler_cb)
3131
* [`dsl_sink_window_button_event_handler_cb`](/docs/api-sink.md#dsl_sink_window_button_event_handler_cb)
3232
* [`dsl_sink_window_delete_event_handler_cb`](/docs/api-sink.md#dsl_sink_window_delete_event_handler_cb)
33+
* [`dsl_infer_gie_model_update_listener_cb`](/docs/api-infer.md#dsl_infer_gie_model_update_listener_cb)
3334

3435
## DSL Services API:
3536
* [`dsl_main_loop_run`](/docs/overview.md#main-loop-context)
@@ -308,13 +309,15 @@
308309
* [`dsl_infer_gie_secondary_new`](/docs/api-infer.md#dsl_infer_gie_secondary_new)
309310
* [`dsl_infer_tis_primary_new`](/docs/api-infer.md#dsl_infer_tis_primary_new)
310311
* [`dsl_infer_tis_secondary_new`](/docs/api-infer.md#dsl_infer_tis_secondary_new)
311-
* [`dsl_infer_batch_size_get`](/docs/api-infer.md#dsl_infer_batch_size_get)
312-
* [`dsl_infer_batch_size_set`](/docs/api-infer.md#dsl_infer_batch_size_set)
313-
* [`dsl_infer_unique_id_get`](/docs/api-infer.md#dsl_infer_unique_id_get)
314312
* [`dsl_infer_gie_model_engine_file_get`](/docs/api-infer.md#dsl_infer_gie_model_engine_file_get)
315313
* [`dsl_infer_gie_model_engine_file_set`](/docs/api-infer.md#dsl_infer_gie_model_engine_file_set)
314+
* [`dsl_infer_gie_model_update_listener_add`](/docs/api-infer.md#dsl_infer_gie_model_update_listener_add)
315+
* [`dsl_infer_gie_model_update_listener_remove`](/docs/api-infer.md#dsl_infer_gie_model_update_listener_remove)
316316
* [`dsl_infer_gie_tensor_meta_settings_get`](/docs/api-infer.md#dsl_infer_gie_tensor_meta_settings_get)
317317
* [`dsl_infer_gie_tensor_meta_settings_set`](/docs/api-infer.md#dsl_infer_gie_tensor_meta_settings_set)
318+
* [`dsl_infer_batch_size_get`](/docs/api-infer.md#dsl_infer_batch_size_get)
319+
* [`dsl_infer_batch_size_set`](/docs/api-infer.md#dsl_infer_batch_size_set)
320+
* [`dsl_infer_unique_id_get`](/docs/api-infer.md#dsl_infer_unique_id_get)
318321
* [`dsl_infer_config_file_get`](/docs/api-infer.md#dsl_infer_config_file_get)
319322
* [`dsl_infer_config_file_set`](/docs/api-infer.md#dsl_infer_config_file_set)
320323
* [`dsl_infer_interval_get`](/docs/api-infer.md#dsl_infer_interval_get)

docs/examples-basic-pipelines.md

Lines changed: 28 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4,6 +4,7 @@ This page documents the following "Basic Inference Pipelines" consiting of
44
* [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)
55
* [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)
66
* [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)
7+
* [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)
78
* [RTSP Source, Primary GIE, IOU Tracker, OSD, EGL Window Sink](#rtsp-source-primary-gie-iou-tracker-osd-egl-window-sink)
89
* [HTTP Source, Primary GIE, IOU Tracker, OSD, EGL Window Sink](#http-source-primary-gie-iou-tracker-osd-egl-window-sink)
910
* [File Source, Preprocessor, Primary GIE, IOU Tracker, OSD, EGL Window Sink](#file-source-preprocessor-primary-gie-iou-tracker-osd-egl-window-sink)
@@ -139,6 +140,33 @@ This page documents the following "Basic Inference Pipelines" consiting of
139140

140141
---
141142

143+
### File Source, Primary GIE, DCF Tracker, 2 Secondary GIEs, OSD, EGL Windon Sink
144+
* [1file_pgie_dcf_tracker_2sgie_window.py](/examples/python/1file_pgie_dcf_tracker_2sgie_window.py)
145+
* [1file_pgie_dcf_tracker_2sgie_window.cpp](/examples/cpp/1file_pgie_dcf_tracker_2sgie_window.cpp)
146+
147+
```python
148+
#
149+
# The simple example demonstrates how to create a set of Pipeline components,
150+
# specifically:
151+
# - File Source
152+
# - Primary GST Inference Engine (PGIE)
153+
# - DCF Tracker
154+
# - 2 Secondary GST Inference Engines (SGIEs)
155+
# - On-Screen Display (OSD)
156+
# - Window Sink
157+
# ...and how to add them to a new Pipeline and play
158+
#
159+
# The example registers handler callback functions with the Pipeline for:
160+
# - key-release events
161+
# - delete-window events
162+
# - end-of-stream EOS events
163+
# - Pipeline change-of-state events
164+
#
165+
```
166+
<br>
167+
168+
---
169+
142170
### RTSP Source, Primary GIE, IOU Tracker, OSD, EGL Window Sink
143171

144172
* [`1rtsp_pgie_dcf_tracker_osd_window.py`](/examples/python/1rtsp_pgie_dcf_tracker_osd_window.py)

docs/examples-dynamic-pipelines.md

Lines changed: 49 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,12 +1,61 @@
11
# Dynamic Pipelines
22
This page documents the following examples:
3+
* [Dynamically Update Inference Model Engine File](#dynamically-update-inference-model-engine-file)
34
* [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)
45
* [Dynamically Move a Branch from One Demuxer Stream to Another](#dynamically-move-a-branch-from-one-demuxer-stream-to-another)
56

67
<br>
78

89
---
910

11+
### Dynamically Update Inference Model Engine File
12+
* [dynamically_update_inference_model.py](/examples/python/dynamically_update_inference_model.py)
13+
* [dynamically_update_inference_model.cpp](/examples/cpp/dynamically_update_inference_model.cpp)
14+
15+
```python
16+
#
17+
# The simple example demonstrates how to create a set of Pipeline components,
18+
# specifically:
19+
# - File Source
20+
# - Primary GST Inference Engine (PGIE)
21+
# - DCF Tracker
22+
# - Secondary GST Inference Engines (SGIEs)
23+
# - On-Screen Display (OSD)
24+
# - Window Sink
25+
# ...and how to dynamically update an Inference Engine's config and model files.
26+
#
27+
# The key-release handler function will dynamically update the Secondary
28+
# Inference Engine's config-file on the key value as follows.
29+
#
30+
# "1" = '../../test/config/config_infer_secondary_vehicletypes.yml'
31+
# "2" = '../../test/config/config_infer_secondary_vehiclemake.yml'
32+
#
33+
# The new model engine is loaded by the SGIE asynchronously. a client listener
34+
# (callback) function is added to the SGIE to be notified when the loading is
35+
# complete. See the "model_update_listener" function defined below.
36+
#
37+
# IMPORTANT! it is best to allow the config file to specify the model engine
38+
# file when updating both the config and model. Set the model_engine_file
39+
# parameter to None when creating the Inference component.
40+
#
41+
# retval = dsl_infer_gie_secondary_new(L"secondary-gie",
42+
# secondary_infer_config_file_1.c_str(), NULL, L"primary-gie", 0);
43+
#
44+
# The Config files used are located under /deepstream-services-library/test/config
45+
# The files reference models created with the file
46+
# /deepstream-services-library/make_trafficcamnet_engine_files.py
47+
#
48+
# The example registers handler callback functions with the Pipeline for:
49+
# - key-release events
50+
# - delete-window events
51+
# - end-of-stream EOS events
52+
# - Pipeline change-of-state events#
53+
#
54+
```
55+
<br>
56+
57+
---
58+
1059
### Dynamically Add/Remove Sources to/from a Pipeline with a Tiler and Window Sink
1160

1261
* [`dynamically_add_remove_sources_with_tiler_window_sink.py`](/examples/python/dynamically_add_remove_sources_with_tiler_window_sink.py)

dsl.py

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -562,6 +562,10 @@ class dsl_threshold_value(Structure):
562562
DSL_COMPONENT_QUEUE_UNDERRUN_LISTENER = \
563563
CFUNCTYPE(None, c_wchar_p, c_void_p)
564564

565+
#dsl_infer_gie_model_update_listener_cb
566+
DSL_INFER_GIE_MODEL_UPDATE_LISTENER = \
567+
CFUNCTYPE(None, c_wchar_p, c_wchar_p, c_void_p)
568+
565569
##
566570
## TODO: CTYPES callback management needs to be completed before any of
567571
## the callback remove wrapper functions will work correctly.
@@ -5124,6 +5128,35 @@ def dsl_infer_raw_output_enabled_set(name, enabled, path):
51245128
result = _dsl.dsl_infer_raw_output_enabled_set(name, enabled, path)
51255129
return int(result)
51265130

5131+
##
5132+
## dsl_infer_gie_model_update_listener_add()
5133+
##
5134+
_dsl.dsl_infer_gie_model_update_listener_add.argtypes = [c_wchar_p,
5135+
DSL_INFER_GIE_MODEL_UPDATE_LISTENER, c_void_p]
5136+
_dsl.dsl_infer_gie_model_update_listener_add.restype = c_uint
5137+
def dsl_infer_gie_model_update_listener_add(name, listener, client_data):
5138+
global _dsl
5139+
c_listener = DSL_INFER_GIE_MODEL_UPDATE_LISTENER(listener)
5140+
callbacks.append(c_listener)
5141+
c_client_data=cast(pointer(py_object(client_data)), c_void_p)
5142+
clientdata.append(c_client_data)
5143+
result = _dsl.dsl_infer_gie_model_update_listener_add(name,
5144+
c_listener, c_client_data)
5145+
return int(result)
5146+
5147+
##
5148+
## dsl_infer_gie_model_update_listener_remove()
5149+
##
5150+
_dsl.dsl_infer_gie_model_update_listener_remove.argtypes = [c_wchar_p,
5151+
DSL_INFER_GIE_MODEL_UPDATE_LISTENER]
5152+
_dsl.dsl_infer_gie_model_update_listener_remove.restype = c_uint
5153+
def dsl_infer_gie_model_update_listener_remove(name, listener):
5154+
global _dsl
5155+
c_listener = DSL_INFER_GIE_MODEL_UPDATE_LISTENER(listener)
5156+
result = _dsl.dsl_infer_gie_model_update_listener_remove(name, c_listener)
5157+
return int(result)
5158+
5159+
51275160
##
51285161
## dsl_tracker_new()
51295162
##

0 commit comments

Comments
 (0)