GstTensorListMeta

While GstTensorMeta holds a single tensor set, which may contain multiple tensors (e.g., boxes, scores and classes from one inference run), GstTensorListMeta holds one or more items, each containing a tensor set (e.g., one item for each inference run on a different ROI).

Each item can also carry optional provenance, so downstream elements do not need to rely on the ordering of separate tensor metadata to associate results with their origins.

   GstTensorListMeta
     |
     +-- item 0
     |     +-- tensor A
     |     +-- tensor B
     |
     +-- item 1
           +-- tensor A
           +-- tensor B

Items are expected to represent instances of the same tensor group, although tensor dimensions may differ for dynamic dimensions. The number of items is independent of a batch or other dimension of the tensors.

Each item can also carry provenance independently of its current tensors. For example, a preprocessing element can create one batched input tensor from three regions of a video buffer:

   item 0
     |
     +-- tensor "image" [3, C, H, W]
     |
     +-- provenance
           +-- "image" -> [ 10, 11, 12 ]

Here 10, 11 and 12 can identify the GstAnalyticsTensorProvenanceMtd instances for the three input regions. The "image" key is the input tensor's ID, also stored in those provenance metadata instances.

An inference element can replace the input tensor with its output while keeping the provenance unchanged:

   item 0
     |
     +-- tensor "logits" [3, T, C]
     |
     +-- provenance
           +-- "image" -> [ 10, 11, 12 ]

The provenance key therefore does not need to identify a tensor currently stored in the item. Correlation IDs are kept in producer-defined order. How that order maps to tensor data is a producer/consumer contract and does not imply a particular tensor dimension.

This allows inference to preserve provenance without understanding the semantic mapping between its input and output tensors. gst_tensor_list_meta_append_item_from can be used to replace a tensor set while copying the provenance from an existing item.

GstTensorListItem

An opaque item containing a tensor set and its provenance information.

Since : 1.30


GstAnalytics.TensorListItem

An opaque item containing a tensor set and its provenance information.

Since : 1.30


GstAnalytics.TensorListItem

An opaque item containing a tensor set and its provenance information.

Since : 1.30


GstTensorListMeta

Each item represents an instance of the same tensor group. All items are expected to contain the same set of tensors, although tensor dimensions may differ for dynamic dimensions. This is a producer/consumer contract.

Each item contains one tensor set and its own provenance information. Provenance keys do not need to identify tensors currently stored in the item. Correlation IDs can be used to associate tensor data with GstAnalyticsTensorProvenanceMtd.

gst_tensor_list_meta_append_item_from replaces a tensor set while keeping the source item's provenance.

Members

meta (GstMeta) –

parent

group_id (GQuark) –

the representative tensor group ID

num_items (gsize) –

number of GstTensorListItem

items (GstTensorListItem **) –

a GstTensorListItem list

Since : 1.30


GstAnalytics.TensorListMeta

Each item represents an instance of the same tensor group. All items are expected to contain the same set of tensors, although tensor dimensions may differ for dynamic dimensions. This is a producer/consumer contract.

Each item contains one tensor set and its own provenance information. Provenance keys do not need to identify tensors currently stored in the item. Correlation IDs can be used to associate tensor data with GstAnalytics.TensorProvenanceMtd.

GstAnalytics.TensorListMeta.prototype.append_item_from replaces a tensor set while keeping the source item's provenance.

Members

meta (Gst.Meta) –

parent

group_id (GLib.Quark) –

the representative tensor group ID

num_items (Number) –

number of GstAnalytics.TensorListItem

Since : 1.30


GstAnalytics.TensorListMeta

Each item represents an instance of the same tensor group. All items are expected to contain the same set of tensors, although tensor dimensions may differ for dynamic dimensions. This is a producer/consumer contract.

Each item contains one tensor set and its own provenance information. Provenance keys do not need to identify tensors currently stored in the item. Correlation IDs can be used to associate tensor data with GstAnalytics.TensorProvenanceMtd.

GstAnalytics.TensorListMeta.append_item_from replaces a tensor set while keeping the source item's provenance.

Members

meta (Gst.Meta) –

parent

group_id (GLib.Quark) –

the representative tensor group ID

num_items (int) –

number of GstAnalytics.TensorListItem

Since : 1.30


Methods

gst_tensor_list_meta_append_item

