neodroidvision.utilities.visualisation.bounding_box_visualisation.draw_bounding_boxes_on_image

neodroidvision.utilities.visualisation.bounding_box_visualisation.draw_bounding_boxes_on_image(image, boxes, labels_iterable: Optional[Iterable] = None, *, color: Optional[ColorEnum] = None, thickness: Union[int, float] = 2)[source]

Draws bounding boxes on image.

Args: image: a PIL.Image object. boxes: a 2 dimensional numpy array of [N, 4]: (y_min, x_min, y_max, x_max).

The coordinates are in normalized format between [0, 1].

color: color to draw bounding box. thickness: line thickness. Default value is 4. labels_iterable: list of list of strings.

a list of strings for each bounding box. The reason to pass a list of strings for a bounding box is that it might contain multiple labels.

Raises: ValueError: if boxes is not a [N, 4] array