File size: 337 Bytes
8a335be
2cf4ae5
8a335be
2cf4ae5
8a335be
 
 
 
 
 
 
 
1
2
3
4
5
6
7
8
9
10
11
12
13
import gradio as gr
import joblib

learn=joblib.load("model1.pkl")

def predict_image(img):
    pred, _, probs = learn.predict(img)
    # Return label and probability as nice readable text
    return f"This is a {pred} with confidence {probs.max():.2f}"

app = gr.Interface(fn=predict_image, inputs="image", outputs="text")
app.launch()