I am trying to access the object tracking results of the pasts frames. I would like to achieve the same results from python as in the write_kitti_past_track_output function of the reference app, deepstream_app.c. Unfortunately I could not find the python bindings for the necessary classes, NvDsPastFrameObjBatch, NvDsPastFrameObjStream, NvDsPastFrameObjList and NvDsPastFrameObj. I can read only the user meta data:
# In the probe callback, after obtaining a batch_meta and the user_meta:
print('user_meta.base_meta.meta_type:', user_meta.base_meta.meta_type)
This prints the following:
user_meta.base_meta.meta_type: NvDsMetaType.???
And of course, in the lack of the corresponding python classes, I can not cast user_meta.user_meta_data in anything useful. Are there any way to read the past frame metadata from python?
@mchi do you have some working example on how to use these classes? Until now I arrived to this:
def buffer_probe_callback(pad, info, u_data):
gst_buffer = info.get_buffer()
batch_meta = pyds.gst_buffer_get_nvds_batch_meta(hash(gst_buffer))
user_meta_list = batch_meta.batch_user_meta_list
while user_meta_list is not None:
user_meta = pyds.NvDsUserMeta.cast(user_meta_list.data)
if user_meta.base_meta.meta_type == pyds.NvDsMetaType.NVDS_TRACKER_PAST_FRAME_META:
print("Found past frame meta")
try:
user_meta_list = user_meta_list.next
except StopIteration:
break
Indeed this code prints the “Found past frame meta” lines. What I miss is how to extract / cast the pyds.NvDsPastFrameObjBatch instances from the user meta. Maybe some cast method is missing from this class?