Add application
Browse files12345678910111213141516171819202122# AUTOGENERATED! DO NOT EDIT! File to edit: app.ipynb.
# %% auto 0__all__ = ['loaded_learn', 'categories', 'image', 'label', 'examples', 'intf', 'classify_image']
# %% app.ipynb 3loaded_learn = load_learner('model.pkl')categories = ("Dog", "Cat")def classify_image(img): pred, idx, probs = loaded_learn.predict(img) return dict(zip(categories, map(float, probs)))image = gr.inputs.Image(shape=(192, 192))label = gr.outputs.Label()examples = ["doggo.jpg", "catto.jpg", "test.jpg"]
intf = gr.Interface( fn=classify_image, inputs=image, outputs=label, examples=examples)intf.launch(inline=False, share=True)app.pyAdded+22