ObjectMeta

Inheritance diagram of ObjectMeta

ObjectMeta inheritance diagram

class savant.meta.object.ObjectMeta(element_name, label, bbox, confidence=1.0, track_id=18446744073709551615, parent=None, attributes=None, draw_label=None)

The ObjectMeta describes the object that was detected or created on the frame.

Parameters:
  • element_name (str) – The unique identifier of the component by which the object was created.

  • label (str) – Class label of the object.

  • bbox (Union[BBox, RBBox]) – Bounding box of the object.

  • confidence (Optional[float]) – Confidence of the object from detector.

  • track_id (int) – Unique ID for tracking the object. Default value is UNTRACKED_OBJECT_ID. It indicates the object has not been tracked.

  • parent (Optional[ObjectMeta]) – The parent object metadata.

  • attributes (Optional[List[AttributeMeta]]) – The list of additional attributes of object.

get_attr_meta_list(element_name, attr_name)

Returns a list of the object’s specified attributes.

Parameters:
  • element_name (str) – Attribute model name.

  • attr_name (str) – Attribute name.

Returns:

List of AttributeMeta or None if the object has no such attributes.

Return type:

Optional[List[AttributeMeta]]

get_attr_meta(element_name, attr_name)

Returns the specified attribute of the object.

Parameters:
  • element_name (str) – Attribute model name.

  • attr_name (str) – Attribute name.

Returns:

AttributeMeta or None if the object has no such attribute.

Return type:

Optional[AttributeMeta]

add_attr_meta(element_name, name, value, confidence=1.0)

Adds specified object attribute to object meta.

Parameters:
  • element_name (str) – attribute model name.

  • name (str) – attribute name.

  • value (Any) – attribute value.

  • confidence (float) – attribute confidence.

property label: str

Returns the object label.

Returns:

Object label.

property draw_label: str
property parent: ObjectMeta

Returns this object’s parent.

Returns:

Parent object.

property track_id: int

Returns unique ID to track the object. UNTRACKED_OBJECT_ID indicates the object has not been tracked.

Returns:

Unique ID for object.

property element_name: str

Returns the identifier of the element that created this object.

property is_primary: bool
property confidence: float

Returns object confidence.

Returns:

Object confidence.

property bbox: Optional[Union[BBox, RBBox]]

Returns bounding box of object or None if the object has no bounding box.

Returns:

Instance of a class that implements the BoundingBox interface. It can be RegularBoundingBox or RotatedBoundingBox

sync_bbox()
property uid: Optional[int]

Returns uid of the object.