Create app.py
Browse files
app.py
ADDED
|
@@ -0,0 +1,16 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
!pip install gradio
|
| 2 |
+
import gradio as gr
|
| 3 |
+
|
| 4 |
+
# Define a simple function that processes the uploaded image
|
| 5 |
+
def process_image(image):
|
| 6 |
+
return image # Simply return the uploaded image
|
| 7 |
+
|
| 8 |
+
# Create an interface with an Image upload input
|
| 9 |
+
demo = gr.Interface(
|
| 10 |
+
fn=process_image, # Function to be used
|
| 11 |
+
inputs=gr.Image(type="pil", label="Upload an Image"), # Image upload component
|
| 12 |
+
outputs=gr.Image(label="Processed Image") # Output component to display the image
|
| 13 |
+
)
|
| 14 |
+
|
| 15 |
+
# Launch the interface
|
| 16 |
+
demo.launch()
|