Raid41 commited on
Commit
072aeb5
·
1 Parent(s): 1b58508

Update dataset/datasets.py

Browse files
Files changed (1) hide show
  1. dataset/datasets.py +12 -0
dataset/datasets.py CHANGED
@@ -62,3 +62,15 @@ class FineTuningDataset(torch.utils.data.Dataset):
62
  def __init__(self, data_path, transform=None, mult_amount=1):
63
  self.data = [x for x in os.listdir(os.path.join(data_path, 'real_manga')) if x.find('_dfm') == -1]
64
  self.color
 
 
 
 
 
 
 
 
 
 
 
 
 
62
  def __init__(self, data_path, transform=None, mult_amount=1):
63
  self.data = [x for x in os.listdir(os.path.join(data_path, 'real_manga')) if x.find('_dfm') == -1]
64
  self.color
65
+
66
+ bw_img = plt.imread(get_file_path(bw_name, self.data_path, self.mults_amount))
67
+ dfm_img = plt.imread(get_file_path(dfm_name, self.data_path, self.mults_amount))
68
+
69
+ bw_img = bw_img.astype('float32')
70
+ dfm_img = dfm_img.astype('float32')
71
+
72
+ color_img = bw_img[:, :, 0]
73
+ hint = dfm_img
74
+
75
+ return bw_img, color_img, hint, dfm_img
76
+