Will not modify img
(img, boxes, klass, polygons=None, is_crowd=None)
| 13 | |
| 14 | |
| 15 | def draw_annotation(img, boxes, klass, polygons=None, is_crowd=None): |
| 16 | """Will not modify img""" |
| 17 | labels = [] |
| 18 | assert len(boxes) == len(klass) |
| 19 | if is_crowd is not None: |
| 20 | assert len(boxes) == len(is_crowd) |
| 21 | for cls, crd in zip(klass, is_crowd): |
| 22 | clsname = cfg.DATA.CLASS_NAMES[cls] |
| 23 | if crd == 1: |
| 24 | clsname += ';Crowd' |
| 25 | labels.append(clsname) |
| 26 | else: |
| 27 | for cls in klass: |
| 28 | labels.append(cfg.DATA.CLASS_NAMES[cls]) |
| 29 | img = viz.draw_boxes(img, boxes, labels) |
| 30 | |
| 31 | if polygons is not None: |
| 32 | for p in polygons: |
| 33 | mask = polygons_to_mask(p, img.shape[0], img.shape[1]) |
| 34 | img = draw_mask(img, mask) |
| 35 | return img |
| 36 | |
| 37 | |
| 38 | def draw_proposal_recall(img, proposals, proposal_scores, gt_boxes): |
no test coverage detected
searching dependent graphs…