super-resolution / models /Interpolation /nearest_neighbor.py
thiemcun203's picture
Interpolation added (#5)
1374a6d verified
raw
history blame contribute delete
287 Bytes
from PIL import Image
from torchvision import transforms
def NearestNeighbor_for_deployment(lr_image):
w, h = lr_image.size
sr_image = transforms.functional.resize(lr_image, size=(h*4, w*4),interpolation=transforms.InterpolationMode.NEAREST,antialias=False)
return sr_image