Start with tracking

This commit is contained in:
Ruben van de Ven 2023-05-08 20:59:35 +02:00
parent 92ec58e663
commit 53400530b3

View file

@ -456,6 +456,14 @@
"\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",
" colors=\"cyan\",\n",