vits14-postproc-overlay

Attributes

log_file_path

logger

INPUT_HEIGHT

INPUT_WIDTH

OUTPUT_WIDTH

OUTPUT_HEIGHT

To use Metadata fieds from the input buffers:

plugin_name

Classes

MyPlugin

A Python based gstreamer plugin template. Enables the user to:

Module Contents

vits14-postproc-overlay.log_file_path = '/var/log/simaai.log'
vits14-postproc-overlay.logger
vits14-postproc-overlay.INPUT_HEIGHT = 224
vits14-postproc-overlay.INPUT_WIDTH = 224
vits14-postproc-overlay.OUTPUT_WIDTH = 1280
vits14-postproc-overlay.OUTPUT_HEIGHT = 720

To use Metadata fieds from the input buffers: Parse the MetaStruct object. It has the following 4 fields: class MetaStruct:

def __init__(self, buffer_name, stream_id, timestamp, frame_id):

self.buffer_name = buffer_name self.stream_id = stream_id self.timestamp = timestamp self.frame_id = frame_id

vits14-postproc-overlay.plugin_name = 'vits14-postproc-overlay'
class vits14-postproc-overlay.MyPlugin

A Python based gstreamer plugin template. Enables the user to: - Accept incoming buffers from dynamic pads - Define any custom plugin runtime logic User has to only override the run() function

frame_id = 0
out_width_aligned = 1280
out_height_aligned = 720
outsize = 1382400.0
round_up_to_multiple(value, base=8)
softmax(logits)
postprocess(tensor: numpy.ndarray) list
get_nv12(image: numpy.ndarray) numpy.ndarray
label_image(image: numpy.ndarray, result: list) numpy.ndarray
run(input_buffers: List[python_plugin_template.SimaaiPythonBuffer], output_buffer: bytes) None

Input: input_buffers: List[Gst.Buffer] List of input buffers, source from each pad. output_buffer: Gst.Buffer Output buffer that needs to be overwritten.

Implement your logic within this function. Process the input buffers, and modify the output buffer.