NvDsPastFrameObj

class pyds.NvDsPastFrameObj
Variables
  • frameNumint, frameNum

  • tBboxNvOSD_RectParams, tBbox

  • confidencefloat, confidence

  • ageint, age

Example usage:

l_user=batch_meta.batch_user_meta_list #Retrieve glist of NvDsUserMeta objects from given NvDsBatchMeta object
while l_user is not None:
    try:
        # Note that l_user.data needs a cast to pyds.NvDsUserMeta
        # The casting is done by pyds.NvDsUserMeta.cast()
        # The casting also keeps ownership of the underlying memory
        # in the C code, so the Python garbage collector will leave
        # it alone
        user_meta=pyds.NvDsUserMeta.cast(l_user.data) 
    except StopIteration:
        break
    if(user_meta and user_meta.base_meta.meta_type==pyds.NvDsMetaType.NVDS_TRACKER_PAST_FRAME_META): #Make sure metatype is correct
        try:
            # Note that user_meta.user_meta_data needs a cast to pyds.NvDsPastFrameObjBatch
            # The casting is done by pyds.NvDsPastFrameObjBatch.cast()
            # The casting also keeps ownership of the underlying memory
            # in the C code, so the Python garbage collector will leave
            # it alone
            pPastFrameObjBatch = pyds.NvDsPastFrameObjBatch.cast(user_meta.user_meta_data) #See NvDsPastFrameObjBatch for details
        except StopIteration:
            break
        for trackobj in pyds.NvDsPastFrameObjBatch.list(pPastFrameObjBatch): #Iterate through list of NvDsPastFrameObjStream objects
            #Access NvDsPastFrameObjStream attributes
            print("streamId=",trackobj.streamID)
            print("surfaceStreamID=",trackobj.surfaceStreamID)
            for pastframeobj in pyds.NvDsPastFrameObjStream.list(trackobj): #Iterate through list of NvDsFrameObjList objects
            #Access NvDsPastFrameObjList attributes
            print("numobj=",pastframeobj.numObj)
            print("uniqueId=",pastframeobj.uniqueId)
            print("classId=",pastframeobj.classId)
            print("objLabel=",pastframeobj.objLabel)
            for objlist in pyds.NvDsPastFrameObjList.list(pastframeobj): #Iterate through list of NvDsFrameObj objects
                #Access NvDsPastFrameObj attributes
                print('frameNum:', objlist.frameNum)
                print('tBbox.left:', objlist.tBbox.left)
                print('tBbox.width:', objlist.tBbox.width)
                print('tBbox.top:', objlist.tBbox.top)
                print('tBbox.right:', objlist.tBbox.height)
                print('confidence:', objlist.confidence)
                print('age:', objlist.age)
    try:
        l_user=l_user.next
    except StopIteration:
        break
cast(self: capsule) pyds.NvDsPastFrameObj

cast given object/data to NvDsPastFrameObj, call pyds.NvDsPastFrameObj.cast(data)