neodroidvision.utilities.visualisation.bounding_box_visualisation.draw_bounding_box_on_image_array

neodroidvision.utilities.visualisation.bounding_box_visualisation.draw_bounding_box_on_image_array(image: ndarray, y_min: int, x_min: int, y_max: int, x_max: int, labels: tuple = (), *, color: Optional[ColorEnum] = None, thickness: int = 2, use_normalized_coordinates: bool = True, mode: PilModesEnum = PilModesEnum.RGBA) None[source]

Adds a bounding box to an image (numpy array).

Bounding box coordinates can be specified in either absolute (pixel) or normalized coordinates by setting the use_normalized_coordinates argument.

Args: image: a numpy array with shape [height, width, 3]. y_min: y_min of bounding box. x_min: x_min of bounding box. y_max: y_max of bounding box. x_max: x_max of bounding box. color: color to draw bounding box. thickness: line thickness. Default value is 2. labels: list of strings to display in box

(each to be shown on its own line).

use_normalized_coordinates: If True (default), treat coordinates y_min, x_min, y_max, x_max as relative to the image. Otherwise treat coordinates as absolute.