Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -299,6 +299,8 @@ def visualize(model, data, dims):
|
|
| 299 |
L = model.L
|
| 300 |
fake_imgs = lab_to_rgb(L, fake_color)
|
| 301 |
real_imgs = lab_to_rgb(L, real_color)
|
|
|
|
|
|
|
| 302 |
for i in range(1):
|
| 303 |
# t_img = transforms.Resize((dims[0], dims[1]))(t_img)
|
| 304 |
img = Image.fromarray(np.uint8(fake_imgs[i]))
|
|
@@ -372,7 +374,7 @@ description = "Gradio demo for Image Colorization project. You can give an image
|
|
| 372 |
gr.Interface(
|
| 373 |
main_func,
|
| 374 |
[gr.inputs.Image(type="filepath", label="Input Image") ],
|
| 375 |
-
[gr.outputs.Textbox(label="Image Size"),gr.outputs.Image(type="
|
| 376 |
title=title,
|
| 377 |
description=description,
|
| 378 |
# examples=[['a.png', ['Generate text']], ['b.png', ['Generate text','Summary','Important Sentences']], ]
|
|
|
|
| 299 |
L = model.L
|
| 300 |
fake_imgs = lab_to_rgb(L, fake_color)
|
| 301 |
real_imgs = lab_to_rgb(L, real_color)
|
| 302 |
+
img=cv.resize(np.uint8(fake_imgs[0]), dsize=(dims[1], dims[0]), interpolation=cv2.INTER_CUBIC)
|
| 303 |
+
return img
|
| 304 |
for i in range(1):
|
| 305 |
# t_img = transforms.Resize((dims[0], dims[1]))(t_img)
|
| 306 |
img = Image.fromarray(np.uint8(fake_imgs[i]))
|
|
|
|
| 374 |
gr.Interface(
|
| 375 |
main_func,
|
| 376 |
[gr.inputs.Image(type="filepath", label="Input Image") ],
|
| 377 |
+
[gr.outputs.Textbox(label="Image Size"),gr.outputs.Image(type="numpy", label="Output Image")],
|
| 378 |
title=title,
|
| 379 |
description=description,
|
| 380 |
# examples=[['a.png', ['Generate text']], ['b.png', ['Generate text','Summary','Important Sentences']], ]
|