CoolFace
Apppublic

G3d/leaf

sourceHugging Faceupdated 4y agoView on Hugging Face
0likes
app.py16 linesDownload Raw Back to root
1import pathlib2pathlib.WindowsPath = pathlib.PosixPath3 4from fastai.vision.all import *5 6import gradio as gr7 8categories = ('Brzoza', 'Dab')9learn = load_learner('model.pkl')10def greet(inp_image):11    pred,idx,probs = learn.predict(inp_image)12    return dict(zip(categories,map(float,probs)))13gr.Interface(fn=greet, 14             inputs=gr.Image(),15             outputs=gr.outputs.Label(),16             examples=["1.jpg", "2.jpg", "3.jpg", "4.jpg", "5.jpg", "6.jpg"]).launch()