Spaces:
Sleeping
Sleeping
Download app.py from Percy3822/screen_watcher: direct link, hf CLI and curl.
- Browser
- Download file 588 Bytes
-
https://huggingface.co/spaces/Percy3822/screen_watcher/resolve/main/app.py
- Command line
-
hf download hf://spaces/Percy3822/screen_watcher/app.py
-
curl -L -o app.py https://huggingface.co/spaces/Percy3822/screen_watcher/resolve/main/app.py
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() |