minial / app.py
zhangzonglin1
Add application file
8d27eef
raw
history blame
444 Bytes
#!/usr/bin/env python
# coding: utf-8
# In[ ]:
learn = learner.load("/kaggle/working/export.pkl")
def classify_image(img):
pred,idx,probs = learn.predict(img)
return dict(zip(categories,map(float,probs)))
import gradio as gr
image = gr.inputs.Image(shape=(192,192))
label = gr.outputs.Label()
intf = gr.Interface(fn=classify_image, inputs=image, outputs=label)
intf.launch(inline=False)
# In[3]:
# In[4]:
# In[ ]: