Spaces:
Runtime error
Runtime error
Ajay Harikumar
commited on
Commit
·
b6f73ba
1
Parent(s):
8058c3b
Fix download button
Browse files- modules/app.py +6 -1
modules/app.py
CHANGED
|
@@ -22,6 +22,10 @@ def colorize_image(image):
|
|
| 22 |
return './output/DeOldify/'+Path(image.name).stem+".png"
|
| 23 |
|
| 24 |
|
|
|
|
|
|
|
|
|
|
|
|
|
| 25 |
def create_interface():
|
| 26 |
with gr.Blocks() as enhancer:
|
| 27 |
gr.Markdown("Colorize old black & white photos")
|
|
@@ -29,8 +33,9 @@ def create_interface():
|
|
| 29 |
colorize_input = gr.Image(type="file")
|
| 30 |
colorize_button = gr.Button("Colorize!")
|
| 31 |
colorize_output = gr.Image(type="file")
|
| 32 |
-
|
| 33 |
colorize_button.click(colorize_image, inputs=colorize_input, outputs=colorize_output)
|
|
|
|
| 34 |
enhancer.launch()
|
| 35 |
|
| 36 |
def run_code():
|
|
|
|
| 22 |
return './output/DeOldify/'+Path(image.name).stem+".png"
|
| 23 |
|
| 24 |
|
| 25 |
+
def download_image(image):
|
| 26 |
+
return image
|
| 27 |
+
|
| 28 |
+
|
| 29 |
def create_interface():
|
| 30 |
with gr.Blocks() as enhancer:
|
| 31 |
gr.Markdown("Colorize old black & white photos")
|
|
|
|
| 33 |
colorize_input = gr.Image(type="file")
|
| 34 |
colorize_button = gr.Button("Colorize!")
|
| 35 |
colorize_output = gr.Image(type="file")
|
| 36 |
+
download_button = gr.Button("Download!")
|
| 37 |
colorize_button.click(colorize_image, inputs=colorize_input, outputs=colorize_output)
|
| 38 |
+
download_button.click(download_image, inputs=colorize_output, outputs=[])
|
| 39 |
enhancer.launch()
|
| 40 |
|
| 41 |
def run_code():
|