why does learner need is cat?
Browse files
app.py
CHANGED
@@ -1,10 +1,10 @@
|
|
1 |
from fastai.vision.all import *
|
2 |
import gradio as gr
|
3 |
|
|
|
4 |
learner = load_learner('model.pkl')
|
5 |
categories = ("Dog", "Cat")
|
6 |
|
7 |
-
def is_cat(x): return x[0].isupper()
|
8 |
def infer(img):
|
9 |
_, _, prob = learner.predict(img)
|
10 |
return dict(zip(categories, map(float, prob)))
|
|
|
1 |
from fastai.vision.all import *
|
2 |
import gradio as gr
|
3 |
|
4 |
+
def is_cat(x): return x[0].isupper()
|
5 |
learner = load_learner('model.pkl')
|
6 |
categories = ("Dog", "Cat")
|
7 |
|
|
|
8 |
def infer(img):
|
9 |
_, _, prob = learner.predict(img)
|
10 |
return dict(zip(categories, map(float, prob)))
|