Open zhenzi0322 opened 1 year ago
You need to make sure your images format is supported by cv2 resize().
Converting all images to numpy uint8 solved the issue for me.
In getitem(), add the conversion line like this:
def __getitem__(self, index):
img = self.train_hr_imgs[index]
img = img.astype(np.uint8) # add this
hr_patch = self.hr_trans(img)
lr_patch = self.lr_trans(hr_patch)
return nor(lr_patch), nor(hr_patch)