| import gradio as gr | |
| # Define a simple function that processes the uploaded image | |
| def process_image(image): | |
| return image # Simply return the uploaded image | |
| # Create an interface with an Image upload input | |
| demo = gr.Interface( | |
| fn=process_image, # Function to be used | |
| inputs=gr.Image(type="pil", label="Upload an Image"), # Image upload component | |
| outputs=gr.Image(label="Processed Image") # Output component to display the image | |
| ) | |
| # Launch the interface | |
| demo.launch() |