MCPcopy Create free account
hub / github.com/PeizeSun/SparseR-CNN / test_draw_dataset_dict

Method test_draw_dataset_dict

tests/test_visualizer.py:38–63  ·  view source on GitHub ↗
(self)

Source from the content-addressed store, hash-verified

36 return MetadataCatalog.get("coco_2017_train")
37
38 def test_draw_dataset_dict(self):
39 img = np.random.rand(512, 512, 3) * 255
40 dic = {
41 "annotations": [
42 {
43 "bbox": [
44 368.9946492271106,
45 330.891438763377,
46 13.148537455410235,
47 13.644708680142685,
48 ],
49 "bbox_mode": BoxMode.XYWH_ABS,
50 "category_id": 0,
51 "iscrowd": 1,
52 "segmentation": {
53 "counts": "_jh52m?2N2N2N2O100O10O001N1O2MceP2",
54 "size": [512, 512],
55 },
56 }
57 ],
58 "height": 512,
59 "image_id": 1,
60 "width": 512,
61 }
62 v = Visualizer(img, self.metadata)
63 v.draw_dataset_dict(dic)
64
65 def test_overlay_instances(self):
66 img, boxes, labels, polygons, masks = self._random_data()

Callers

nothing calls this directly

Calls 2

draw_dataset_dictMethod · 0.95
VisualizerClass · 0.90

Tested by

no test coverage detected