optical.visualizer.utils.plot_boxes¶
- optical.visualizer.utils.plot_boxes(img: <module 'PIL.Image' from '/home/docs/checkouts/readthedocs.org/user_builds/optical/envs/latest/lib/python3.8/site-packages/PIL/Image.py'>, bboxes: numpy.ndarray, scores: typing.Optional[typing.List] = None, class_map: typing.Optional[typing.Dict] = {}, class_color_map: typing.Optional[typing.Dict] = {}, **kwargs) <module 'PIL.Image' from '/home/docs/checkouts/readthedocs.org/user_builds/optical/envs/latest/lib/python3.8/site-packages/PIL/Image.py'>[source]¶
Plots bounding boxes annotations on the images.
- Parameters
img (Image) – Pillow image on which annotations to be drawn.
bboxes (np.ndarray) – Bounding boxes of the input image.
scores (Optional[List], optional) – Scores incase of simple json format. Defaults to None.
class_map (Optional[Dict], optional) – mapping between categories and their ids. Defaults to dict().
class_color_map (Optional[Dict], optional) – mapping between categories and their colors. Defaults to dict().
- Returns
PIL images on which annotations are drawn.
- Return type
Image