NvDsObjectMeta¶
- class pyds.NvDsObjectMeta¶
Holds information of object metadata in the frame.
- Variables:
base_meta –
NvDsBaseMeta
, base_metaparent – the parent
NvDsObjectMeta
object. Set to None if parent is not presentunique_component_id – int, unique component id that attaches NvDsObjectMeta metadata
class_id – int, Index of the object class infered by the primary detector/classifier
object_id – int, Unique ID for tracking the object. @ref UNTRACKED_OBJECT_ID indicates the object has not been tracked
confidence – float, Holds a confidence value for the object, set by the inference component. Confidence will be set to -0.1, if “Group Rectangles” mode of clustering is chosen since the algorithm does not preserve confidence values. Also, for objects found by tracker and not inference component, confidence will be set to -0.1
detector_bbox_info –
NvDsComp_BboxInfo
, Holds a structure containing bounding box parameters of the object when detected by detectortracker_bbox_info –
NvDsComp_BboxInfo
, Holds a structure containing bounding box coordinates of the object when processed by trackertracker_confidence – float, Holds a confidence value for the object set by nvdcf_tracker. tracker_confidence will be set to -0.1 for KLT and IOU tracker
rect_params –
NvOSD_RectParams
, Structure containing the positional parameters of the object in the frame. e.g. If the tracker component is after the detector component in the pipeline, then positional parameters are from tracker component. Can also be used to overlay borders / semi-transparent boxes on top of objects. SeeNvOSD_RectParams
mask_params –
NvOSD_MaskParams
, Holds mask parameters for the object. This mask is overlaid on object SeeNvOSD_MaskParams
text_params –
NvOSD_TextParams
, Text describing the object can be overlayed using this structure. SeeNvOSD_TextParams
obj_label – An array to store the string describing the class of the detected object
classifier_meta_list – list of objects of type
NvDsClassifierMeta
obj_user_meta_list – list of objects of type
NvDsUserMeta
misc_obj_info – list of int, For additional user specific batch info
reserved – int, Reserved for internal use.
Example usage:
#Initialize dict to keep count of objects of each type obj_counter = { PGIE_CLASS_ID_VEHICLE:0, PGIE_CLASS_ID_PERSON:0, PGIE_CLASS_ID_BICYCLE:0, PGIE_CLASS_ID_ROADSIGN:0 } l_obj=frame_meta.obj_meta_list #Retrieve list of NvDsObjectMeta objects in frame from an NvDsFrameMeta object. See NvDsFrameMeta documentation for more details. while l_obj is not None: try: # Casting l_obj.data to pyds.NvDsObjectMeta obj_meta=pyds.NvDsObjectMeta.cast(l_obj.data) except StopIteration: break obj_counter[obj_meta.class_id] += 1 #Retrieve class_id from NvDsObjectMeta (i.e. PGIE_CLASS_ID_VEHICLE, PGIE_CLASS_ID_PERSON, etc.) to update count obj_meta.rect_params.border_color.set(0.0, 0.0, 1.0, 0.0) #Set border color of NvDsObjectMeta object's rect_params try: l_obj=l_obj.next except StopIteration: break
- cast(*args, **kwargs)¶
Overloaded function.
cast(self: capsule) -> pyds.NvDsObjectMeta
cast given object/data to
NvDsObjectMeta
, call pyds.NvDsObjectMeta.cast(data)cast(self: int) -> pyds.NvDsObjectMeta
cast given object/data to
NvDsObjectMeta
, call pyds.NvDsObjectMeta.cast(data)