Please provide complete information as applicable to your setup.
**• Hardware Platform -------> GPU
**• DeepStream Version ------> 7.0
• TensorRT Version ------> 8.6.2.0
**• NVIDIA GPU Driver Version -----> 555
We are currently migrating a DeepStream-based Action Recognition application from C++ to Python using DeepStream 7.0. While the C++ version works correctly and we can access the NVDS_PREPROCESS_BATCH_META from the batch_user_meta_list, we’re unable to replicate this in Python due to apparent missing bindings in pyds.
{
user_meta = (NvDsUserMeta *)(l_user_meta->data);
if (user_meta->base_meta.meta_type == NVDS_PREPROCESS_BATCH_META)
{
GstNvDsPreProcessBatchMeta *preprocess_batchmeta =
(GstNvDsPreProcessBatchMeta *)(user_meta->user_meta_data);
std::string model_dims = "";
if (preprocess_batchmeta->tensor_meta) {
if (preprocess_batchmeta->tensor_meta->tensor_shape.size() == MODEL_3D_SHAPES) {
model_dims = "3D: AR - ";
} else {
model_dims = "2D: AR - ";
}
When we are trying to do the same thing in python
while l_user_meta is not None:
try:
user_meta = pyds.NvDsUserMeta.cast(l_user_meta.data)
except StopIteration:
break
if user_meta.base_meta.meta_type == pyds.NvDsMetaType.NVDS_PREPROCESS_BATCH_META:
preprocess_batchmeta = pyds.NvDsPreProcessBatchMeta.cast(
user_meta.user_meta_data)
print(preprocess_batchmeta)
# -----------------------------------------------------------------
# Derive the “2D/3D : AR – ” prefix once per preprocess batch
# -----------------------------------------------------------------
model_dims = ""
if preprocess_batchmeta.tensor_meta:
if preprocess_batchmeta.tensor_meta.tensor_shape.size() == MODEL_3D_SHAPES:
model_dims = "3D: AR - "
else:
model_dims = "2D: AR - "
ERROR :- AttributeError: type object ‘pyds.NvDsMetaType’ has no attribute ‘NVDS_PREPROCESS_BATCH_META’
Our Analysis:
- The enum
NVDS_PREPROCESS_BATCH_METAappears to be missing from PyDS bindings (Python API). - Other meta types (e.g.,
NVDSINFER_TENSOR_OUTPUT_META) are accessible, so the base functionality is working. - The struct
GstNvDsPreProcessBatchMetaalso does not seem to be exposed via PyDS.
Our Goal:
We need to:
- Access
NVDS_PREPROCESS_BATCH_METAand cast toGstNvDsPreProcessBatchMetaequivalent in Python. - Parse ROI metadata and tensor shape (needed to distinguish 2D vs 3D models).
- Display per-ROI text using the classification or detection results based on the preprocess metadata.
Questions:
- Is
NVDS_PREPROCESS_BATCH_METAexposed in Python for DeepStream 7.0? - If not, is there a workaround or plan to expose it now?
- Can you share an example of how to extract and use preprocess plugin metadata in Python?
If this functionality is not yet available in Python, we would appreciate:
A patch or workaround to extract this metadata
Or access to native C/C++ helper functions via Python C-bindings