Add files via upload

pull/28/head
Sharpiless 2021-01-07 17:08:55 +08:00 committed by GitHub
parent 8166ef6345
commit ce2ec1a3e6
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 23 additions and 23 deletions

View File

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