diegofernandezc's picture
fix drawing to include ids
2f7897e
import norfair
import numpy as np
def draw(
paths_drawer,
track_points,
frame,
detections,
tracked_objects,
coord_transformations,
fix_paths,
):
if fix_paths:
frame = paths_drawer.draw(frame, tracked_objects, coord_transformations)
elif paths_drawer is not None:
frame = paths_drawer.draw(frame, tracked_objects)
if track_points == "centroid":
frame = norfair.draw_points(frame, tracked_objects, draw_ids=True)
elif track_points == "bbox":
frame = norfair.draw_boxes(frame, tracked_objects, draw_ids=True)
return frame
def center(points):
return [np.mean(np.array(points), axis=0)]