Update app.py
Browse files
app.py
CHANGED
@@ -111,13 +111,12 @@ def inference(image, upscale, large_input_flag, color_fix):
|
|
111 |
upscale = int(upscale) # convert type to int
|
112 |
|
113 |
model = set_safmn(upscale)
|
114 |
-
print(image)
|
115 |
|
116 |
-
img = cv2.imread(str(image), cv2.IMREAD_COLOR)
|
117 |
-
print(f'input size: {img.shape}')
|
118 |
|
119 |
# img2tensor
|
120 |
-
y =
|
121 |
y = torch.from_numpy(np.transpose(y[:, :, [2, 1, 0]], (2, 0, 1))).float()
|
122 |
y = y.unsqueeze(0).to(device)
|
123 |
|
|
|
111 |
upscale = int(upscale) # convert type to int
|
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 = 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 |
|