jazz_or_rock / app.py
ofirgaash's picture
used right attribute this time
0acae92
from fastai.vision.all import *
import gradio as gr
learner = load_learner('model.pkl')
def predict_genre(img):
pred, idx, probs = learner.predict(img)
return dict(zip(learner.dls.vocab, map(float, probs)))
demo = gr.Interface(fn=predict_genre, inputs="image", outputs="label")
demo.launch()