Spaces:
Sleeping
Sleeping
Diego Carpintero commited on
Commit ·
b32ee1e
1
Parent(s): 0876e38
add app.py
Browse files1234567import gradio as grdef greet(name):return "Hello " + name + "!!"iface = gr.Interface(fn=greet, inputs="text", outputs="text")iface.launch()1234567891011121314151617181920212223242526import gradio as grfrom fastai.vision.all import *title = "Interstellar Classifier"description = "Built for fast.ai 'Practical Deep Learning'"examples = "examples"model = load_learner("model/model.pkl")def predict(img):labels = model.dls.vocabimg = PILImage.create(img)pred, pred_idx, probs = model.predict(img)return dict(map(labels, map(float, probs)))demo = gr.Interface(fn=predict,inputs="image",outputs="image",examples=examples,title=title,description=description,).queue(default_concurrency_limit=5)demo.launch()
app.py+23-4