GstAnalyticsVideoTensorLayout
Describes how a tensor's dimensions map onto a video frame's layout.
Members
format
(GstVideoFormat)
–
base GstVideoFormat declared or guessed for the tensor
width
(gint)
–
tensor width, or 0 if not applicable
height
(gint)
–
tensor height, or 0 if not applicable
channels
(gint)
–
number of channels
batch_dim
(gint)
–
index of the batch dimension in the tensor's dims array, or -1 when batch is implicit.
channels_dim
(gint)
–
index of the channels dimension, or -1 when the tensor has none
height_dim
(gint)
–
index of the height dimension
width_dim
(gint)
–
index of the width dimension
Since : 1.30
GstAnalytics.VideoTensorLayout
Describes how a tensor's dimensions map onto a video frame's layout.
Members
format
(GstVideo.VideoFormat)
–
base GstVideo.VideoFormat declared or guessed for the tensor
width
(Number)
–
tensor width, or 0 if not applicable
height
(Number)
–
tensor height, or 0 if not applicable
channels
(Number)
–
number of channels
batch_dim
(Number)
–
index of the batch dimension in the tensor's dims array, or -1 when batch is implicit.
channels_dim
(Number)
–
index of the channels dimension, or -1 when the tensor has none
height_dim
(Number)
–
index of the height dimension
width_dim
(Number)
–
index of the width dimension
Since : 1.30
GstAnalytics.VideoTensorLayout
Describes how a tensor's dimensions map onto a video frame's layout.
Members
format
(GstVideo.VideoFormat)
–
base GstVideo.VideoFormat declared or guessed for the tensor
width
(int)
–
tensor width, or 0 if not applicable
height
(int)
–
tensor height, or 0 if not applicable
channels
(int)
–
number of channels
batch_dim
(int)
–
index of the batch dimension in the tensor's dims array, or -1 when batch is implicit.
channels_dim
(int)
–
index of the channels dimension, or -1 when the tensor has none
height_dim
(int)
–
index of the height dimension
width_dim
(int)
–
index of the width dimension
Since : 1.30
Functions
gst_analytics_video_tensor_layout_from_caps
gboolean gst_analytics_video_tensor_layout_from_caps (const gsize * dims, gsize dims_count, const GstStructure * s, GstAnalyticsVideoTensorLayout * layout, GError ** error)
Guesses a GstAnalyticsVideoTensorLayout from a video format already declared in s, validating that dims agrees with the declared format's channel count and resolution.
Only formats whose memory layout maps directly onto a tensor are supported: no chroma subsampling, and either a single plane holding all components with no padding between pixels, or one plane per component.
Parameters:
dims
(
[array length=dims_count])
–
the tensor's dimensions
dims_count
–
number of entries in dims
s
–
the video/x-raw GstStructure declaring the tensor's format.
layout
(
[out])
–
filled in with the guessed layout,
layout->format is left as GST_VIDEO_FORMAT_UNKNOWN when s
declares no format field.
Since : 1.30
GstAnalytics.VideoTensorLayout.prototype.from_caps
function GstAnalytics.VideoTensorLayout.prototype.from_caps(dims: [ Number ], dims_count: Number, s: Gst.Structure): {
// javascript wrapper for 'gst_analytics_video_tensor_layout_from_caps'
}
Guesses a GstAnalytics.VideoTensorLayout from a video format already declared in s, validating that dims agrees with the declared format's channel count and resolution.
Only formats whose memory layout maps directly onto a tensor are supported: no chroma subsampling, and either a single plane holding all components with no padding between pixels, or one plane per component.
Parameters:
the tensor's dimensions
number of entries in dims
the video/x-raw Gst.Structure declaring the tensor's format.
Returns a tuple made of:
true on success, or when s declares no format at all, otherwise false with error set if s declares an unknown or unsupported format, or one that disagrees with dims
Since : 1.30
GstAnalytics.VideoTensorLayout.from_caps
@raises(GLib.GError)
def GstAnalytics.VideoTensorLayout.from_caps (dims, dims_count, s):
#python wrapper for 'gst_analytics_video_tensor_layout_from_caps'
Guesses a GstAnalytics.VideoTensorLayout from a video format already declared in s, validating that dims agrees with the declared format's channel count and resolution.
Only formats whose memory layout maps directly onto a tensor are supported: no chroma subsampling, and either a single plane holding all components with no padding between pixels, or one plane per component.
Parameters:
the tensor's dimensions
number of entries in dims
the video/x-raw Gst.Structure declaring the tensor's format.
Returns a tuple made of:
True on success, or when s declares no format at all, otherwise False with error set if s declares an unknown or unsupported format, or one that disagrees with dims
Since : 1.30
gst_analytics_video_tensor_layout_from_dims
gboolean gst_analytics_video_tensor_layout_from_dims (const gsize * dims, gsize dims_count, GstAnalyticsVideoTensorLayout * layout, GError ** error)
Guesses a GstAnalyticsVideoTensorLayout purely from a tensor's shape (2 to 4 dimensions), without any prior knowledge of its intended video format. On success use gst_analytics_video_format_guess afterward to map to a float32 variant when the tensor's data type calls for one.
Parameters:
dims
(
[array length=dims_count])
–
the tensor's dimensions
dims_count
–
number of entries in dims
layout
(
[out])
–
filled in with the guessed layout
Since : 1.30
GstAnalytics.VideoTensorLayout.prototype.from_dims
function GstAnalytics.VideoTensorLayout.prototype.from_dims(dims: [ Number ], dims_count: Number): {
// javascript wrapper for 'gst_analytics_video_tensor_layout_from_dims'
}
Guesses a GstAnalytics.VideoTensorLayout purely from a tensor's shape (2 to 4 dimensions), without any prior knowledge of its intended video format. On success use GstAnalytics.prototype.video_format_guess afterward to map to a float32 variant when the tensor's data type calls for one.
Parameters:
the tensor's dimensions
number of entries in dims
Returns a tuple made of:
true on success, false with error set if dims_count is out of range or the dims can't be interpreted as a video layout
Since : 1.30
GstAnalytics.VideoTensorLayout.from_dims
@raises(GLib.GError)
def GstAnalytics.VideoTensorLayout.from_dims (dims, dims_count):
#python wrapper for 'gst_analytics_video_tensor_layout_from_dims'
Guesses a GstAnalytics.VideoTensorLayout purely from a tensor's shape (2 to 4 dimensions), without any prior knowledge of its intended video format. On success use GstAnalytics.video_format_guess afterward to map to a float32 variant when the tensor's data type calls for one.
Returns a tuple made of:
True on success, False with error set if dims_count is out of range or the dims can't be interpreted as a video layout
Since : 1.30
Functions
gst_analytics_video_error_quark
GQuark gst_analytics_video_error_quark ()
Error domain for gst_analytics_video_ functions.
Since : 1.30
GstAnalytics.prototype.video_error_quark
function GstAnalytics.prototype.video_error_quark(): {
// javascript wrapper for 'gst_analytics_video_error_quark'
}
Error domain for gst_analytics_video_ functions.
Since : 1.30
GstAnalytics.video_error_quark
def GstAnalytics.video_error_quark ():
#python wrapper for 'gst_analytics_video_error_quark'
Error domain for gst_analytics_video_ functions.
Since : 1.30
gst_analytics_video_format_guess
gboolean gst_analytics_video_format_guess (GstVideoFormat base_format, GstTensorDataType data_type, GstVideoFormat * out_format, GError ** error)
Maps base_format to the concrete GstVideoFormat matching data_type:
unchanged for GST_TENSOR_DATA_TYPE_UINT8, or the corresponding
*_F32LE/*_F32BE variant for GST_TENSOR_DATA_TYPE_FLOAT32.
Parameters:
base_format
–
the format from gst_analytics_video_tensor_layout_from_dims or gst_analytics_video_tensor_layout_from_caps
data_type
–
the tensor's actual element data type
out_format
(
[out])
–
the concrete GstVideoFormat to negotiate
Since : 1.30
GstAnalytics.prototype.video_format_guess
function GstAnalytics.prototype.video_format_guess(base_format: GstVideo.VideoFormat, data_type: GstAnalytics.TensorDataType): {
// javascript wrapper for 'gst_analytics_video_format_guess'
}
Maps base_format to the concrete GstVideo.VideoFormat matching data_type:
unchanged for GstAnalytics.TensorDataType.UINT8, or the corresponding
*_F32LE/*_F32BE variant for GstAnalytics.TensorDataType.FLOAT32.
Parameters:
the format from GstAnalytics.VideoTensorLayout.prototype.from_dims or GstAnalytics.VideoTensorLayout.prototype.from_caps
the tensor's actual element data type
Returns a tuple made of:
Since : 1.30
GstAnalytics.video_format_guess
@raises(GLib.GError)
def GstAnalytics.video_format_guess (base_format, data_type):
#python wrapper for 'gst_analytics_video_format_guess'
Maps base_format to the concrete GstVideo.VideoFormat matching data_type:
unchanged for GstAnalytics.TensorDataType.UINT8, or the corresponding
*_F32LE/*_F32BE variant for GstAnalytics.TensorDataType.FLOAT32.
Parameters:
the format from GstAnalytics.VideoTensorLayout.from_dims or GstAnalytics.VideoTensorLayout.from_caps
the tensor's actual element data type
Returns a tuple made of:
Since : 1.30
gst_analytics_video_scales_offsets_are_identity
gboolean gst_analytics_video_scales_offsets_are_identity (const gdouble * scales, const gdouble * offsets, guint n_channels, GstTensorDataType data_type)
Checks whether every channel's (scale, offset) pair is close enough
to (1.0, 0.0) to be treated as a no-op normalization.
A channel is an identity when both |scale - 1.0| and |offset| are at
most an epsilon that depends on data_type:
- GST_TENSOR_DATA_TYPE_UINT8: Epsilon is 0.001.
- Any other data type: Epsilon is 1e-6.
Parameters:
scales
(
[array length=n_channels])
–
per-channel scale factors
offsets
(
[array length=n_channels])
–
per-channel offsets
n_channels
–
number of channels
data_type
–
the tensor's data type, selecting the epsilon within which a
(scale, offset) pair is treated as (1.0, 0.0)
TRUE if normalization would be a no-op for all channels
Since : 1.30
GstAnalytics.prototype.video_scales_offsets_are_identity
function GstAnalytics.prototype.video_scales_offsets_are_identity(scales: [ Number ], offsets: [ Number ], n_channels: Number, data_type: GstAnalytics.TensorDataType): {
// javascript wrapper for 'gst_analytics_video_scales_offsets_are_identity'
}
Checks whether every channel's (scale, offset) pair is close enough
to (1.0, 0.0) to be treated as a no-op normalization.
A channel is an identity when both |scale - 1.0| and |offset| are at
most an epsilon that depends on data_type:
- GstAnalytics.TensorDataType.UINT8: Epsilon is 0.001.
- Any other data type: Epsilon is 1e-6.
Parameters:
per-channel scale factors
per-channel offsets
number of channels
the tensor's data type, selecting the epsilon within which a
(scale, offset) pair is treated as (1.0, 0.0)
Since : 1.30
GstAnalytics.video_scales_offsets_are_identity
def GstAnalytics.video_scales_offsets_are_identity (scales, offsets, n_channels, data_type):
#python wrapper for 'gst_analytics_video_scales_offsets_are_identity'
Checks whether every channel's (scale, offset) pair is close enough
to (1.0, 0.0) to be treated as a no-op normalization.
A channel is an identity when both |scale - 1.0| and |offset| are at
most an epsilon that depends on data_type:
- GstAnalytics.TensorDataType.UINT8: Epsilon is 0.001.
- Any other data type: Epsilon is 1e-6.
Parameters:
per-channel scale factors
per-channel offsets
number of channels
the tensor's data type, selecting the epsilon within which a
(scale, offset) pair is treated as (1.0, 0.0)
Since : 1.30
Enumerations
GstAnalyticsVideoError
Error codes for the GST_ANALYTICS_VIDEO_ERROR domain.
Members
GST_ANALYTICS_VIDEO_ERROR_UNSUPPORTED_DIMS
(0)
–
the tensor dims can't be interpreted as a video frame
GST_ANALYTICS_VIDEO_ERROR_UNSUPPORTED_FORMAT
(1)
–
the video format can't be used for the tensor
GST_ANALYTICS_VIDEO_ERROR_CAPS_MISMATCH
(2)
–
the caps disagree with the tensor dims
Since : 1.30
GstAnalytics.VideoError
Error codes for the GST_ANALYTICS_VIDEO_ERROR (not introspectable) domain.
Members
GstAnalytics.VideoError.UNSUPPORTED_DIMS
(0)
–
the tensor dims can't be interpreted as a video frame
GstAnalytics.VideoError.UNSUPPORTED_FORMAT
(1)
–
the video format can't be used for the tensor
GstAnalytics.VideoError.CAPS_MISMATCH
(2)
–
the caps disagree with the tensor dims
Since : 1.30
GstAnalytics.VideoError
Error codes for the GST_ANALYTICS_VIDEO_ERROR (not introspectable) domain.
Members
GstAnalytics.VideoError.UNSUPPORTED_DIMS
(0)
–
the tensor dims can't be interpreted as a video frame
GstAnalytics.VideoError.UNSUPPORTED_FORMAT
(1)
–
the video format can't be used for the tensor
GstAnalytics.VideoError.CAPS_MISMATCH
(2)
–
the caps disagree with the tensor dims
Since : 1.30
Constants
GST_ANALYTICS_VIDEO_ERROR
#define GST_ANALYTICS_VIDEO_ERROR (gst_analytics_video_error_quark ())
Error domain for gst_analytics_video_ functions.
Since : 1.30
GST_ANALYTICS_VIDEO_FORMAT_GRAY_F32
#define GST_ANALYTICS_VIDEO_FORMAT_GRAY_F32 GST_VIDEO_FORMAT_GRAY_F32LE
Native endian variant of GST_VIDEO_FORMAT_GRAY_F32LE or GST_VIDEO_FORMAT_GRAY_F32BE.
Since : 1.30
GST_ANALYTICS_VIDEO_FORMAT_RGBP_F32
#define GST_ANALYTICS_VIDEO_FORMAT_RGBP_F32 GST_VIDEO_FORMAT_RGBP_F32LE
Native endian variant of GST_VIDEO_FORMAT_RGBP_F32LE or GST_VIDEO_FORMAT_RGBP_F32BE.
Since : 1.30
GST_ANALYTICS_VIDEO_FORMAT_RGB_F32
#define GST_ANALYTICS_VIDEO_FORMAT_RGB_F32 GST_VIDEO_FORMAT_RGB_F32LE
Native endian variant of GST_VIDEO_FORMAT_RGB_F32LE or GST_VIDEO_FORMAT_RGB_F32BE.
Since : 1.30
The results of the search are