rray has shape (8, 1, 512, 512, 3). We reshape it to get rid of the second dimension and obtain 8 images of 512 × 512 × 3 and then convert them to PIL.


	Copied
images = images.reshape((images.shape[0] * images.shape[1],) + images.shape[-3:])
images = pipeline.numpy_to_pil(images)

Visualization
	
Let’s create a helper function to display images in a grid.


	Copied
def image_grid(imgs, rows, cols):
    w, h = imgs[0].size
    grid = Image.new