MCPcopy Create free account
hub / github.com/OpenGVLab/HumanBench / draw_img_boxes

Method draw_img_boxes

PATH/core/solvers/utils/detools/box.py:335–351  ·  view source on GitHub ↗

:t: type, 'pd' for prediction box, 'gt' for ground truth box

(cls, img, boxes, t, color_dict=None, bold=False)

Source from the content-addressed store, hash-verified

333 """
334 @classmethod
335 def draw_img_boxes(cls, img, boxes, t, color_dict=None, bold=False):
336 """
337 :t: type, 'pd' for prediction box, 'gt' for ground truth box
338 """
339 for box in boxes:
340 if t == 'pd':
341 draw_box = DetBox()
342 else:
343 draw_box = DetBoxGT()
344 if type(box) == dict:
345 draw_box.parseOdf(box)
346 else:
347 draw_box.parseNp(box)
348 if color_dict is not None:
349 draw_box.color = color_dict.get(draw_box.tag)
350 draw_box.draw(img, bold=bold)
351 return img
352
353 @classmethod
354 def parse_gt_boxes(cls, gtboxes):

Callers

nothing calls this directly

Calls 6

parseOdfMethod · 0.95
DetBoxClass · 0.85
DetBoxGTClass · 0.85
parseNpMethod · 0.80
getMethod · 0.80
drawMethod · 0.80

Tested by

no test coverage detected