Functions

buffer_add_analytics_batch_meta (buffer)

buffer_add_analytics_relation_meta (buffer)

buffer_add_analytics_relation_meta_full (buffer, init_params)

buffer_add_tensor_meta (buffer)

buffer_get_analytics_batch_meta (buffer)

buffer_get_analytics_relation_meta (buffer)

buffer_get_tensor_meta (buffer)

cls_mtd_get_mtd_type ()

image_util_iou_float (bb1_x, bb1_y, bb1_w, bb1_h, bb2_x, bb2_y, bb2_w, bb2_h)

image_util_iou_int (bb1_x, bb1_y, bb1_w, bb1_h, bb2_x, bb2_y, bb2_w, bb2_h)

modelinfo_load (model_filename)

mtd_type_get_name (type)

od_mtd_get_mtd_type ()

relation_get_length (instance)

relation_meta_api_get_type ()

segmentation_mtd_get_mtd_type ()

tensor_data_type_get_name (data_type)

tensor_mtd_get_mtd_type ()

tracking_mtd_get_mtd_type ()

Details

GstAnalytics.buffer_add_analytics_batch_meta(buffer)
Parameters:

buffer (Gst.Buffer) – A writable Gst.Buffer

Returns:

The new GstAnalytics.BatchMeta

Return type:

GstAnalytics.BatchMeta

Adds a GstAnalytics.BatchMeta to a buffer or returns the existing one

New in version 1.28.

GstAnalytics.buffer_add_analytics_relation_meta(buffer)
Parameters:

buffer (Gst.Buffer) – a Gst.Buffer

Returns:

Newly attached GstAnalytics.RelationMeta

Return type:

GstAnalytics.RelationMeta or None

Attach a analysis-results-meta-relation meta (GstAnalytics.RelationMeta)to buffer.

A GstAnalytics.RelationMeta is a metadata describing relation between other analysis meta. It’s more efficient to use GstAnalytics.buffer_add_analytics_relation_meta_full and providing the maximum number of analysis meta that will attached to a buffer.

New in version 1.24.

GstAnalytics.buffer_add_analytics_relation_meta_full(buffer, init_params)
Parameters:
Returns:

Newly attached GstAnalytics.RelationMeta

Return type:

GstAnalytics.RelationMeta or None

Attache a analysis-results relation-meta (GstAnalytics.RelationMeta) to buffer.

A GstAnalytics.RelationMeta is a metadata describing relation between other analysis meta.

New in version 1.24.

GstAnalytics.buffer_add_tensor_meta(buffer)
Parameters:

buffer (Gst.Buffer) – A writable Gst.Buffer

Returns:

The new GstAnalytics.TensorMeta

Return type:

GstAnalytics.TensorMeta

Adds a GstAnalytics.TensorMeta to a buffer

New in version 1.26.

GstAnalytics.buffer_get_analytics_batch_meta(buffer)
Parameters:

buffer (Gst.Buffer) – A Gst.Buffer

Returns:

The GstAnalytics.BatchMeta if there is one

Return type:

GstAnalytics.BatchMeta or None

Gets the GstAnalytics.BatchMeta from a buffer

New in version 1.28.

GstAnalytics.buffer_get_analytics_relation_meta(buffer)
Parameters:

buffer (Gst.Buffer) – a Gst.Buffer

Returns:

The GstAnalytics.RelationMeta if there is one

Return type:

GstAnalytics.RelationMeta or None

Retrives the meta or None if it doesn’t exist

New in version 1.24.

GstAnalytics.buffer_get_tensor_meta(buffer)
Parameters:

buffer (Gst.Buffer) – A Gst.Buffer

Returns:

The GstAnalytics.TensorMeta if there is wone

Return type:

GstAnalytics.TensorMeta or None

Gets the GstAnalytics.TensorMeta from a buffer

New in version 1.26.

GstAnalytics.cls_mtd_get_mtd_type()
Returns:

opaque id of GstAnalytics.Mtd type

Return type:

int

Get an id identifying GstAnalytics.Mtd type.

New in version 1.24.

