yolov7_postproc_overlay

Attributes

plugin_name

CLASSNAMES

COLORS

Classes

PostProcOpt

MyPlugin

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

Module Contents

yolov7_postproc_overlay.plugin_name = 'python_plugin'
yolov7_postproc_overlay.CLASSNAMES = ['person', 'bicycle', 'car', 'motorcycle', 'airplane', 'bus', 'train', 'truck', 'boat', 'traffic...
yolov7_postproc_overlay.COLORS
class yolov7_postproc_overlay.PostProcOpt(plugin, confidence_thres, iou_thres)
plugin
confidence_thres
iou_thres
grid_cells
final_buffer
post_process_optimized(model_output)
class yolov7_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

MODEL_WIDTH = 640
MODEL_HEIGHT = 640
FRAME_WIDTH = 1280
FRAME_HEIGHT = 720
classes = 80
color_palette
confidence_thres = 0.25
iou_thres = 0.65
boxes = []
scores = []
class_ids = []
out_size = 0
frame_id = 0
model_outs = [(1, 80, 80, 6), (1, 80, 80, 6), (1, 80, 80, 243), (1, 40, 40, 6), (1, 40, 40, 6), (1, 40, 40,...
post_proc_opt
compute_iou(box, boxes)
nms(boxes, scores, iou_threshold)
rescale_boxes(boxes, input_width, input_height, target_width, target_height)
xywh2xyxy(x)
extract_boxes(boxes)
get_model_outputs(input_buffer)
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.