Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -337,10 +337,11 @@ class MyDataset(torch.utils.data.Dataset):
|
|
337 |
return len(self.img_list)
|
338 |
|
339 |
def __getitem__(self, idx):
|
340 |
-
img = self.img_list[idx]
|
|
|
341 |
img = self.augmentations(img)
|
342 |
img = np.array(img)
|
343 |
-
print(img)
|
344 |
img_lab = rgb2lab(img).astype("float32") # Converting RGB to L*a*b
|
345 |
img_lab = transforms.ToTensor()(img_lab)
|
346 |
L = img_lab[[0], ...] / 50. - 1. # Between -1 and 1
|
|
|
337 |
return len(self.img_list)
|
338 |
|
339 |
def __getitem__(self, idx):
|
340 |
+
img = Image.open(self.img_list[idx]).convert("RGB")
|
341 |
+
# img = self.img_list[idx]
|
342 |
img = self.augmentations(img)
|
343 |
img = np.array(img)
|
344 |
+
# print(img)
|
345 |
img_lab = rgb2lab(img).astype("float32") # Converting RGB to L*a*b
|
346 |
img_lab = transforms.ToTensor()(img_lab)
|
347 |
L = img_lab[[0], ...] / 50. - 1. # Between -1 and 1
|