GstAnalytics.image_util_iou_float(bb1_x, bb1_y, bb1_w, bb1_h, bb2_x, bb2_y, bb2_w, bb2_h)
Parameters:
  • bb1_x (float) – Bounding box 1, X coordinate

  • bb1_y (float) – Bounding box 1, Y coordinate

  • bb1_w (float) – Bounding box 1, width

  • bb1_h (float) – Bounding box 1, height

  • bb2_x (float) – Bounding box 2, X coordinate

  • bb2_y (float) – Bounding box 2, Y coordinate

  • bb2_w (float) – Bounding box 2, width

  • bb2_h (float) – Bounding box 2, height

Returns:

IoU of bb1 and bb2.

Return type:

float

Calculate the intersection over the union (IoU) of the two areas defined by the bounding box 1 and bounding box 2. IoU is a measure of how much two regions overlap.

New in version 1.28.

GstAnalytics.image_util_iou_int(bb1_x, bb1_y, bb1_w, bb1_h, bb2_x, bb2_y, bb2_w, bb2_h)
Parameters:
  • bb1_x (int) – Bounding box 1, X coordinate

  • bb1_y (int) – Bounding box 1, Y coordinate

  • bb1_w (int) – Bounding box 1, width

  • bb1_h (int) – Bounding box 1, height

  • bb2_x (int) – Bounding box 2, X coordinate

  • bb2_y (int) – Bounding box 2, Y coordinate

  • bb2_w (int) – Bounding box 2, width

  • bb2_h (int) – Bounding box 2, height

Returns:

IoU of bb1 and bb2.

Return type:

float

Calculate the intersection over the union (IoU) of the two areas defined by the bounding box 1 and bounding box 2. IoU is a measure of how much two regions overlap.

New in version 1.28.

GstAnalytics.modelinfo_load(model_filename)
Parameters:

model_filename (str) – Path to the model file (e.g., “model.onnx”, “model.tflite”)

Returns:

A new GstAnalytics.ModelInfo instance, or None if the modelinfo file could not be found or loaded.

Return type:

GstAnalytics.ModelInfo or None

Load a modelinfo file associated with the given model file.

This function attempts to load a .modelinfo file in the following order:

{model_filename}.modelinfo

{model_filename_without_extension}.modelinfo

The modelinfo file contains metadata for the model’s input and output tensors, including normalization ranges, dimension ordering, tensor IDs, etc.

The loaded modelinfo must be freed with GstAnalytics.ModelInfo.free() when no longer needed.

New in version 1.28.

GstAnalytics.mtd_type_get_name(type)
Parameters:

type (int) – The type of analytics data

Returns:

the name

Return type:

str

Gets the string version of the name of this type of analytics data

New in version 1.24.

GstAnalytics.od_mtd_get_mtd_type()
Returns:

Opaque id of the GstAnalytics.Mtd type

Return type:

int

Get an id that represent object-detection metadata type

New in version 1.24.

GstAnalytics.relation_get_length(instance)
Parameters:

instance (GstAnalytics.RelationMeta) – Instance of GstAnalytics.RelationMeta

Returns:

Number of analysis-meta attached to this instance.

Return type:

int

Get number of relatable meta attached to instance

New in version 1.24.

GstAnalytics.relation_meta_api_get_type()
Returns:

GObject.GType of GstAnalytics.RelationMeta

Return type:

GObject.GType

New in version 1.24.

GstAnalytics.segmentation_mtd_get_mtd_type()
Returns:

A #GstAnalyticsMtdType type

Return type:

int

Get an instance of #GstAnalyticsMtdType that represent segmentation metadata type.

New in version 1.26.

GstAnalytics.tensor_data_type_get_name(data_type)
Parameters:

data_type (GstAnalytics.TensorDataType) – a GstAnalytics.TensorDataType

Returns:

a constant string with the name of the data type

Return type:

str

Get a string version of the data type

New in version 1.28.

GstAnalytics.tensor_mtd_get_mtd_type()
Returns:

Opaque id of the GstAnalytics.Mtd type

Return type:

int

Get an id that represent tensor metadata type

New in version 1.28.

GstAnalytics.tracking_mtd_get_mtd_type()
Returns:

id representing the type of GstAnalyticsRelatableMtd

Get the opaque id identifying the relatable type

Return type:

int

New in version 1.24.