Spaces:
Sleeping
Sleeping
app.py
CHANGED
@@ -7,7 +7,7 @@ learn = load_learner('watersports.pkl')
|
|
7 |
categories = learn.dls.vocab
|
8 |
|
9 |
def classify_image(img):
|
10 |
-
logging.warning('Watch out
|
11 |
print('Classifying: ', img)
|
12 |
pred,idx,probs = learn.predict(img)
|
13 |
return( dict(zip(categories, map(float,probs))))
|
@@ -19,10 +19,6 @@ You need to **\<Clear\>** before dragging next image. Other images can be dragg
|
|
19 |
"examples": [f'{EXAMPLES_PATH}/{f.name}' for f in EXAMPLES_PATH.iterdir()],
|
20 |
"examples_per_page": "100"
|
21 |
}
|
22 |
-
|
23 |
-
title = "Which Watersport? Compare your guess to the machine inferencing.y"
|
24 |
-
description = "Click an image and click submit. Drag an image into the classifier. Take a close look and guess it yourself, before hitting **\<Submit\>**. \n \
|
25 |
-
You need to **\<Clear\>** before dragging next image. Other images can be dragged directly from google search."
|
26 |
|
27 |
iface = gr.Interface(fn=classify_image,
|
28 |
inputs=gr.inputs.Image(shape=(192,192)),
|
|
|
7 |
categories = learn.dls.vocab
|
8 |
|
9 |
def classify_image(img):
|
10 |
+
logging.warning('Watch out!!!') # will print a message to the console
|
11 |
print('Classifying: ', img)
|
12 |
pred,idx,probs = learn.predict(img)
|
13 |
return( dict(zip(categories, map(float,probs))))
|
|
|
19 |
"examples": [f'{EXAMPLES_PATH}/{f.name}' for f in EXAMPLES_PATH.iterdir()],
|
20 |
"examples_per_page": "100"
|
21 |
}
|
|
|
|
|
|
|
|
|
22 |
|
23 |
iface = gr.Interface(fn=classify_image,
|
24 |
inputs=gr.inputs.Image(shape=(192,192)),
|