tmarks-adobe's picture
Upload 3 files
b4e76d6
raw
history blame contribute delete
No virus
588 Bytes
import gradio as gr
import fastbook
fastbook.setup_book()
from fastbook import *
from fastai.vision.widgets import *
from PIL import Image
def greet(name):
return "Hello " + name + "!!"
def image_mod(image):
print(image)
learn_inf = load_learner('export.pkl')
item, t, m = learn_inf.predict(image)
return 'The image is classified as a ' + item.upper() + ' bear.'
# learn_inf = load_learner('export.pkl')
# learn_inf.predict(image)
demo = gr.Interface(
image_mod,
gr.Image(type="pil"),
"label",
flagging_options=[],
examples=[],
)
demo.launch()