Spaces:
Runtime error
Runtime error
File size: 736 Bytes
210ae8c |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 |
import norfair
import numpy as np
def draw(
paths_drawer,
track_points,
frame,
detections,
tracked_objects,
coord_transformations,
fix_paths,
):
if track_points == "centroid":
norfair.draw_points(frame, detections)
norfair.draw_tracked_objects(frame, tracked_objects)
elif track_points == "bbox":
norfair.draw_boxes(frame, detections)
norfair.draw_tracked_boxes(frame, tracked_objects)
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)
return frame
def center(points):
return [np.mean(np.array(points), axis=0)]
|