Download app.py from ZettaFi/SeeFood: direct link, hf CLI and curl.
- Browser
- Download file 579 Bytes
-
https://huggingface.co/spaces/ZettaFi/SeeFood/resolve/main/app.py
- Command line
-
hf download hf://spaces/ZettaFi/SeeFood/app.py
-
curl -L -o app.py https://huggingface.co/spaces/ZettaFi/SeeFood/resolve/main/app.py
579 Bytes
| from fastai.vision.all import * | |
| import gradio as gr | |
| learn = load_learner("hotdogModel.pkl") | |
| def classify_image(image: Image): | |
| prediction, index, probability = learn.predict(image) | |
| return "is_hotdog.png" if prediction == "hotdog" else "not_hotdog.png" | |
| examples = ["examples/hotdog.jpg", "examples/burger.jpg", "examples/sandwich.jpg", "examples/dog.jpg", | |
| "examples/hotdog_dog.jpg", "examples/fancy_hotdog.jpg"] | |
| iface = gr.Interface(fn=classify_image, inputs="image", outputs="image", examples=examples, allow_flagging="never") | |
| iface.launch(inline=False) | |