NvDsAnalyticsFrameMeta

class pyds.NvDsAnalyticsFrameMeta

Holds a set of nvdsanalytics frame level metadata.

Variables:
  • ocStatusdict<str, bool>, Holds a map of boolean status of overcrowding for configured ROIs,which can be accessed using key, value pair; where key is the ROI label.

  • objInROIcntdict<str, int>, Holds a map of total count of valid objects in ROI for configured ROIs,which can be accessed using key, value pair; where key is the ROI label.

  • objLCCurrCntdict<str, int>, Holds a map of total count of Line crossing in current frame for configured lines, which can be accessed using key, value pair; where key is the line crossing label.

  • objLCCumCntdict<str, int>, Holds a map of total cumulative count of Line crossing for configured lines, can be accessed using key, value pair; where key is the line crossing label

  • unique_idstr, Holds unique identifier for nvdsanalytics instance.

  • objCntint, Holds a map of total count of objects for each class ID, can be accessed using key, value pair; where key is class ID.

Example usage:

# Get meta data from NvDsAnalyticsFrameMeta
l_user = frame_meta.frame_user_meta_list #Get glist containing NvDsUserMeta objects from given NvDsFrameMeta
while l_user:
    try:
        user_meta = pyds.NvDsUserMeta.cast(l_user.data) #Must cast glist data to NvDsUserMeta object
        if user_meta.base_meta.meta_type == pyds.nvds_get_user_meta_type("NVIDIA.DSANALYTICSFRAME.USER_META"):
            user_meta_data = pyds.NvDsAnalyticsFrameMeta.cast(user_meta.user_meta_data) #Must cast user metadata to NvDsAnalyticsFrameMeta
            #Access NvDsAnalyticsFrameMeta attributes with user_meta_data.{attribute name}
            if user_meta_data.objInROIcnt: print("Objs in ROI: {0}".format(user_meta_data.objInROIcnt))                    
            if user_meta_data.objLCCumCnt: print("Linecrossing Cumulative: {0}".format(user_meta_data.objLCCumCnt))
            if user_meta_data.objLCCurrCnt: print("Linecrossing Current Frame: {0}".format(user_meta_data.objLCCurrCnt))
            if user_meta_data.ocStatus: print("Overcrowding status: {0}".format(user_meta_data.ocStatus))
    except StopIteration:
        break
    try:
        l_user = l_user.next
    except StopIteration:
        break
static cast(data: capsule) pyds.NvDsAnalyticsFrameMeta

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