Spaces:
Sleeping
Sleeping
A minimum of progressinfo
Browse files
app.py
CHANGED
@@ -8,11 +8,15 @@ import timm
|
|
8 |
|
9 |
import sys
|
10 |
|
11 |
-
|
|
|
|
|
12 |
learn = load_learner('niclangf-bird-labeler.pkl')
|
13 |
|
14 |
categories = learn.dls.vocab
|
15 |
|
|
|
|
|
16 |
def classify_image(img):
|
17 |
pred,idx,probs = learn.predict(img)
|
18 |
return dict(zip(categories, map(float,probs)))
|
@@ -20,6 +24,8 @@ def classify_image(img):
|
|
20 |
image = gr.Image()
|
21 |
label = gr.Label()
|
22 |
|
|
|
|
|
23 |
# Upload your own images and link them
|
24 |
examples = ['example.jpg']
|
25 |
|
|
|
8 |
|
9 |
import sys
|
10 |
|
11 |
+
print("Loading model...", flush=True)
|
12 |
+
|
13 |
+
# Load your model
|
14 |
learn = load_learner('niclangf-bird-labeler.pkl')
|
15 |
|
16 |
categories = learn.dls.vocab
|
17 |
|
18 |
+
print("Model has categories: ", categories, flush=True)
|
19 |
+
|
20 |
def classify_image(img):
|
21 |
pred,idx,probs = learn.predict(img)
|
22 |
return dict(zip(categories, map(float,probs)))
|
|
|
24 |
image = gr.Image()
|
25 |
label = gr.Label()
|
26 |
|
27 |
+
print("Launching interface...", flush=True)
|
28 |
+
|
29 |
# Upload your own images and link them
|
30 |
examples = ['example.jpg']
|
31 |
|