Spaces:
Sleeping
Sleeping
Delete Cat Pattern Classifier App.py
Browse files
Cat Pattern Classifier App.py
DELETED
@@ -1,18 +0,0 @@
|
|
1 |
-
import gradio as gr
|
2 |
-
from fastai.vision.all import *
|
3 |
-
|
4 |
-
learn = load_learner('export.pkl')
|
5 |
-
|
6 |
-
labels = learn.dls.vocab
|
7 |
-
def predict(img):
|
8 |
-
img = PILImage.create(img)
|
9 |
-
pred,pred_idx,probs = learn.predict(img)
|
10 |
-
return {labels[i]: float(probs[i]) for i in range(len(labels))}
|
11 |
-
|
12 |
-
gr.Interface(fn=predict,
|
13 |
-
inputs='image',
|
14 |
-
outputs='label',
|
15 |
-
title = 'Cat Coat Pattern Classifier',
|
16 |
-
description = 'A computer vision classifier that can tell you which of the major coat patterns your cat has! Extra fancy coat patterns to follow.',
|
17 |
-
examples = [r'Domestic_cat_sleeping.JPG', r'calico cat.jpg', r'1200px-British_shorthair_cat-3113513.jpg'],
|
18 |
-
interpretation='default').launch(share=True)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|