gboolean
gst_tensor_list_meta_append_item (GstTensorListMeta * meta,
                                  gsize num_tensors,
                                  GstTensor ** tensors)

Appends a tensor set without correlation information. Ownership of tensors and its tensors is transferred only on success.

Parameters:

meta –

a GstTensorListMeta

num_tensors –

number of tensors

tensors ( [array length=num_tensors][transfer: full]) –

tensor set

Returns –

TRUE on success

Since : 1.30


GstAnalytics.TensorListMeta.prototype.append_item

function GstAnalytics.TensorListMeta.prototype.append_item(num_tensors: Number, tensors: [ GstAnalytics.Tensor ]): {
    // javascript wrapper for 'gst_tensor_list_meta_append_item'
}

Appends a tensor set without correlation information. Ownership of tensors and its tensors is transferred only on success.

Parameters:

num_tensors (Number) –

number of tensors

tensors ([ GstAnalytics.Tensor ]) –

tensor set

Returns (Number) –

true on success

Since : 1.30


GstAnalytics.TensorListMeta.append_item

def GstAnalytics.TensorListMeta.append_item (self, num_tensors, tensors):
    #python wrapper for 'gst_tensor_list_meta_append_item'

Appends a tensor set without correlation information. Ownership of tensors and its tensors is transferred only on success.

Parameters:

num_tensors (int) –

number of tensors

tensors ([ GstAnalytics.Tensor ]) –

tensor set

Returns (bool) –

True on success

Since : 1.30


gst_tensor_list_meta_append_item_from

gboolean
gst_tensor_list_meta_append_item_from (GstTensorListMeta * meta,
                                       gsize num_tensors,
                                       GstTensor ** tensors,
                                       const GstTensorListMeta * source,
                                       gsize source_item_index)

Appends a tensor set with provenance copied from the source item. Ownership of tensors and its tensors transfers only on success.

Parameters:

meta –

a GstTensorListMeta

num_tensors –

number of tensors

tensors ( [array length=num_tensors][transfer: full]) –

replacement tensor set

source ( [transfer: none]) –

source GstTensorListMeta

source_item_index –

item whose provenance should be copied

Returns –

TRUE on success

Since : 1.30


GstAnalytics.TensorListMeta.prototype.append_item_from

function GstAnalytics.TensorListMeta.prototype.append_item_from(num_tensors: Number, tensors: [ GstAnalytics.Tensor ], source: GstAnalytics.TensorListMeta, source_item_index: Number): {
    // javascript wrapper for 'gst_tensor_list_meta_append_item_from'
}

Appends a tensor set with provenance copied from the source item. Ownership of tensors and its tensors transfers only on success.

Parameters:

num_tensors (Number) –

number of tensors

tensors ([ GstAnalytics.Tensor ]) –

replacement tensor set

source_item_index (Number) –

item whose provenance should be copied

Returns (Number) –

true on success

Since : 1.30


GstAnalytics.TensorListMeta.append_item_from

def GstAnalytics.TensorListMeta.append_item_from (self, num_tensors, tensors, source, source_item_index):
    #python wrapper for 'gst_tensor_list_meta_append_item_from'

Appends a tensor set with provenance copied from the source item. Ownership of tensors and its tensors transfers only on success.

Parameters:

num_tensors (int) –

number of tensors

tensors ([ GstAnalytics.Tensor ]) –

replacement tensor set

source_item_index (int) –

item whose provenance should be copied

Returns (bool) –

True on success

Since : 1.30


gst_tensor_list_meta_append_item_full

gboolean
gst_tensor_list_meta_append_item_full (GstTensorListMeta * meta,
                                       gsize num_tensors,
                                       GstTensor ** tensors,
                                       gsize num_provenance,
                                       const GstTensorProvenance * provenance)

Appends a tensor set with provenance information. Keys are typically the originating input tensor IDs, but need not match any tensor in tensors. Keys must be non-zero and unique within the item, and correlation IDs must be non-zero.

The meta copies the provenance information. Ownership of tensors and its tensors transfers only on success.

Parameters:

meta –

a GstTensorListMeta

num_tensors –

number of tensors

tensors ( [array length=num_tensors][transfer: full]) –

tensor set

num_provenance –

number of provenance entries

provenance –

(array length=num_provenance) (nullable) (transfer none): caller-owned provenance descriptors

Returns –

TRUE on success

Since : 1.30


GstAnalytics.TensorListMeta.prototype.append_item_full

