SDK ML Python bindings API

class metavision_sdk_ml.DataAssociation(self: metavision_sdk_ml.DataAssociation, width: int, height: int, nb_classes: int, detection_update_weight: float = 0.699999988079071, deletion_time: int = 100000, max_iou_inter_track: float = 0.5, iou_to_match_a_detection: float = 0.20000000298023224, max_iou_for_one_det_to_many_tracks: float = 0.5, use_descriptor: bool = False, number_of_consecutive_detections_to_create_a_new_track: int = 1, time_surface_delta_t: int = 200000, update_tracklets_between_detections: bool = True, tracking_confidence_decay: float = 0.8999999761581421, sim_matrix: numpy.ndarray[numpy.float32] = array([], dtype=float32)) None

Module that matches detections with computed tracklets.

DetectionBox

The type of detection bounding box to process

Constructor.

conf

The configuration parameters

static get_empty_output_buffer() metavision_sdk_core.EventTrackedBoxBuffer

This function returns an empty buffer of events of the correct type, which can later on be used as output_buf when calling process_events()

process_events(self: metavision_sdk_ml.DataAssociation, ts: int, events_np: numpy.ndarray[metavision_sdk_base._EventCD_decode], boxes_np: numpy.ndarray[Metavision::EventBbox], output_tracks_buf: metavision_sdk_core.EventTrackedBoxBuffer) None

Computes the data association and outputs updated set of tracked boxes

:param : ts: (int) current timestamp to process :param : events_np: input chunk of events (numpy structured array of EventCD) :param : boxes_np: input detections (numpy structured array of EventBbox) :param : output_tracks_buf: output buffer of tracked boxes. It can be converted to a numpy structured array of EventTrackedBox using .numpy()

class metavision_sdk_ml.NonMaximumSuppression(self: metavision_sdk_ml.NonMaximumSuppression, num_classes: int, iou_threshold: float = 0.5, scale_width: float = 1.0, scale_height: float = 1.0) None

Class to filter and rescale bounding boxes following the non-maximum suppression algorithm to remove overlapping boxes.

Constructor.

num_classes

Number of possible class for input boxes

iou_threshold

Threshold on IOU metrics to consider that two boxes are matching

scale_width

Factor to apply to horizontal coordinates of the output boxes

scale_height

Factor to apply to vertical coordinates of the output boxes

static get_empty_output_buffer() metavision_sdk_core.EventBboxBuffer

This function returns an empty buffer of events of the correct type, which can later on be used as output_buf when calling process_events()

ignore_class_id(self: metavision_sdk_ml.NonMaximumSuppression, class_id: int) None

Configures the computation to ignore input boxes from a given class.

class_id

Identifier of the class to be ignored

process_events(*args, **kwargs)

Overloaded function.

  1. process_events(self: metavision_sdk_ml.NonMaximumSuppression, input_np: numpy.ndarray[Metavision::EventBbox], output_buf: metavision_sdk_core.EventBboxBuffer) -> None

This method is used to apply the current algorithm on a chunk of events. It takes a numpy array as input and writes the results into the specified output event buffer
input_np

input chunk of events (numpy structured array whose fields are (‘x’, ‘y’, ‘p’, ‘t’). Note that this order is mandatory)

output_buf

output buffer of events. It can be converted to a numpy structured array using .numpy()

  1. process_events(self: metavision_sdk_ml.NonMaximumSuppression, input_buf: metavision_sdk_core.EventBboxBuffer, output_buf: metavision_sdk_core.EventBboxBuffer) -> None

This method is used to apply the current algorithm on a chunk of events. It takes an event buffer as input and writes the results into a distinct output event buffer
input_buf

input chunk of events (event buffer)

output_buf

output buffer of events. It can be converted to a numpy structured array using .numpy()