Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
@@ -27,10 +27,10 @@ def infer(image):
|
|
27 |
# Restore the image in RGB color space.
|
28 |
out_img_y = out_img_y.clip(0, 255)
|
29 |
out_img_y = out_img_y.reshape((np.shape(out_img_y)[0], np.shape(out_img_y)[1]))
|
30 |
-
out_img_y =
|
31 |
out_img_cb = cb.resize(out_img_y.size, PIL.Image.BICUBIC)
|
32 |
out_img_cr = cr.resize(out_img_y.size, PIL.Image.BICUBIC)
|
33 |
-
out_img =
|
34 |
"RGB"
|
35 |
)
|
36 |
return out_img
|
|
|
27 |
# Restore the image in RGB color space.
|
28 |
out_img_y = out_img_y.clip(0, 255)
|
29 |
out_img_y = out_img_y.reshape((np.shape(out_img_y)[0], np.shape(out_img_y)[1]))
|
30 |
+
out_img_y = Image.fromarray(np.uint8(out_img_y), mode="L")
|
31 |
out_img_cb = cb.resize(out_img_y.size, PIL.Image.BICUBIC)
|
32 |
out_img_cr = cr.resize(out_img_y.size, PIL.Image.BICUBIC)
|
33 |
+
out_img = Image.merge("YCbCr", (out_img_y, out_img_cb, out_img_cr)).convert(
|
34 |
"RGB"
|
35 |
)
|
36 |
return out_img
|