def test_overlay_instances(self):
    (img, boxes, labels, polygons, masks) = self._random_data()
    v = Visualizer(img, self.metadata)
    output = v.overlay_instances(masks=polygons, boxes=boxes, labels=labels).get_image()
    self.assertEqual(output.shape, img.shape)
    v = Visualizer(img, self.metadata, scale=2.0)
    output = v.overlay_instances(masks=polygons, boxes=boxes, labels=labels).get_image()
    self.assertEqual(output.shape[0], (img.shape[0] * 2))
    v = Visualizer(img, self.metadata)
    output = v.overlay_instances(masks=masks, boxes=boxes, labels=labels).get_image()
    self.assertEqual(output.shape, img.shape)
def test_overlay_instances(self):
    (img, boxes, labels, polygons, masks) = self._random_data()
    v = Visualizer(img, self.metadata)
    output = v.overlay_instances(masks=polygons, boxes=boxes, labels=labels).get_image()
    self.assertEqual(output.shape, img.shape)
    v = Visualizer(img, self.metadata, scale=2.0)
    output = v.overlay_instances(masks=polygons, boxes=boxes, labels=labels).get_image()
    self.assertEqual(output.shape[0], (img.shape[0] * 2))
    v = Visualizer(img, self.metadata)
    output = v.overlay_instances(masks=masks, boxes=boxes, labels=labels).get_image()
    self.assertEqual(output.shape, img.shape)