Typing stubs for NVIDIA DeepStream Python Bindings
Project description
Typing stubs for NVIDIA DeepStream Python Bindings
This project provides type stubs for pyds to improve the support of these important bindings in IDEs.
These are generated by pybind11-stubgen and further post-processed. For the post-processing steps, check out the Post-Processing Chapter.
With the usage of this project, you agree to the license terms, found in the License chapter. This project is not affiliated with NVIDIA or the authors and maintainer of the pyds repository. It is the result of the need for type hints for a simpler and more stable implementation of DeepStream pipelines in Python.
[!NOTE] The stubs are distributed as a third-party stub-only library according to PEP 561 because this project is not related to NVIDIA and if they ship stubs, this project can easily be deprecated and publicly archived.
Index
Installation
This library can be easily installed with pip.
Versioning
The stub versions matches the versions of pyds. For example, stub version 1.1.8 fits to pyds
version
1.1.8. If any fix has to be applied, the fourth position would be incremented. So the first fix of
1.1.8 results in 1.1.8.1.
Please pin your version directly or limit it upper-wise like:
pyds-stubs>=1.1.8,<1.1.9
Usage
There is no magic, just only import pyds as you would normally do. This package is intended to be used during the development and can be omitted in runtime environments.
Development
Installation of Prerequisites
- Python 3.8
uvandpre-commit(both preferred via pipx)- Python venv (optional, recommended)
pipx install pre-commit uv
pre-commit install
Build wheel
uv build
Generation
The stubs are generated by pybind11-stubgen (2.5.5). Install pyds from nvidia official sources. To generate the stubs execute the following script in the environment, where pyds is installed.
pybind11-stubgen pyds
Post-Processing
For correct usage, the generated stubs are post-processed. Following steps are applied:
- add generic class for
capsulewith information about the class of the object. - remove class
GListand add genericGListclass with information about the class of the data. castfunctions withcapsuledatatype:capsuleis replaced bycapsule[class]whereclassis the target class.arraydatatype: Replace withnumpy.ndarraynumpy.ndarray[float32]: Replace withNDArray[numpy.float32]withfrom numpy.typing import NDArray- Returntype of
eglImageproperty ofNvBufSurfaceMappedAddr:typing.Anyinstead ofcapsule - Returntype of
dataPtrproperty ofNvBufSurfaceParams:typing.Anyinstead ofcapsule - Datatype of
batch_metaofNvDsBaseMeta:NvDsBatchMetainstead of_NvDsBatchMeta - Datatype of
uContextofNvDsBaseMeta:typing.Anyinstead ofcapsule - Datatype of
batch_user_meta_listofNvDsBatchMeta:typing.Optional[GList[NvDsUserMeta]]instead ofGList - Datatype of
frame_meta_listofNvDsBatchMeta:typing.Optional[GList[NvDsFrameMeta]]instead ofGList - Datatype of
meta_mutexofNvDsBatchMeta:GLib.RecMutexinstead of_GRecMutexwithfrom gi.repository import GLib - Datatype of
label_info_listofNvDsClassifierMeta:typing.Optional[GList[NvDsLabelInfo]]instead ofGList - Datatype of
extMsgofNvDsEventMsgMeta:typing.Anyinstead ofcapsule - Datatype of
maskofNvDsFaceObjectWithExt:typing.Optional[GList[typing.Any]]instead ofGList - Datatype of
display_meta_listofNvDsFrameMeta:typing.Optional[GList[NvDsDisplayMeta]]instead ofGList - Datatype of
frame_user_meta_listofNvDsFrameMeta:typing.Optional[GList[NvDsUserMeta]]instead ofGList - Datatype of
obj_meta_listofNvDsFrameMeta:typing.Optional[GList[NvDsObjectMeta]]instead ofGList - Returntype of
bufferproperty ofNvDsInferLayerInfo:typing.Anyinstead ofcapsule - Returntype of
priv_dataproperty ofNvDsInferSegmentationMeta:typing.Anyinstead ofcapsule - Returntype of
out_buf_ptrs_devproperty ofNvDsInferTensorMeta:typing.Anyinstead ofcapsule - Returntype of
out_buf_ptrs_hostproperty ofNvDsInferTensorMeta:typing.Anyinstead ofcapsule - Returntype of
priv_dataproperty ofNvDsInferTensorMeta:typing.Anyinstead ofcapsule - Datatype of
metaofNvDsMeta:Gst.Metainstead of_GstMetawithfrom gi.repository import Gst - Datatype of
meta_dataofNvDsMeta:typing.Anyinstead ofcapsule - Datatype of
user_dataofNvDsMeta:typing.Anyinstead ofcapsule - Add
NvDsMetaListas an alias oftyping.Optional[GList[NvDsMeta]] - Datatype of
empty_listofNvDsMetaPool:NvDsMetaListinstead ofGList - Datatype of
full_listofNvDsMetaPool:NvDsMetaListinstead ofGList - Datatype of
classifier_meta_listofNvDsObjectMeta:typing.Optional[GList[NvDsClassifierMeta]]instead ofGList - Datatype of
obj_user_meta_listofNvDsObjectMeta:typing.Optional[GList[NvDsUserMeta]]instead ofGList - Datatype of
dataofNvDsOpticalFlowMeta:typing.Anyinstead ofcapsule - Datatype of
privofNvDsOpticalFlowMeta:typing.Anyinstead ofcapsule - Datatype of
reservedofNvDsOpticalFlowMeta:typing.Anyinstead ofcapsule - Datatype of
maskofNvDsPersonObjectExt:typing.Optional[GList[typing.Any]]instead ofGList - Datatype of
payloadofNvDsPayload:typing.Anyinstead ofcapsule - Datatype of
user_meta_dataofNvDsUserMeta:typing.Anyinstead ofcapsule - Datatype of
maskofNvDsVehicleObjectExt:typing.Optional[GList[typing.Any]]instead ofGList - Datatype of
textofRectDim:typing.Anyinstead ofcapsule - Rename
dmabuftodmabuf_fdofNvBufSurfaceFromFd - Datatype of
bufferofNvBufSurfaceFromFd:capsule[NvBufSurface]instead ofcapsule - Datatype of
bufferoffree_gbuffer:typing.Anyinstead ofcapsule - Datatype of
arg0ofget_detections:typing.Anyinstead ofcapsule - Datatype of
arg0ofget_nvds_LayerInfo:typing.Anyinstead ofcapsule - Datatype of
dataofget_optical_flow_vectors:capsule[NvDsOpticalFlowMeta]instead ofcapsule - Rename
datatoof_metaofget_optical_flow_vectors - Datatype of
ptrofget_ptr:typing.Anyinstead ofcapsule - Datatype of
dataofget_segmentation_masks:capsule[NvDsInferSegmentationMeta]instead ofcapsule - Datatype of
arg0ofglist_get_nvds_Surface_Params:typing.Anyinstead ofcapsule - Datatype of
arg0ofglist_get_nvds_batch_meta:typing.Anyinstead ofcapsule - Datatype of
arg0ofglist_get_nvds_classifier_meta:typing.Anyinstead ofcapsule - Datatype of
arg0ofglist_get_nvds_display_meta:typing.Anyinstead ofcapsule - Datatype of
arg0ofglist_get_nvds_event_msg_meta:typing.Anyinstead ofcapsule - Datatype of
arg0ofglist_get_nvds_frame_meta:typing.Anyinstead ofcapsule - Datatype of
arg0ofglist_get_nvds_label_info:typing.Anyinstead ofcapsule - Datatype of
arg0ofglist_get_nvds_object_meta:typing.Anyinstead ofcapsule - Datatype of
arg0ofglist_get_nvds_person_object:typing.Anyinstead ofcapsule - Datatype of
arg0ofglist_get_nvds_tensor_meta:typing.Anyinstead ofcapsule - Datatype of
arg0ofglist_get_nvds_user_meta:typing.Anyinstead ofcapsule - Datatype of
arg0ofglist_get_nvds_vehicle_object:typing.Anyinstead ofcapsule - Datatype of
bufferofgst_buffer_add_nvds_meta:Gst.Bufferinstead of_GstBuffer - Datatype of
meta_dataofgst_buffer_add_nvds_meta:typing.Anyinstead ofcapsule - Datatype of
user_dataofgst_buffer_add_nvds_meta:typing.Anyinstead ofcapsule - Returntype of
gst_buffer_add_nvds_meta:NvDsMetainstead of_NvDsMeta - Rename
arg0togst_elementofgst_element_send_nvevent_new_stream_reset - Rename
arg1tosource_idofgst_element_send_nvevent_new_stream_reset - Datatype of
dataofnvds_batch_meta_copy_func:capsule[NvDsBatchMeta]instead ofcapsule - Datatype of
user_metaofnvds_batch_meta_copy_func:typing.Anyinstead ofcapsule - Rename
user_metatouser_dataofnvds_batch_meta_copy_func - Returntype of
nvds_batch_meta_copy_func:capsule[NvDsBatchMeta]instead ofcapsule - Datatype of
dataofnvds_batch_meta_release_func:capsule[NvDsBatchMeta]instead ofcapsule - Datatype of
user_dataofnvds_batch_meta_release_func:typing.Anyinstead ofcapsule - Add
NvDsUserMetaListas an alias oftyping.Optional[GList[NvDsUserMeta]] - Datatype of
meta_listofnvds_clear_batch_user_meta_list:NvDsUserMetaListinstead ofGList - Add
NvDisplayMetaListas an alias oftyping.Optional[GList[NvDsDisplayMeta]] - Datatype of
meta_listofnvds_clear_display_meta_list:NvDisplayMetaListinstead ofGList - Add
NvDsFrameMetaListas an alias oftyping.Optional[GList[NvDsFrameMeta]] - Datatype of
meta_listofnvds_clear_frame_meta_list:NvDsFrameMetaListinstead ofGList - Datatype of
meta_listofnvds_clear_frame_user_meta_list:NvDsUserMetaListinstead ofGList - Datatype of
meta_listofnvds_clear_meta_list:NvDsMetaListinstead ofGList - Returntype of
nvds_clear_meta_list:NvDsMetaListinstead ofGList - Add
NvDsObjectMetaListas an alias oftyping.Optional[GList[NvDsObjectMeta]] - Datatype of
meta_listofnvds_clear_obj_meta_list:NvDsObjectMetaListinstead ofGList - Datatype of
meta_listofnvds_clear_obj_user_meta_list:NvDsObjectMetaListinstead ofGList - Datatype of
src_user_meta_listofnvds_copy_batch_user_meta_list:NvDsObjectMetaListinstead ofGList - Datatype of
src_display_metaofnvds_copy_display_meta_list:NvDisplayMetaListinstead ofGList - Rename
src_display_metatosrc_display_meta_listofnvds_copy_display_meta_list - Datatype of
src_frame_meta_listofnvds_copy_frame_meta_list:NvDsFrameMetaListinstead ofGList - Datatype of
src_user_meta_listofnvds_copy_frame_user_meta_list:NvDsUserMetaListinstead ofGList - Datatype of
src_obj_meta_listofnvds_copy_obj_meta_list:NvDsObjectMetaListinstead ofGList - Rename
dst_object_metatodst_frame_metaofnvds_copy_obj_meta_list - Datatype of
frame_meta_listofnvds_get_nth_frame_meta:GList[NvDsFrameMeta]instead ofGList - Datatype of
arg0ofregister_user_copyfunc:typing.Callable[[typing.Any, typing.Any], typing.Any]instead oftyping.Callable[[capsule, capsule], capsule] - Datatype of
arg0ofregister_user_releasefunc:typing.Callable[[typing.Any, typing.Any], None]instead oftyping.Callable[[capsule, capsule], None] - Datatype of
arg1ofset_user_copyfunc:typing.Callable[[typing.Any, typing.Any], typing.Any]instead oftyping.Callable[[capsule, capsule], capsule] - Datatype of
arg1ofset_user_releasefunc:typing.Callable[[typing.Any, typing.Any], None]instead oftyping.Callable[[capsule, capsule], None] - Datatype of
funcofuser_copyfunc:typing.Callable[[typing.Any, typing.Any], typing.Any]instead oftyping.Callable[[capsule, capsule], capsule] - Datatype of
funcofuser_releasefunc:typing.Callable[[typing.Any, typing.Any], None]instead oftyping.Callable[[capsule, capsule], None]
License
This project is published under Apache License, Version 2.0 - please comply with it, if you use/modify/distribute it. The license can be found in "LICENSE".
Appendix
Links
Notice for NVIDIA
I recently (Jun, 2025) saw a discussion on your forum. If there is any official stub support by NVIDIA, this project will be deprecated and publicly archived. I hope to hear from you ;)
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file pyds_stubs-1.1.8.3.tar.gz.
File metadata
- Download URL: pyds_stubs-1.1.8.3.tar.gz
- Upload date:
- Size: 40.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
9cb30f45ea8dea080398af80f950c3b96a9151b63d167aaaba81c5caef54c812
|
|
| MD5 |
dfb702b1884858672216dfd53661bc6f
|
|
| BLAKE2b-256 |
d5d04f70927732cba5fab124f57d85047864ba2c1e887ae77a1937dbb4fa77f9
|
Provenance
The following attestation bundles were made for pyds_stubs-1.1.8.3.tar.gz:
Publisher:
publish.yml on nkaaf/pyds-stubs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyds_stubs-1.1.8.3.tar.gz -
Subject digest:
9cb30f45ea8dea080398af80f950c3b96a9151b63d167aaaba81c5caef54c812 - Sigstore transparency entry: 543764635
- Sigstore integration time:
-
Permalink:
nkaaf/pyds-stubs@03ff5e17b386e091117074bb5d26389cf16f3897 -
Branch / Tag:
refs/tags/1.1.8.3 - Owner: https://github.com/nkaaf
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@03ff5e17b386e091117074bb5d26389cf16f3897 -
Trigger Event:
workflow_dispatch
-
Statement type:
File details
Details for the file pyds_stubs-1.1.8.3-py3-none-any.whl.
File metadata
- Download URL: pyds_stubs-1.1.8.3-py3-none-any.whl
- Upload date:
- Size: 40.9 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? Yes
- Uploaded via: twine/6.1.0 CPython/3.13.7
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
869f9b4b95acf5a214f185b965109ae01c9529989a68e26b89153a1a458f8733
|
|
| MD5 |
59bcd494ab5040f2ea6e2c94b5de9b13
|
|
| BLAKE2b-256 |
509394e2955acc9869229f0509f2d87017f6cae49c80be617520abc25b5d1cd5
|
Provenance
The following attestation bundles were made for pyds_stubs-1.1.8.3-py3-none-any.whl:
Publisher:
publish.yml on nkaaf/pyds-stubs
-
Statement:
-
Statement type:
https://in-toto.io/Statement/v1 -
Predicate type:
https://docs.pypi.org/attestations/publish/v1 -
Subject name:
pyds_stubs-1.1.8.3-py3-none-any.whl -
Subject digest:
869f9b4b95acf5a214f185b965109ae01c9529989a68e26b89153a1a458f8733 - Sigstore transparency entry: 543764636
- Sigstore integration time:
-
Permalink:
nkaaf/pyds-stubs@03ff5e17b386e091117074bb5d26389cf16f3897 -
Branch / Tag:
refs/tags/1.1.8.3 - Owner: https://github.com/nkaaf
-
Access:
public
-
Token Issuer:
https://token.actions.githubusercontent.com -
Runner Environment:
github-hosted -
Publication workflow:
publish.yml@03ff5e17b386e091117074bb5d26389cf16f3897 -
Trigger Event:
workflow_dispatch
-
Statement type: