File size: 558 Bytes
6fb6267
 
 
 
 
 
 
 
 
 
 
 
6389fec
6fb6267
 
 
 
 
6389fec
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
import gradio as gr
from PIL import Image

def transform_image(image):
    if image is None:
        return None  # Indicate no image
    original_image = image
    transformed_image = image.convert('L')  # Grayscale conversion
    return original_image, transformed_image 

iface = gr.Interface(
    fn=transform_image, 
    inputs=gr.Image(type='pil'),  # Image input type
    outputs=["image", "image"],  # Display both original and transformed
    title="My Fun Image App",
    description="Upload an image and see a grayscale version!"
)

iface.launch()