Spaces:
No application file
No application file
Create image.py
Browse files
image.py
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
import gradio as gr
|
| 2 |
+
|
| 3 |
+
def display_image(img):
|
| 4 |
+
"""Takes an image and returns it."""
|
| 5 |
+
return img
|
| 6 |
+
|
| 7 |
+
# Create a Gradio interface with an image input and image output
|
| 8 |
+
image_interface = gr.Interface(
|
| 9 |
+
fn=display_image,
|
| 10 |
+
inputs=gr.Image(type="pil", label="Upload an Image"),
|
| 11 |
+
outputs=gr.Image(type="pil", label="Your Image"),
|
| 12 |
+
title="Image Uploader and Viewer"
|
| 13 |
+
)
|
| 14 |
+
|
| 15 |
+
# Launch the interface
|
| 16 |
+
image_interface.launch()
|