File size: 588 Bytes
7ffe7f6
b80e30a
feff02e
3145935
 
f2d2827
3145935
 
f2d2827
7ffe7f6
 
 
 
 
3145935
7ffe7f6
 
 
 
 
 
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

# This function receives image filepath from Gradio input and returns it as an image
def receive_image(image_path):
    try:
        img = Image.open(image_path)
        return img
    except Exception as e:
        return f"Error reading image: {e}"

# Gradio interface setup
iface = gr.Interface(
    fn=receive_image,
    inputs=gr.Image(type="filepath", label="Upload Screenshot"),  # ✅ fixed line
    outputs="image",
    title="Screen Watcher",
    description="This app receives and displays screenshots for analysis."
)

iface.launch()