NvDsAnalyticsObjInfo

class pyds.NvDsAnalyticsObjInfo

Holds a set of nvdsanalytics object level metadata.

Variables:
  • roiStatuslist of str, Holds the array of ROI labels in which object is present.

  • ocStatuslist of str, Holds the array of OverCrowding labels in which object is present.

  • lcStatuslist of str, Holds the array of line crossing labels which object has crossed.

  • dirStatusstr, Holds the direction string for the tracked object.

  • objStatusstr, Holds the status string for the tracked object.

  • unique_idint, Holds unique identifier for nvdsanalytics instance.

Example usage:

# Extract object level meta data from NvDsAnalyticsObjInfo
l_user_meta = obj_meta.obj_user_meta_list #Get glist containing NvDsUserMeta objects from given NvDsObjectMeta
# Extract object level meta data from NvDsAnalyticsObjInfo
while l_user_meta:
    try:
        user_meta = pyds.NvDsUserMeta.cast(l_user_meta.data) #Must cast glist data to NvDsUserMeta object
        if user_meta.base_meta.meta_type == pyds.nvds_get_user_meta_type("NVIDIA.DSANALYTICSOBJ.USER_META"):             
        user_meta_data = pyds.NvDsAnalyticsObjInfo.cast(user_meta.user_meta_data) #Must cast user metadata to NvDsAnalyticsObjInfo
        #Access NvDsAnalyticsObjInfo attributes with user_meta_data.{attribute name}
        if user_meta_data.dirStatus: print("Object {0} moving in direction: {1}".format(obj_meta.object_id, user_meta_data.dirStatus))
        if user_meta_data.lcStatus: print("Object {0} line crossing status: {1}".format(obj_meta.object_id, user_meta_data.lcStatus))
        if user_meta_data.ocStatus: print("Object {0} overcrowding status: {1}".format(obj_meta.object_id, user_meta_data.ocStatus))
        if user_meta_data.roiStatus: print("Object {0} roi status: {1}".format(obj_meta.object_id, user_meta_data.roiStatus))
        if user_meta_data.objStatus: print("Object {0} status: {1}".format(obj_meta.object_id, user_meta_data.objStatus))
    except StopIteration:
        break

    try:
        l_user_meta = l_user_meta.next
        except StopIteration:
        break
static cast(data: capsule) pyds.NvDsAnalyticsObjInfo

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