Spaces:
Runtime error
Runtime error
Update app.py
Browse files
app.py
CHANGED
|
@@ -21,16 +21,33 @@ def select_image(image_path):
|
|
| 21 |
image = Image.open(image_path)
|
| 22 |
return image
|
| 23 |
|
| 24 |
-
with gr.Blocks() as iface:
|
| 25 |
-
|
| 26 |
-
|
| 27 |
-
|
| 28 |
-
|
| 29 |
-
|
| 30 |
-
|
| 31 |
-
|
| 32 |
-
|
| 33 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 34 |
|
| 35 |
if __name__ == "__main__":
|
| 36 |
-
|
|
|
|
| 21 |
image = Image.open(image_path)
|
| 22 |
return image
|
| 23 |
|
| 24 |
+
# with gr.Blocks() as iface:
|
| 25 |
+
# with gr.Row():
|
| 26 |
+
# with gr.Column():
|
| 27 |
+
# selected_image = gr.Image(label="Selected Image", width=600, height=400)
|
| 28 |
+
# img_selector = gr.Dropdown(choices=img_files, label="Select an image from folder")
|
| 29 |
+
# img_selector.change(select_image, img_selector, selected_image)
|
| 30 |
+
# with gr.Column():
|
| 31 |
+
# output_image = gr.Image(label="Output Image", width=600, height=400)
|
| 32 |
+
# predict_button = gr.Button("Predict")
|
| 33 |
+
# predict_button.click(predict_single_image, inputs=selected_image, outputs=output_image)
|
| 34 |
+
|
| 35 |
+
demo = gr.Interface(
|
| 36 |
+
fn=predict_single_image,
|
| 37 |
+
inputs=[
|
| 38 |
+
gr.Image(value="img/1.png", type="pil", label="Input"),
|
| 39 |
+
],
|
| 40 |
+
|
| 41 |
+
outputs=ImageSlider(label="Super-Resolved Image",
|
| 42 |
+
type="pil",
|
| 43 |
+
show_download_button=True,
|
| 44 |
+
),
|
| 45 |
+
title=title,
|
| 46 |
+
description=description,
|
| 47 |
+
article=article,
|
| 48 |
+
examples=examples,
|
| 49 |
+
css=css,
|
| 50 |
+
)
|
| 51 |
|
| 52 |
if __name__ == "__main__":
|
| 53 |
+
demo.launch()
|