function GstAnalytics.TensorListMeta.prototype.append_item_full(num_tensors: Number, tensors: [ GstAnalytics.Tensor ], num_provenance: Number, provenance: [ GstAnalytics.TensorProvenance ]): {
    // javascript wrapper for 'gst_tensor_list_meta_append_item_full'
}

Appends a tensor set with provenance information. Keys are typically the originating input tensor IDs, but need not match any tensor in tensors. Keys must be non-zero and unique within the item, and correlation IDs must be non-zero.

The meta copies the provenance information. Ownership of tensors and its tensors transfers only on success.

Parameters:

num_tensors (Number) –

number of tensors

tensors ([ GstAnalytics.Tensor ]) –

tensor set

num_provenance (Number) –

number of provenance entries

provenance ([ GstAnalytics.TensorProvenance ]) –

(array length=num_provenance) (nullable) (transfer none): caller-owned provenance descriptors

Returns (Number) –

true on success

Since : 1.30


GstAnalytics.TensorListMeta.append_item_full

def GstAnalytics.TensorListMeta.append_item_full (self, num_tensors, tensors, num_provenance, provenance):
    #python wrapper for 'gst_tensor_list_meta_append_item_full'

Appends a tensor set with provenance information. Keys are typically the originating input tensor IDs, but need not match any tensor in tensors. Keys must be non-zero and unique within the item, and correlation IDs must be non-zero.

The meta copies the provenance information. Ownership of tensors and its tensors transfers only on success.

Parameters:

num_tensors (int) –

number of tensors

tensors ([ GstAnalytics.Tensor ]) –

tensor set

num_provenance (int) –

number of provenance entries

provenance ([ GstAnalytics.TensorProvenance ]) –

(array length=num_provenance) (nullable) (transfer none): caller-owned provenance descriptors

Returns (bool) –

True on success

Since : 1.30


gst_tensor_list_meta_get_num_provenance

gsize
gst_tensor_list_meta_get_num_provenance (GstTensorListMeta * meta,
                                         gsize item_index)

Gets the number of provenance entries for the specified item

Parameters:

meta –

a GstTensorListMeta

item_index –

item index

Returns –

the number of provenance entries

Since : 1.30


GstAnalytics.TensorListMeta.prototype.get_num_provenance

function GstAnalytics.TensorListMeta.prototype.get_num_provenance(item_index: Number): {
    // javascript wrapper for 'gst_tensor_list_meta_get_num_provenance'
}

Gets the number of provenance entries for the specified item

Parameters:

item_index (Number) –

item index

Returns (Number) –

the number of provenance entries

Since : 1.30


GstAnalytics.TensorListMeta.get_num_provenance

def GstAnalytics.TensorListMeta.get_num_provenance (self, item_index):
    #python wrapper for 'gst_tensor_list_meta_get_num_provenance'

Gets the number of provenance entries for the specified item

Parameters:

item_index (int) –

item index

Returns (int) –

the number of provenance entries

Since : 1.30


gst_tensor_list_meta_get_provenance

gboolean
gst_tensor_list_meta_get_provenance (GstTensorListMeta * meta,
                                     gsize item_index,
                                     gsize provenance_index,
                                     GstTensorProvenance * provenance)

Gets the provenance entry at the specified index. The returned correlation ID array belongs to meta and remains valid until meta is freed.

Parameters:

meta –

a GstTensorListMeta

item_index –

item index

provenance_index –

provenance entry index

provenance ( [out]) –

location for the provenance descriptor

Returns –

TRUE on success, otherwise FALSE

Since : 1.30


GstAnalytics.TensorListMeta.prototype.get_provenance

function GstAnalytics.TensorListMeta.prototype.get_provenance(item_index: Number, provenance_index: Number): {
    // javascript wrapper for 'gst_tensor_list_meta_get_provenance'
}

Gets the provenance entry at the specified index. The returned correlation ID array belongs to meta and remains valid until meta is freed.

Parameters:

item_index (Number) –

item index

provenance_index (Number) –

provenance entry index

Returns a tuple made of:

(Number ) –

true on success, otherwise false

provenance (GstAnalytics.TensorProvenance ) –

true on success, otherwise false

Since : 1.30


GstAnalytics.TensorListMeta.get_provenance

def GstAnalytics.TensorListMeta.get_provenance (self, item_index, provenance_index):
    #python wrapper for 'gst_tensor_list_meta_get_provenance'

