Spaces:
Build error
Build error
Download app.py from SpawnedShoyo/detector: direct link, hf CLI and curl.
- Browser
- Download file 504 Bytes
-
https://huggingface.co/spaces/SpawnedShoyo/detector/resolve/main/app.py
- Command line
-
hf download hf://spaces/SpawnedShoyo/detector/app.py
-
curl -L -o app.py https://huggingface.co/spaces/SpawnedShoyo/detector/resolve/main/app.py
504 Bytes
| import gradio as gr | |
| from transformers import pipeline | |
| pipe = pipeline("image-classification", "umm-maybe/AI-image-detector") | |
| def image_classifier(image): | |
| outputs = pipe(image) | |
| results = {} | |
| for result in outputs: | |
| results[result['label']] = result['score'] | |
| return results | |
| title = "Ai Image Detector" | |
| description = """ | |
| idk | |
| """ | |
| demo = gr.Interface(fn=image_classifier, inputs=gr.Image(type="pil"), outputs="label", title=title, description=description) | |
| demo.launch(show_api=False) |