SMD00 commited on
Commit
cfdb74a
·
1 Parent(s): dd8ba68

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +2 -2
app.py CHANGED
@@ -41,8 +41,7 @@ class ColorizationDataset(Dataset):
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
@@ -341,6 +340,7 @@ class MyDataset(torch.utils.data.Dataset):
341
  img = self.img_list[idx]
342
  img = self.augmentations(img)
343
  img = np.array(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
 
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
 
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