Meloo commited on
Commit
42c9305
·
verified ·
1 Parent(s): bf0ee6f

Update app.py

Browse files
Files changed (1) hide show
  1. app.py +0 -8
app.py CHANGED
@@ -112,9 +112,6 @@ def inference(image, upscale, large_input_flag, color_fix):
112
 
113
  model = set_safmn(upscale)
114
 
115
- # img = cv2.imread(str(image), cv2.IMREAD_COLOR)
116
- # print(f'input size: {img.shape}')
117
-
118
  # img2tensor
119
  y = np.array(image).astype(np.float32) / 255.
120
  y = torch.from_numpy(np.transpose(y[:, :, [2, 1, 0]], (2, 0, 1))).float()
@@ -154,11 +151,6 @@ def inference(image, upscale, large_input_flag, color_fix):
154
  output = np.transpose(output[[2, 1, 0], :, :], (1, 2, 0))
155
  output = (output * 255.0).round().astype(np.uint8)
156
 
157
- # # save restored img
158
- # save_path = f'results/out.png'
159
- # cv2.imwrite(save_path, output)
160
-
161
- # output = cv2.cvtColor(output, cv2.COLOR_BGR2RGB)
162
  return image, Image.fromarray(output)
163
 
164
 
 
112
 
113
  model = set_safmn(upscale)
114
 
 
 
 
115
  # img2tensor
116
  y = np.array(image).astype(np.float32) / 255.
117
  y = torch.from_numpy(np.transpose(y[:, :, [2, 1, 0]], (2, 0, 1))).float()
 
151
  output = np.transpose(output[[2, 1, 0], :, :], (1, 2, 0))
152
  output = (output * 255.0).round().astype(np.uint8)
153
 
 
 
 
 
 
154
  return image, Image.fromarray(output)
155
 
156