Arranges images in a grid, with optional padding between images.
vision_make_grid(
tensor,
...,
scale = TRUE,
per_row = 8,
padding = 2,
pad_value = 0,
num_rows = NULL
)
# Default S3 method
vision_make_grid(
tensor,
...,
scale = TRUE,
per_row = 8,
padding = 2,
pad_value = 0,
num_rows = NULL
)
# S3 method for class 'torch_tensor'
vision_make_grid(
tensor,
...,
scale = TRUE,
per_row = 8,
padding = 2,
pad_value = 0,
num_rows = NULL
)
# S3 method for class '`magick-image`'
vision_make_grid(
tensor,
...,
scale = TRUE,
per_row = 8,
padding = 2,
pad_value = 0,
num_rows = NULL
)A 4D torch_tensor of shape (B x C x H x W), a 3D torch_tensor
of shape (C x H x W), or a magick-image object.
Additional 3D torch_tensor objects (when first argument is a 3D
tensor), or additional magick-image objects (when first argument is a
magick-image).
whether to normalize (min-max-scale) the input tensor. Only
applied for torch_tensor input.
maximum number of images per row (i.e., number of columns); remaining images wrap to the next row. Default 8.
amount of padding between images in pixels (default 2).
pixel value (0–1) to use for padding background.
Deprecated. Use per_row instead.
a 3D torch_tensor of shape
\(\approx(C , n\_rows \times H , per\_row \times W)\) and of dtype torch_float().
For torch_tensor input, accepts either:
one or more 3D tensors of shape (C x H x W) passed as separate arguments, or
one or more 4D batch tensor of shape (B x C x H x W).
For magick-image input, arranges frames using magick::image_montage().
Positional grid options retain their original order: scale, num_rows,
padding, pad_value. When passing additional images, name the grid options.
Other image display:
draw_bounding_boxes(),
draw_keypoints(),
draw_segmentation_masks(),
tensor_image_browse(),
tensor_image_display()