dog-v-cat / app.py
ahad-j's picture
Update app.py
581286c
raw
history blame
410 Bytes
from fastai.vision.all import *
import gradio as gr
learn = load_learner("model.pkl")
categories = ("Cat", "Dog")
def classify_image(image):
pred, i, prob = learn.predict(image)
return dict(zip(categories, map(float, prob)))
image = gr.inputs.Image(shape=(192, 192))
label = gr.outputs.Label()
interface = gr.Interface(fn=classify_image, inputs=image, outputs=label)
interface.launch(inline=False)