Chris Addis commited on
Commit ·
eec37f2
1
Parent(s): 6a69f21
initial test
Browse files- app.py +27 -0
- requirements.txt +2 -0
app.py
ADDED
|
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
|
| 3 |
+
def process_image(image):
|
| 4 |
+
# Simply return the image as is for display
|
| 5 |
+
return image
|
| 6 |
+
|
| 7 |
+
# Create the Gradio interface
|
| 8 |
+
with gr.Blocks() as demo:
|
| 9 |
+
gr.Markdown("# Image Uploader and Viewer")
|
| 10 |
+
|
| 11 |
+
with gr.Row():
|
| 12 |
+
with gr.Column():
|
| 13 |
+
input_image = gr.Image(type="pil", label="Upload an image")
|
| 14 |
+
upload_button = gr.Button("Display Image")
|
| 15 |
+
|
| 16 |
+
with gr.Column():
|
| 17 |
+
output_image = gr.Image(label="Displayed Image")
|
| 18 |
+
|
| 19 |
+
upload_button.click(
|
| 20 |
+
fn=process_image,
|
| 21 |
+
inputs=input_image,
|
| 22 |
+
outputs=output_image
|
| 23 |
+
)
|
| 24 |
+
|
| 25 |
+
# Launch the app
|
| 26 |
+
if __name__ == "__main__":
|
| 27 |
+
demo.launch()
|
requirements.txt
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
gradio==5.24.0
|
| 2 |
+
pillow
|