Gets the provenance entry at the specified index. The returned correlation ID array belongs to meta and remains valid until meta is freed.

Parameters:

item_index (int) –

item index

provenance_index (int) –

provenance entry index

Returns a tuple made of:

(bool ) –

True on success, otherwise False

provenance (GstAnalytics.TensorProvenance ) –

True on success, otherwise False

Since : 1.30


gst_tensor_list_meta_get_typed_tensor

const GstTensor *
gst_tensor_list_meta_get_typed_tensor (GstTensorListMeta * meta,
                                       gsize item_index,
                                       GQuark tensor_id,
                                       GstTensorDataType data_type,
                                       GstTensorDimOrder order,
                                       gsize num_dims,
                                       const gsize * dims)

Gets the tensor identified by tensor_id from the specified item_index and verifies that it matches the expected type and dimensions.

Parameters:

meta –

a GstTensorListMeta

item_index –

item index

tensor_id –

tensor ID

data_type –

expected tensor data type

order –

expected tensor dimension order

num_dims –

expected number of dimensions

dims ( [array length=num_dims]) –

expected tensor dimensions

Returns ( [transfer: none][nullable]) –

the matching GstTensor, or NULL

Since : 1.30


GstAnalytics.TensorListMeta.prototype.get_typed_tensor

function GstAnalytics.TensorListMeta.prototype.get_typed_tensor(item_index: Number, tensor_id: GLib.Quark, data_type: GstAnalytics.TensorDataType, order: GstAnalytics.TensorDimOrder, num_dims: Number, dims: [ Number ]): {
    // javascript wrapper for 'gst_tensor_list_meta_get_typed_tensor'
}

Gets the tensor identified by tensor_id from the specified item_index and verifies that it matches the expected type and dimensions.

Parameters:

item_index (Number) –

item index

tensor_id (GLib.Quark) –

tensor ID

data_type (GstAnalytics.TensorDataType) –

expected tensor data type

expected tensor dimension order

num_dims (Number) –

expected number of dimensions

dims ([ Number ]) –

expected tensor dimensions

Returns (GstAnalytics.Tensor) –

the matching GstAnalytics.Tensor, or null

Since : 1.30


GstAnalytics.TensorListMeta.get_typed_tensor

def GstAnalytics.TensorListMeta.get_typed_tensor (self, item_index, tensor_id, data_type, order, num_dims, dims):
    #python wrapper for 'gst_tensor_list_meta_get_typed_tensor'

Gets the tensor identified by tensor_id from the specified item_index and verifies that it matches the expected type and dimensions.

Parameters:

item_index (int) –

item index

tensor_id (GLib.Quark) –

tensor ID

data_type (GstAnalytics.TensorDataType) –

expected tensor data type

expected tensor dimension order

num_dims (int) –

expected number of dimensions

dims ([ int ]) –

expected tensor dimensions

Returns (GstAnalytics.Tensor) –

the matching GstAnalytics.Tensor, or None

Since : 1.30


Functions

gst_tensor_list_meta_get_info

const GstMetaInfo *
gst_tensor_list_meta_get_info ()
Returns ( [transfer: none]) –

the tensor list meta information

Since : 1.30


GstTensorProvenance

Caller-owned descriptor for a provenance entry. Neither the descriptor nor its correlation ID array is transferred to GstTensorListMeta.

GstTensorListMeta copies the IDs when appending an item.

A preprocessing element typically uses the input tensor's ID as the key. The key is preserved when inference replaces the input tensors with outputs, so it need not identify a tensor in that item.

When filled by gst_tensor_list_meta_get_provenance, the correlation ID array belongs to GstTensorListMeta and remains valid until that meta is freed.

Members

key (GQuark) –

non-zero key, typically the ID of the originating input tensor

num_correlation_ids (gsize) –

number of correlation IDs

correlation_ids (const gint64 *) –

ordered correlation IDs, or NULL when num_correlation_ids is zero

Since : 1.30


GstAnalytics.TensorProvenance

Caller-owned descriptor for a provenance entry. Neither the descriptor nor its correlation ID array is transferred to GstAnalytics.TensorListMeta.

GstAnalytics.TensorListMeta copies the IDs when appending an item.

A preprocessing element typically uses the input tensor's ID as the key. The key is preserved when inference replaces the input tensors with outputs, so it need not identify a tensor in that item.

