Spaces:
Runtime error
Runtime error
Update app.py
Browse fileslogging some info
app.py
CHANGED
@@ -2,6 +2,12 @@ __all__ = ['is_cat', 'learn', 'classfiy_image', 'categories', 'image', 'label',
|
|
2 |
|
3 |
from fastai.vision.all import *
|
4 |
import gradio as gr
|
|
|
|
|
|
|
|
|
|
|
|
|
5 |
|
6 |
def is_cat(x): return x[0].isupper()
|
7 |
|
@@ -12,6 +18,7 @@ categories = ('cane','cavallo','elefante', 'farfalla', 'gallina', 'gatto', 'mucc
|
|
12 |
|
13 |
def classify_image(img):
|
14 |
pred,idx,probs = learn.predict(img)
|
|
|
15 |
return dict(zip(categories, map(float, probs)))
|
16 |
|
17 |
image = gr.inputs.Image(shape=(192,192))
|
|
|
2 |
|
3 |
from fastai.vision.all import *
|
4 |
import gradio as gr
|
5 |
+
from transformers.utils import logging
|
6 |
+
|
7 |
+
logging.set_verbosity_info()
|
8 |
+
logger = logging.get_logger("transformers")
|
9 |
+
|
10 |
+
|
11 |
|
12 |
def is_cat(x): return x[0].isupper()
|
13 |
|
|
|
18 |
|
19 |
def classify_image(img):
|
20 |
pred,idx,probs = learn.predict(img)
|
21 |
+
logger.info(probs)
|
22 |
return dict(zip(categories, map(float, probs)))
|
23 |
|
24 |
image = gr.inputs.Image(shape=(192,192))
|