File size: 569 Bytes
f3004ad 63d8dec f3004ad 63d8dec f3004ad 63d8dec |
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 |
import gradio as gr
from PIL import Image
# Define a function that takes an image as input and returns it
def display_image(image):
return image # Simply return the uploaded image
# Create the Gradio interface
iface = gr.Interface(
fn=display_image, # The function that handles the image
inputs="image", # Expect an image input from the user
outputs="image", # The output will also be an image
title="Image Upload and Display App",
description="Upload an image and it will be displayed below.",
)
# Launch the Gradio app
iface.launch()
|