Please use these updated bindings for tracker meta while compiling deepstream python apps.
bindtrackermeta.cpp.txt (6.7 KB)
trackermetadoc.h.txt (10.5 KB)
nvdsmetadoc.h.txt (23.7 KB)
bindnvdsmeta.cpp.txt (27.5 KB)
Example Usage:
::
gst_buffer = info.get_buffer()
if not gst_buffer:
print("Unable to get GstBuffer ")
return
batch_meta = pyds.gst_buffer_get_nvds_batch_meta(hash(gst_buffer))
l_batch_user=batch_meta.batch_user_meta_list #
while l_batch_user is not None:
try:
user_meta= pyds.NvDsUserMeta.cast(l_batch_user.data)
except StopIteration:
break
if user_meta and user_meta.base_meta.meta_type == pyds.NVDS_TRACKER_BATCH_REID_META:
pReidTensor = pyds.NvDsReidTensorBatch.cast(user_meta.user_meta_data)
try:
l_batch_user=l_batch_user.next
except StopIteration:
break
l_frame = batch_meta.frame_meta_list
while l_frame is not None:
try:
frame_meta = pyds.NvDsFrameMeta.cast(l_frame.data)
except StopIteration:
break
if not pReidTensor:
continue
l_obj = frame_meta.obj_meta_list
while l_obj is not None:
try:
obj = pyds.NvDsObjectMeta.cast(l_obj.data)
except StopIteration:
break
id = obj.object_id
l_obj_user = obj.obj_user_meta_list
obj_user_meta = pyds.NvDsUserMeta.cast(l_obj_user.data)
if obj_user_meta and obj_user_meta.base_meta.meta_type == pyds.NVDS_TRACKER_OBJ_REID_META and obj_user_meta.user_meta_data:
reidInd_ptr = ctypes.cast(pyds.get_ptr(obj_user_meta.user_meta_data), ctypes.POINTER(ctypes.c_int32))
reidInd = reidInd_ptr.contents.value
# Check the conditions
if 0 <= reidInd < pReidTensor.numFilled:
features = pReidTensor.ptr_host[reidInd]
features[id] = features.tolist() #This will be the Re-ID feature for the obj. id
try:
l_obj = l_obj.next
except StopIteration:
break
This is the example usage code you can use to get reid feature. @JoeShz
@kesong Please help update the repo if you find the bindingd are correct. Will be useful for other developers in future.
Regards