jaclearn.visualize.imgrid#

Functions

auto_image_grid_mplib(images[, ...])

Automatically create a grid for the images.

image_grid(all_images, grid_desc)

Create a image grid given the description.

Functions

auto_image_grid_mplib(images, images_title=None, global_title=None, show=True)[source]#

Automatically create a grid for the images.

Parameters:
  • images (List[ndarray]) – a list of images. Should be np.ndarray of shape (h, w, c).

  • images_title (List[str] | None) – the title for each image.

  • global_title (str | None) – the title for the whole image grid.

  • show (bool) – whether to show the image grid using plt.show().

Returns:

the figure object.

image_grid(all_images, grid_desc)[source]#

Create a image grid given the description. The description is a list of axis desc, of format: %d[h|v]. If the first number n is a positive number, every n images will be concatenated horizontally or vertically. We allow exactly one axis desc to be only [h|v], meaning the number of images of that axis will be automatically inferred.

Parameters:
  • all_images – A list of images. Should be np.ndarray of shape (h, w, c).

  • grid_desc – The grid description.

Returns:

A single big image created.