Open hetarth18 opened 2 years ago
This is a bug which I also encounter. Fix it by editting the code in Prepare_image.py
as below:
def adaptive_resize(self, img):
"""
Args:
img (PIL Image): Image to be scaled.
Returns:
PIL Image: Rescaled image.
"""
h, w = img.size
if h < self.size or w < self.size:
img = transforms.ToTensor()(img)
print('if img.size=', img.size(), type(img))
return img
else:
img = transforms.ToTensor()(transforms.Resize(self.size, self.interpolation)(img))
print('else img.size=', img.size(), type(img))
return img
This is a bug which I also encounter. Fix it by editting the code in
Prepare_image.py
as below:def adaptive_resize(self, img): """ Args: img (PIL Image): Image to be scaled. Returns: PIL Image: Rescaled image. """ h, w = img.size if h < self.size or w < self.size: img = transforms.ToTensor()(img) print('if img.size=', img.size(), type(img)) return img else: img = transforms.ToTensor()(transforms.Resize(self.size, self.interpolation)(img)) print('else img.size=', img.size(), type(img)) return img
Could share the BL_release.pt file with me?Thx. My e-mail: 229020168@qq.com
I am trying to test some images using the SPAQ BL_demo.py script, and I am supposedly getting this following error -
Can you please tell me which sorts of images are accepted as input as I am passing .jpeg images (some work, while others don't).
System specs - Python 3.8 MacOS Catalina i3 (yes i have removed the .cuda() wherever it is required in the script so that it works on cpu)