|
|
@ -43,31 +43,31 @@ def update_tracker(target_detector, image): |
|
|
|
|
|
|
|
|
|
|
|
bbox_xywh = [] |
|
|
|
bbox_xywh = [] |
|
|
|
confs = [] |
|
|
|
confs = [] |
|
|
|
|
|
|
|
bboxes2draw = [] |
|
|
|
|
|
|
|
face_bboxes = [] |
|
|
|
|
|
|
|
if len(bboxes): |
|
|
|
|
|
|
|
|
|
|
|
# Adapt detections to deep sort input format |
|
|
|
# Adapt detections to deep sort input format |
|
|
|
for x1, y1, x2, y2, _, conf in bboxes: |
|
|
|
for x1, y1, x2, y2, _, conf in bboxes: |
|
|
|
|
|
|
|
|
|
|
|
obj = [ |
|
|
|
obj = [ |
|
|
|
int((x1+x2)/2), int((y1+y2)/2), |
|
|
|
int((x1+x2)/2), int((y1+y2)/2), |
|
|
|
x2-x1, y2-y1 |
|
|
|
x2-x1, y2-y1 |
|
|
|
] |
|
|
|
] |
|
|
|
bbox_xywh.append(obj) |
|
|
|
bbox_xywh.append(obj) |
|
|
|
confs.append(conf) |
|
|
|
confs.append(conf) |
|
|
|
|
|
|
|
|
|
|
|
xywhs = torch.Tensor(bbox_xywh) |
|
|
|
|
|
|
|
confss = torch.Tensor(confs) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Pass detections to deepsort |
|
|
|
xywhs = torch.Tensor(bbox_xywh) |
|
|
|
outputs = deepsort.update(xywhs, confss, image) |
|
|
|
confss = torch.Tensor(confs) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
# Pass detections to deepsort |
|
|
|
|
|
|
|
outputs = deepsort.update(xywhs, confss, image) |
|
|
|
|
|
|
|
|
|
|
|
bboxes2draw = [] |
|
|
|
for value in list(outputs): |
|
|
|
face_bboxes = [] |
|
|
|
x1,y1,x2,y2,track_id = value |
|
|
|
for value in list(outputs): |
|
|
|
bboxes2draw.append( |
|
|
|
x1,y1,x2,y2,track_id = value |
|
|
|
(x1, y1, x2, y2, '', track_id) |
|
|
|
bboxes2draw.append( |
|
|
|
) |
|
|
|
(x1, y1, x2, y2, '', track_id) |
|
|
|
|
|
|
|
) |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
image = plot_bboxes(image, bboxes2draw) |
|
|
|
image = plot_bboxes(image, bboxes2draw) |
|
|
|
|
|
|
|
|
|
|
|