imgviz.instances2rgb

imgviz.instances2rgb(image, labels, bboxes=None, masks=None, captions=None, font_size=25, line_width=5, boundary_width=1, alpha=0.7, colormap=None, font_path=None)[source]

Convert instances to rgb.

Parameters:
  • image (numpy.ndarray, (H, W, 3), numpy.uint8) – RGB image.

  • labels (list of int, (N,)) – Labels.

  • bboxes (list of numpy.ndarray, (N, 4), float) – Bounding boxes.

  • masks (numpy.ndarray, (N, H, W), bool) – Masks.

  • captions (list of str) – Captions.

  • font_size (int) – Font size.

  • line_width (int) – Line width.

  • alpha (float) – Alpha of RGB.

  • colormap (numpy.ndarray, (M, 3), numpy.uint8) – Label id to RGB color.

Returns:

dst – Visualized image.

Return type:

numpy.ndarray, (H, W, 3), numpy.uint8