:t: type, 'pd' for prediction box, 'gt' for ground truth box
(cls, img, boxes, t, color_dict=None, bold=False)
| 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): |