CalvHobbes
new message
12b2e88
raw
history blame
553 Bytes
# import gradio as gr
# def greet(name):
# return "Hello " + name + "!!"
# iface = gr.Interface(fn=greet, inputs="text", outputs="text")
# iface.launch()
import gradio as gr
from fastai.vision.all import *
import skimage
learn = load_learner("topmountainsmodel.pkl")
def predict(img):
img = PILImage.create(img)
mt_type,_,probs = learn.predict(img)
message = (f"Probability that this mountain is: {mt_type} is {probs[0]:.4f}")
return message
iface = gr.Interface(fn=predict, inputs="image", outputs="label")
iface.launch()