Skip to main content

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 and NvDsAnalyticsObjInfo) from Python.

Installation

Prerequisites

  1. python3.8

  2. Jetson (Xavier only tested) or Nvidia GPU

  3. Deepstream>=6 (6.1 only tested)

  4. [Option A] pep-517 compatible pip:

    pip install "pip>=10"
    
  5. [Option B] Only necessary for old pip<10:

Install package

pip install --upgrade pip>=10
pip install pyds_ext

Usage

This meta-package provides a single package:

Standard pyds

  1. 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

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

pyds_ext-2.0.0-cp38-cp38-manylinux2014_x86_64.whl (523.2 kB view details)

Uploaded CPython 3.8

pyds_ext-2.0.0-cp38-cp38-manylinux2014_aarch64.whl (493.6 kB view details)

Uploaded CPython 3.8

File details

Details for the file pyds_ext-2.0.0-cp38-cp38-manylinux2014_x86_64.whl.

File metadata

File hashes

Hashes for pyds_ext-2.0.0-cp38-cp38-manylinux2014_x86_64.whl
Algorithm Hash digest
SHA256 71f01538a1f4cdc1d4b035e2552ee45fe6e01bba167700df237830596a5d2c86
MD5 22af79189398732d46fc57b593f0bab8
BLAKE2b-256 bd4ffc09975a44e6da326822bb52180c9c925a60d26b9b0ac5e210480f3c41ce

See more details on using hashes here.

File details

Details for the file pyds_ext-2.0.0-cp38-cp38-manylinux2014_aarch64.whl.

File metadata

File hashes

Hashes for pyds_ext-2.0.0-cp38-cp38-manylinux2014_aarch64.whl
Algorithm Hash digest
SHA256 c61ae86f92cf22b87b40a29ab8fc125392e2ae90117e8ce399850986479f9a26
MD5 187aeb9534ef131a6915b763622bc2f2
BLAKE2b-256 bb3de869626dbf9d1ad40c877278bb13ee6fed5aae239f242f6f36e902c010c3

See more details on using hashes here.

Supported by

AWS AWS Cloud computing and Security Sponsor Datadog Datadog Monitoring Fastly Fastly CDN Google Google Download Analytics Microsoft Microsoft PSF Sponsor Pingdom Pingdom Monitoring Sentry Sentry Error logging StatusPage StatusPage Status page