How to perform bicubic upsampling of image using pytorch?
I have png image. I want to upsample it using bicubic interpolation. I found this function in pytorch:
nn.functional.upsample(mode = &quot;bicubic)

https://pytorch.org/docs/stable/generated/torch.nn.Upsample.html
But how to apply to my png image? Should I turn my image into some torch tesnor? I just haven't found any example of using this function exactly on png image

You can do this
import torch 
import torchvision.transforms as transforms
from PIL import Image


t = transforms.ToTensor()
img = Image.open(&quot;Table.png&quot;)

b = torch.nn.functional.upsample(t(img).unsqueeze(0),(500,400),mode = &quot;bicubic&quot;)

you can also apply Bicubic using Image
img = Image.open(&quot;Table.png&quot;)
re = img.resize((400, 400),Image.BICUBIC)

