Extra binding patches for nvidia deepstream.
Project description
pyds_ext
python bindings for nvidia deepstream
pybind11 bindings to access Nvidia DeepStream metadata from Python - uses patched deepstream_python_apps. This package offers the same functionality as the default nvidia bindings, as well as some additional funcitonality:
- Allow to install with pip: wheels for x86-64 (GPU) and aarch64 (jetson) are available
- Patch pybind bindings to allow maskrcnn masks extraction
Previous version:
The following patches were included in the previous version (<2), and are no longer required because they are included in the vanilla bindings:
- Tracker meta info (
NvDsPastFrame...
classes) - Detector and tracker bbox info (
NvDsObjectMeta.[tracker/detector]_bbox_info...
attrs) from Python. - Analytics Metadata (
NvDsAnalyticsFrameMeta
andNvDsAnalyticsObjInfo
) from Python.
Installation
Prerequisites
-
python3.8
-
Jetson (Xavier only tested) or Nvidia GPU
-
Deepstream>=6 (6.1 only tested)
-
[Option A] pep-517 compatible pip:
pip install "pip>=10"
-
[Option B] Only necessary for old
pip<10
:- pybind11:
- [Option B.1] You might try simply
pip install pybind11
. - [Option B.2] The recommended way is to build it from source
- [Option B.1] You might try simply
- pybind11:
Install package
pip install --upgrade pip>=10
pip install pyds_ext
Usage
This meta-package provides a single package:
Standard pyds
pyds
: Patched pyds from/opt/nvidia/deepstream/deepstream/lib
See oficial documentation here
Maskrcnn extraction
Use the following as a reference to extract the np.ndarray
of the mask:
import pyds
def osd_sink_pad_buffer_probe(pad, info, u_data):
# ... code to acquire frame_meta
l_obj = frame_meta.obj_meta_list
while l_obj is not None:
try:
obj_meta = pyds_bbox_meta.NvDsObjectMeta.cast(l_obj.data)
except StopIteration:
break
mask_array = obj_meta.mask_params.data
print(f"mask_array: {mask_array}")
try:
l_obj = l_obj.next
except StopIteration:
break
...
To convert the mask to an uint8
bidimensional matrix, see this code.
For this and other utilities, consider using the pythia package, which builds on this and adds pythonic iteration and common deepstream boilerplate.
References
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distributions
Built Distributions
File details
Details for the file pyds_ext-2.0.0-cp38-cp38-manylinux2014_x86_64.whl
.
File metadata
- Download URL: pyds_ext-2.0.0-cp38-cp38-manylinux2014_x86_64.whl
- Upload date:
- Size: 523.2 kB
- Tags: CPython 3.8
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 71f01538a1f4cdc1d4b035e2552ee45fe6e01bba167700df237830596a5d2c86 |
|
MD5 | 22af79189398732d46fc57b593f0bab8 |
|
BLAKE2b-256 | bd4ffc09975a44e6da326822bb52180c9c925a60d26b9b0ac5e210480f3c41ce |
File details
Details for the file pyds_ext-2.0.0-cp38-cp38-manylinux2014_aarch64.whl
.
File metadata
- Download URL: pyds_ext-2.0.0-cp38-cp38-manylinux2014_aarch64.whl
- Upload date:
- Size: 493.6 kB
- Tags: CPython 3.8
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/4.0.1 CPython/3.9.13
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | c61ae86f92cf22b87b40a29ab8fc125392e2ae90117e8ce399850986479f9a26 |
|
MD5 | 187aeb9534ef131a6915b763622bc2f2 |
|
BLAKE2b-256 | bb3de869626dbf9d1ad40c877278bb13ee6fed5aae239f242f6f36e902c010c3 |