Deepstream Python Tracker FAQ

• Hardware Platform (Jetson / GPU) : Jetson AGX Orin 32GB
• DeepStream Version : 6.3
• JetPack Version (valid for Jetson only) : 5.1.2
• TensorRT Version : 8.5.2

Hii, Team Nvidia:

I am trying to run multi object detection and tracking on jetson in real time.
I know that sample code is provided that loads the video and does the object detection and tracking.(deepstream_python_apps/apps/deepstream-test2)

However, all I want to do in the deepstream is objects tracking, and object detection is done outside of the deepstream.

My approach is add obj_meta to the newly created gst-buffer and flow it into a pipeline that has nvtracking. As follows.

    batch_meta = pyds.nvds_create_batch_meta(32)
    frame_meta = pyds.nvds_acquire_frame_meta_from_pool(batch_meta)
    detections = [         # Temporary detection results      
    (100, 100, 200, 200, 1, 0.9),   
    (150, 150, 250, 250, 2, 0.85)] 
    
    for detection in detections:
        obj_meta = pyds.NvDsObjectMeta.cast(pyds.nvds_acquire_obj_meta_from_pool(batch_meta))
        obj_meta.rect_params.left = detection[0]
        obj_meta.rect_params.top = detection[1]
        obj_meta.rect_params.width = detection[2]
        obj_meta.rect_params.height = detection[3]
        obj_meta.class_id = detection[4]
        obj_meta.confidence = detection[5]

        pyds.nvds_add_obj_meta_to_frame(frame_meta, obj_meta,None)

    gst_buffer = Gst.Buffer.new_allocate(None, 1024, None)
    batch_meta_buf = pyds.gst_buffer_get_nvds_batch_meta(hash(gst_buffer)) # error

My code gives me an error in batch_meta_buf = pyds.gst_buffer_get_nvds_batch_meta(hash(gst_buffer)).
Because the newly created gst-buffer does not have batch_meta.

Deepstream-python provides “gst_buffer_add_nvds_meta” as a function to add batch_meta to gst-buffer, however I face the same problem as https://forums.developer.nvidia.com/t/attaching-user-metadata-to-gstreamer-buffer-using-python-bindings/223486

Is what I am trying to do feasible?

No. You need to create your own batch and generate various metadata in Python. Basically you need to implement our nvstreammux feature which is very complicated. We recommend that you use our complete pipeline to meet your needs.

There is no update from you for a period, assuming this is not an issue anymore. Hence we are closing this topic. If need further support, please open a new one. Thanks

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.