import gradio as gr
from fastai.vision.all import *
learn = load_learner('20250123_squish_model.pkl')
#labels = learn.dls.vocab
labels=['Comfort Food Squishable',
'Plague-related Squishable',
'Standard Squish',
'Undercover Squishable!'
]
def predict(img):
img = PILImage.create(img)
pred,pred_idx,probs = learn.predict(img)
return {labels[i]: float(probs[i]) for i in range(len(labels))}
title = "Squishable Type Classifier"
description = "A squishable classifier trained with fastai. Do you have a Standard Squish? Undercover? Comfort Food? Let's find out!
Created as a demo for Gradio and HuggingFace Spaces."
article="