torchvision.utils

1.torchvision.utils.make_grid(tensornrow=8padding=2normalize=Falserange=Nonescale_each=Falsepad_value=0)

Make a grid of images.网格图像(多个图像)

Parameters:
  • tensor (Tensor or list) – 4D mini-batch Tensor of shape (B x C x H x W) or a list of images all of the same size.一些相同大小的图像。
  • nrow (intoptional) – Number of images displayed in each row of the grid. The Final grid size is (B / nrow, nrow). Default is 8.
  • padding (intoptional) – amount of padding. Default is 2.
  • normalize (booloptional) – If True, shift the image to the range (0, 1), by subtracting the minimum and dividing by the maximum pixel value.
  • range (tupleoptional) – tuple (min, max) where min and max are numbers, then these numbers are used to normalize the image. By default, min and max are computed from the tensor.
  • scale_each (booloptional) – If True, scale each image in the batch of images separately rather than the (min, max) over all images.
  • pad_value (floatoptional) – Value for the padded pixels.

Example

See this notebook here

猜你喜欢

转载自blog.csdn.net/shaodongheng/article/details/89494222
今日推荐