torchvision.transforms.v2.functional.to_pil_imageΒΆ
- torchvision.transforms.v2.functional.to_pil_image(pic, mode=None)[source]ΒΆ
Convert a tensor or an ndarray to PIL Image. This function does not support torchscript.
See
ToPILImage
for more details.- Parameters:
pic (Tensor or numpy.ndarray) β Image to be converted to PIL Image.
mode (PIL.Image mode) β color space and pixel depth of input data (optional).
- Returns:
Image converted to PIL Image.
- Return type:
PIL Image