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 (BBox | RBBox) – Bounding box of the object.

  • confidence (float | None) – 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 (ObjectMeta | None) – The parent object metadata.

  • attributes (Iterable[AttributeMeta] | None) – The list of object attributes.

get_attr_meta_list(element_name, attr_name)

Returns attributes (multi-label case).

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:

List[AttributeMeta] | None

get_attr_meta(element_name, attr_name)

Returns attribute.

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:

AttributeMeta | None

replace_attr_meta_list(element_name, attr_name, value)

Replaces attributes with a new list.

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

  • attr_name (str) – Attribute name.

  • value (List[AttributeMeta]) – List of AttributeMeta.

remove_attr_meta_list(element_name, attr_name)

Removes attributes.

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

  • attr_name (str) – Attribute name.

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

Adds attribute to the object.

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

  • name (str) – Attribute name.

  • value (Any) – Attribute value.

  • confidence (float) – Attribute confidence.

  • replace (bool) – Replace attribute if it already exists.

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: BBox | RBBox | None

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: int | None

Returns uid of the object.