You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
- Add bindings for image data and tensor metadata.
- Add sample apps for image data usage, custom inference output parsing, USB camera source and RTSP output.
The Python apps and bindings are under the "python" directory.
46
48
Go into each app directory and follow instructions in the README.
@@ -56,7 +58,7 @@ See [sample applications](apps/) main functions for pipeline construction exampl
56
58
<aname="metadata_access"></a>
57
59
## MetaData Access
58
60
59
-
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/dev-guide/DeepStream_Development_Guide/baggage/group__metadata__structures.html).
61
+
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).
60
62
61
63
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. Find them in the release package with the following layout:
62
64
```
@@ -118,10 +120,12 @@ This will cause a memory buffer to be allocated, and the string "TYPE" will be c
118
120
This memory is owned by the C code and will be freed later. To free the buffer in Python code, use:
119
121
```pyds.free_buffer(obj.type)```
120
122
123
+
NOTE: NvOSD_TextParams.display_text string now gets freed automatically when a new string is assigned.
124
+
121
125
##### Reading String Fields
122
126
Directly reading a string field returns C address of the field in the form of an int, e.g.:
123
127
```python
124
-
obj = pyds.glist_get_nvds_vehicle_object(data);
128
+
obj = pyds.NvDsVehicleObject.cast(data);
125
129
print(obj.type)
126
130
```
127
131
This will print an int representing the address of obj.type in C (which is a char*).
Some MetaData instances are stored in GList form. To access the data in a GList node, the data field needs to be cast to the appropriate structure. This casting is done via binding functions:
140
+
Some MetaData instances are stored in GList form. To access the data in a GList node, the data field needs to be cast to the appropriate structure. This casting is done via cast() member function for the target type:
141
+
```python
142
+
NvDsBatchMeta.cast
143
+
NvDsFrameMeta.cast
144
+
NvDsObjectMeta.cast
145
+
NvDsUserMeta.cast
146
+
NvDsClassifierMeta.cast
147
+
NvDsDisplayMeta.cast
148
+
NvDsLabelInfo.cast
149
+
NvDsEventMsgMeta.cast
150
+
NvDsVehicleObject.cast
151
+
NvDsPersonObject.cast
152
+
```
153
+
154
+
In version v0.5, standalone cast functions were provided. Those are now deprecated and superseded by the cast() functions above:
@@ -193,3 +210,9 @@ These are performend on each object in deepstream_test_4.py, causing the aggrega
193
210
194
211
This function populates the input buffer with a timestamp generated according to RFC3339:
195
212
```%Y-%m-%dT%H:%M:%S.nnnZ\0```
213
+
214
+
<aname="imagedata_access"></a>
215
+
## Image Data Access
216
+
217
+
Decoded images are accessible as NumPy arrays via the `get_nvds_buf_surface` function. This function is documented in the [API Guide](https://docs.nvidia.com/metropolis/deepstream/5.0/python-api/index.html).
218
+
Please see the [deepstream-imagedata-multistream](apps/deepstream-imagedata-multistream) sample application for an example of image data usage.
Copy file name to clipboardExpand all lines: README.md
+9-7
Original file line number
Diff line number
Diff line change
@@ -2,8 +2,8 @@
2
2
3
3
This repository contains Python bindings and sample applications for the [DeepStream SDK](https://developer.nvidia.com/deepstream-sdk).
4
4
5
-
The bindings and apps are currently in *Alpha* at [v0.5](../..//releases/tag/v0.5-alpha). API changes are expected in future releases.
6
-
SDK version supported: 4.0.1
5
+
The bindings and apps are currently in *Alpha* at v0.9. The API is maturing but changes are still expected.
6
+
SDK version supported: 5.0 Developer Preview
7
7
8
8
Download the latest release package complete with bindings and sample applications from the [release section](../../releases).
9
9
@@ -19,11 +19,11 @@ DeepStream pipelines can be constructed using Gst Python, the GStreamer framewor
19
19
Python bindings are provided in the form of a compiled module. Download these bindings [here](https://developer.nvidia.com/deepstream-download#python_bindings). This module is generated using [Pybind11](https://github.com/pybind/pybind11).
These bindings support a Python interface to the MetaData structures and functions. Usage of this interface is documented in the [HOW-TO Guide](HOWTO.md) and demonstrated in the sample applications.
26
-
The current bindings are limited to the [NvDsBatchMeta](https://docs.nvidia.com/metropolis/deepstream/plugin-manual/index.html#page/DeepStream_Plugin_Manual%2Fdeepstream_plugin_metadata.03.2.html%23) hierarchy. Image data access is currently not included.
26
+
This release adds bindings for decoded image buffers (NvBufSurface) as well as inference output tensors (NvDsInferTensorMeta).
27
27
28
28
<aname="sample_applications"></a>
29
29
## Sample Applications
@@ -37,13 +37,15 @@ To run the sample applications or write your own, please consult the [HOW-TO Gui
0 commit comments