screen_watcher / app.py
Percy3822's picture
Update app.py
3145935 verified
raw
history blame contribute delete
588 Bytes
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()