Spaces:
Runtime error
Runtime error
Ajay Harikumar
commited on
Commit
·
e71af68
1
Parent(s):
8db0879
Change image from pil to file
Browse files
app.py
CHANGED
@@ -15,7 +15,7 @@ def colorize_image(image):
|
|
15 |
if not os.path.exists("./output"):
|
16 |
os.makedirs("./output")
|
17 |
# if image is not None:
|
18 |
-
#
|
19 |
model.predict(image.name)
|
20 |
return './output/DeOldify/'+Path(image.name).stem+".png"
|
21 |
|
@@ -24,9 +24,9 @@ def create_interface():
|
|
24 |
with gr.Blocks() as enhancer:
|
25 |
gr.Markdown("Colorize old black & white photos")
|
26 |
with gr.Column(scale=1, label = "Colorize photo", visible=True) as colorize_column:
|
27 |
-
colorize_input = gr.Image(type="
|
28 |
colorize_button = gr.Button("Colorize!")
|
29 |
-
colorize_output = gr.Image(type="
|
30 |
download_colorize_button = gr.outputs.File(label="Download colorized image!")
|
31 |
colorize_button.click(colorize_image, inputs=colorize_input, outputs=colorize_output)
|
32 |
enhancer.launch()
|
|
|
15 |
if not os.path.exists("./output"):
|
16 |
os.makedirs("./output")
|
17 |
# if image is not None:
|
18 |
+
# image.save(f"./output/{now}-input.jpg")
|
19 |
model.predict(image.name)
|
20 |
return './output/DeOldify/'+Path(image.name).stem+".png"
|
21 |
|
|
|
24 |
with gr.Blocks() as enhancer:
|
25 |
gr.Markdown("Colorize old black & white photos")
|
26 |
with gr.Column(scale=1, label = "Colorize photo", visible=True) as colorize_column:
|
27 |
+
colorize_input = gr.Image(type="file")
|
28 |
colorize_button = gr.Button("Colorize!")
|
29 |
+
colorize_output = gr.Image(type="file")
|
30 |
download_colorize_button = gr.outputs.File(label="Download colorized image!")
|
31 |
colorize_button.click(colorize_image, inputs=colorize_input, outputs=colorize_output)
|
32 |
enhancer.launch()
|