GstAnalytics.RelationMeta

Fields

None

Methods

add_cls_mtd (confidence_levels, class_quarks)

add_od_mtd (type, x, y, w, h, loc_conf_lvl)

add_one_cls_mtd (confidence_level, class_quark)

add_tracking_mtd (tracking_id, tracking_first_seen)

exist (an_meta_first_id, an_meta_second_id, max_relation_span, cond_types)

get_cls_mtd (an_meta_id)

get_direct_related (an_meta_id, relation_type, type, state, rlt_mtd)

get_mtd (an_meta_id, type)

get_od_mtd (an_meta_id)

get_relation (an_meta_first_id, an_meta_second_id)

get_tracking_mtd (an_meta_id)

iterate (state, type, rlt_mtd)

set_relation (type, an_meta_first_id, an_meta_second_id)

Details

class GstAnalytics.RelationMeta

An opaque Gst.Meta that can be used to hold various types of results from analysis processes.

The content should be accessed through the API.

New in version 1.24.

add_cls_mtd(confidence_levels, class_quarks)
Parameters:
  • confidence_levels ([float]) – confidence levels

  • class_quarks ([int]) – labels of this classification. Order define index, quark, labels relation. This array need to exist as long has this classification meta exist.

Returns:

Added successfully

cls_mtd:

Handle updated to newly added classification meta.

Return type:

(bool, cls_mtd: GstAnalytics.ClsMtd)

Add analytic classification metadata to self.

New in version 1.24.

add_od_mtd(type, x, y, w, h, loc_conf_lvl)
Parameters:
  • type (int) – Quark of the object type

  • x (int) – x component of bounding box upper-left corner

  • y (int) – y component of bounding box upper-left corner

  • w (int) – bounding box width

  • h (int) – bounding box height

  • loc_conf_lvl (float) – confidence level on the object location

Returns:

Added successfully

od_mtd:

Handle updated with newly added object detection meta. Add an object-detetion metadata to self.

Return type:

(bool, od_mtd: GstAnalytics.ODMtd or None)

New in version 1.24.

add_one_cls_mtd(confidence_level, class_quark)
Parameters:
  • confidence_level (float) – confidence levels

  • class_quark (int) – labels of this classification. Order define index, quark, labels relation. This array need to exist as long has this classification meta exist.

Returns:

Added successfully

cls_mtd:

Handle updated to newly added classification meta.

Return type:

(bool, cls_mtd: GstAnalytics.ClsMtd)

Add analytic classification metadata to self.

New in version 1.24.

add_tracking_mtd(tracking_id, tracking_first_seen)
Parameters:
  • tracking_id (int) – Tracking id

  • tracking_first_seen (int) – Timestamp of first time the object was observed.

Returns:

Added successfully

trk_mtd:

Handle updated with newly added tracking meta. Add an analytic tracking metadata to self.

Return type:

(bool, trk_mtd: GstAnalytics.TrackingMtd)

New in version 1.24.

exist(an_meta_first_id, an_meta_second_id, max_relation_span, cond_types)
Parameters:
  • an_meta_first_id (int) – First analysis-meta

  • an_meta_second_id (int) – Second analysis-meta

  • max_relation_span (int) – Maximum number of relation between an_meta_first_id and an_meta_second_id. A value of 1 mean only only consider direct relation.

  • cond_types (GstAnalytics.RelTypes) – condition on relation types.

Returns:

True if a relation between exit between an_meta_first_id and an_meta_second_id, otherwise False.

relations_path:

If not None this list will be filled with relation path between an_meta_first_id and an_meta_second_id. List value should be access with GLib.SList API. Use GPOINTER_TO_INT(iter->data) where iter is a GLib.SList element to get analysis-meta id on the relation path. Free this list with g_slist_free (relations_path) after using.

Return type:

(bool, relations_path: [int])

Verify existence of relation(s) between an_meta_first_d and an_meta_second_id according to relation condition cond_types. It optionally also return a shortest path of relations ( compliant with cond_types) between an_meta_first_id and an_meta_second_id.

New in version 1.24.

get_cls_mtd(an_meta_id)
Parameters:

an_meta_id (int) – Id of GstAnalytics.ClsMtd instance to retrieve

Returns:

True if successful.

rlt:

Will be filled with relatable meta

Return type:

(bool, rlt: GstAnalytics.ClsMtd)

Fill rlt if a analytics-meta with id == an_meta_id exist in self instance, otherwise this method return False and rlt is invalid.

New in version 1.24.

Parameters:
  • an_meta_id (int) – Id of GstAnalytics.Mtd involved in relation to query

  • relation_type (GstAnalytics.RelTypes) – Type of relation to filter on.

  • type (int) – Type of GstAnalytics.Mtd to filter on

  • state (object) – Opaque data to store state of the query. If state point to None, the first analytics-metadata directly related to an_meta_id will be set in rlt_mtd. Doesn’t need to be free.

  • rlt_mtd (GstAnalytics.Mtd) – Handle updated to directly related relatable meta.

Returns:

True if rlt_mtd was updated, other wise False

state:

Opaque data to store state of the query. If state point to None, the first analytics-metadata directly related to an_meta_id will be set in rlt_mtd. Doesn’t need to be free.

Return type:

(bool, state: object)

New in version 1.24.

get_mtd(an_meta_id, type)
Parameters:
Returns:

True if successful.

rlt:

Will be filled with relatable meta

Return type:

(bool, rlt: GstAnalytics.Mtd)

Fill rlt if a analytics-meta with id == an_meta_id exist in self instance, otherwise this method return False and rlt is invalid.

New in version 1.24.

get_od_mtd(an_meta_id)
Parameters:

an_meta_id (int) – Id of GstAnalytics.ODMtd instance to retrieve

Returns:

True if successful.

rlt:

Will be filled with relatable meta

Return type:

(bool, rlt: GstAnalytics.ODMtd)

Fill rlt if a analytics-meta with id == an_meta_id exist in self instance, otherwise this method return False and rlt is invalid.

New in version 1.24.

get_relation(an_meta_first_id, an_meta_second_id)
Parameters:
  • an_meta_first_id (int) – Id of first analysis-meta

  • an_meta_second_id (int) – Id of second analysis-meta

Returns:

relation description between first and second analysis-meta.

Return type:

GstAnalytics.RelTypes

Get relations between first and second analysis-meta. Ids (an_meta_first_id and an_meta_second_id) must be from a call to gst_analytics_mtd_get_id (handle).

New in version 1.24.

get_tracking_mtd(an_meta_id)
Parameters:

an_meta_id (int) – Id of GstAnalytics.Mtd instance to retrieve

Returns:

True if successful.

rlt:

Will be filled with relatable meta

Return type:

(bool, rlt: GstAnalytics.TrackingMtd)

Fill rlt if a analytics-meta with id == an_meta_id exist in self instance, otherwise this method return False and rlt is invalid.

New in version 1.24.

iterate(state, type, rlt_mtd)
Parameters:
Returns:

False if end was reached and iteration is completed.

Return type:

bool

New in version 1.24.

set_relation(type, an_meta_first_id, an_meta_second_id)
Parameters:
Returns:

True on success and False on failure.

Return type:

bool

Sets the relation (GstAnalytics.RelTypes) between an_meta_first and an_meta_second. Ids must have been obtained a call to gst_analytics_mtd_get_id(handle).

New in version 1.24.