Start with tracking
This commit is contained in:
parent
92ec58e663
commit
53400530b3
1 changed files with 8 additions and 0 deletions
|
@ -456,6 +456,14 @@
|
||||||
"\n",
|
"\n",
|
||||||
" labels = [weights.meta[\"categories\"][i] for i in labels]\n",
|
" labels = [weights.meta[\"categories\"][i] for i in labels]\n",
|
||||||
" \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",
|
" box = draw_bounding_boxes(t, boxes=boxes,\n",
|
||||||
" labels=labels,\n",
|
" labels=labels,\n",
|
||||||
" colors=\"cyan\",\n",
|
" colors=\"cyan\",\n",
|
||||||
|
|
Loading…
Reference in a new issue