Update app.py
Browse files
app.py
CHANGED
@@ -108,7 +108,7 @@ def inference(image, upscale, large_input_flag, color_fix):
|
|
108 |
if upscale is None or not isinstance(upscale, (int, float)) or upscale == 3.:
|
109 |
upscale = 2
|
110 |
|
111 |
-
upscale = int(upscale)
|
112 |
|
113 |
model = set_safmn(upscale)
|
114 |
|
@@ -116,7 +116,7 @@ def inference(image, upscale, large_input_flag, color_fix):
|
|
116 |
# print(f'input size: {img.shape}')
|
117 |
|
118 |
# img2tensor
|
119 |
-
y = image.astype(np.float32) / 255.
|
120 |
y = torch.from_numpy(np.transpose(y[:, :, [2, 1, 0]], (2, 0, 1))).float()
|
121 |
y = y.unsqueeze(0).to(device)
|
122 |
|
|
|
108 |
if upscale is None or not isinstance(upscale, (int, float)) or upscale == 3.:
|
109 |
upscale = 2
|
110 |
|
111 |
+
upscale = int(upscale)
|
112 |
|
113 |
model = set_safmn(upscale)
|
114 |
|
|
|
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()
|
121 |
y = y.unsqueeze(0).to(device)
|
122 |
|