Shortcuts

mmcv.visualization.imshow_bboxes

mmcv.visualization.imshow_bboxes(img: str | ndarray, bboxes: list | ndarray, colors: Color | str | tuple | int | ndarray = 'green', top_k: int = -1, thickness: int = 1, show: bool = True, win_name: str = '', wait_time: int = 0, out_file: str | None = None)[source]

Draw bboxes on an image.

Parameters:
  • img (str or ndarray) – The image to be displayed.

  • bboxes (list or ndarray) – A list of ndarray of shape (k, 4).

  • colors (Color or str or tuple or int or ndarray) – A list of colors.

  • top_k (int) – Plot the first k bboxes only if set positive.

  • thickness (int) – Thickness of lines.

  • show (bool) – Whether to show the image.

  • win_name (str) – The window name.

  • wait_time (int) – Value of waitKey param.

  • out_file (str, optional) – The filename to write the image.

Returns:

The image with bboxes drawn on it.

Return type:

ndarray