Start with tracking

This commit is contained in:
Ruben van de Ven 2023-05-08 20:59:35 +02:00
parent 92ec58e663
commit 53400530b3
1 changed files with 8 additions and 0 deletions

View File

@ -455,6 +455,14 @@
" # alternatively look at Soft-NMS https://towardsdatascience.com/non-maximum-suppression-nms-93ce178e177c\n",
"\n",
" labels = [weights.meta[\"categories\"][i] for i in labels]\n",
" \n",
" # dets - a numpy array of detections in the format [[x1,y1,x2,y2,score],[x1,y1,x2,y2,score],...]\n",
" detections = [np.append(bbox, score) for bbox, score in zip(boxes, scores)]\n",
" tracks = mot_tracker.update(detections)\n",
"\n",
" # now convert back to boxes and labels\n",
" boxes = [t[:4] for t in tracks]\n",
" labels = [t[-1] for t in tracks]\n",
"\n",
" box = draw_bounding_boxes(t, boxes=boxes,\n",
" labels=labels,\n",