When filled by GstAnalytics.TensorListMeta.prototype.get_provenance, the correlation ID array belongs to GstAnalytics.TensorListMeta and remains valid until that meta is freed.

Members

key (GLib.Quark) –

non-zero key, typically the ID of the originating input tensor

num_correlation_ids (Number) –

number of correlation IDs

correlation_ids ([ Number ]) –

ordered correlation IDs, or null when num_correlation_ids is zero

Since : 1.30


GstAnalytics.TensorProvenance

Caller-owned descriptor for a provenance entry. Neither the descriptor nor its correlation ID array is transferred to GstAnalytics.TensorListMeta.

GstAnalytics.TensorListMeta copies the IDs when appending an item.

A preprocessing element typically uses the input tensor's ID as the key. The key is preserved when inference replaces the input tensors with outputs, so it need not identify a tensor in that item.

When filled by GstAnalytics.TensorListMeta.get_provenance, the correlation ID array belongs to GstAnalytics.TensorListMeta and remains valid until that meta is freed.

Members

key (GLib.Quark) –

non-zero key, typically the ID of the originating input tensor

num_correlation_ids (int) –

number of correlation IDs

correlation_ids ([ int ]) –

ordered correlation IDs, or None when num_correlation_ids is zero

Since : 1.30


Functions

gst_buffer_add_tensor_list_meta

GstTensorListMeta *
gst_buffer_add_tensor_list_meta (GstBuffer * buffer,
                                 GQuark group_id)

Adds a GstTensorListMeta to a buffer

Parameters:

buffer –

A GstBuffer

group_id –

A representative group ID of the GstTensorListMeta

Returns ( [transfer: none]) –

The new GstTensorListMeta

Since : 1.30


GstAnalytics.prototype.buffer_add_tensor_list_meta

function GstAnalytics.prototype.buffer_add_tensor_list_meta(buffer: Gst.Buffer, group_id: GLib.Quark): {
    // javascript wrapper for 'gst_buffer_add_tensor_list_meta'
}

Adds a GstAnalytics.TensorListMeta to a buffer

Parameters:

buffer (Gst.Buffer) –

A Gst.Buffer

group_id (GLib.Quark) –

A representative group ID of the GstTensorListMeta

Since : 1.30


GstAnalytics.buffer_add_tensor_list_meta

def GstAnalytics.buffer_add_tensor_list_meta (buffer, group_id):
    #python wrapper for 'gst_buffer_add_tensor_list_meta'

Adds a GstAnalytics.TensorListMeta to a buffer

Parameters:

buffer (Gst.Buffer) –

A Gst.Buffer

group_id (GLib.Quark) –

A representative group ID of the GstTensorListMeta

Since : 1.30


gst_buffer_get_tensor_list_meta

GstTensorListMeta *
gst_buffer_get_tensor_list_meta (GstBuffer * buffer)

Gets the GstTensorListMeta from a buffer

Parameters:

buffer –

A GstBuffer

Returns ( [nullable][transfer: none]) –

The GstTensorListMeta

Since : 1.30


GstAnalytics.prototype.buffer_get_tensor_list_meta

function GstAnalytics.prototype.buffer_get_tensor_list_meta(buffer: Gst.Buffer): {
    // javascript wrapper for 'gst_buffer_get_tensor_list_meta'
}

Gets the GstAnalytics.TensorListMeta from a buffer

Parameters:

buffer (Gst.Buffer) –

A Gst.Buffer

Since : 1.30


GstAnalytics.buffer_get_tensor_list_meta

def GstAnalytics.buffer_get_tensor_list_meta (buffer):
    #python wrapper for 'gst_buffer_get_tensor_list_meta'

Gets the GstAnalytics.TensorListMeta from a buffer

Parameters:

buffer (Gst.Buffer) –

A Gst.Buffer

Since : 1.30


gst_tensor_list_meta_api_get_type

GType
gst_tensor_list_meta_api_get_type ()
Returns –

the tensor list meta API type

Since : 1.30


Constants

GST_TENSOR_LIST_META_API_TYPE

#define GST_TENSOR_LIST_META_API_TYPE (gst_tensor_list_meta_api_get_type())

The tensor list meta API type.

Since : 1.30


GST_TENSOR_LIST_META_INFO

#define GST_TENSOR_LIST_META_INFO (gst_tensor_list_meta_get_info())

The tensor list meta information.

Since : 1.30


The results of the search are