MCPcopy Index your code
hub / github.com/FoundationVision/ByteTrack / visualize_img_with_bbox

Method visualize_img_with_bbox

tutorials/motr/eval.py:370–380  ·  view source on GitHub ↗
(img_path, img, dt_instances: Instances, ref_pts=None, gt_boxes=None)

Source from the content-addressed store, hash-verified

368
369 @staticmethod
370 def visualize_img_with_bbox(img_path, img, dt_instances: Instances, ref_pts=None, gt_boxes=None):
371 img = cv2.cvtColor(img, cv2.COLOR_RGB2BGR)
372 if dt_instances.has('scores'):
373 img_show = draw_bboxes(img, np.concatenate([dt_instances.boxes, dt_instances.scores.reshape(-1, 1)], axis=-1), dt_instances.obj_idxes)
374 else:
375 img_show = draw_bboxes(img, dt_instances.boxes, dt_instances.obj_idxes)
376# if ref_pts is not None:
377# img_show = draw_points(img_show, ref_pts)
378# if gt_boxes is not None:
379# img_show = draw_bboxes(img_show, gt_boxes, identities=np.ones((len(gt_boxes), )) * -1)
380 cv2.imwrite(img_path, img_show)
381
382 def detect(self, prob_threshold=0.2, area_threshold=100, vis=False):
383 total_dts = 0

Callers 1

detectMethod · 0.95

Calls 1

draw_bboxesFunction · 0.85

Tested by

no test coverage detected