Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -41,7 +41,8 @@ class ColorizationDataset(Dataset):
|
|
| 41 |
img = Image.open(self.paths[idx]).convert("RGB")
|
| 42 |
img = self.transforms(img)
|
| 43 |
img = np.array(img)
|
| 44 |
-
img_lab = rgb2lab(img).astype("float32") # Converting RGB to L*a*b
|
|
|
|
| 45 |
img_lab = transforms.ToTensor()(img_lab)
|
| 46 |
L = img_lab[[0], ...] / 50. - 1. # Between -1 and 1
|
| 47 |
ab = img_lab[[1, 2], ...] / 110. # Between -1 and 1
|
|
|
|
| 41 |
img = Image.open(self.paths[idx]).convert("RGB")
|
| 42 |
img = self.transforms(img)
|
| 43 |
img = np.array(img)
|
| 44 |
+
try:img_lab = rgb2lab(img).astype("float32") # Converting RGB to L*a*b
|
| 45 |
+
except:print(img)
|
| 46 |
img_lab = transforms.ToTensor()(img_lab)
|
| 47 |
L = img_lab[[0], ...] / 50. - 1. # Between -1 and 1
|
| 48 |
ab = img_lab[[1, 2], ...] / 110. # Between -1 and 1
|