Spaces:
Runtime error
Runtime error
Upload 7 files
Browse files- .gitattributes +1 -0
- bensimmons.jpg +0 -0
- identifier.py +19 -0
- kawhileonard.jpg +0 -0
- kevindurant.jpg +0 -0
- kyrieirving.jpg +0 -0
- model.pkl +3 -0
- zachlavine.jpg +3 -0
.gitattributes
CHANGED
@@ -29,3 +29,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
29 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
30 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
31 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
29 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
30 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
31 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
32 |
+
zachlavine.jpg filter=lfs diff=lfs merge=lfs -text
|
bensimmons.jpg
ADDED
identifier.py
ADDED
@@ -0,0 +1,19 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
import gradio as gr
|
2 |
+
from fastai.vision.all import *
|
3 |
+
|
4 |
+
def which_player(x): return x[0].isupper()
|
5 |
+
|
6 |
+
learn = load_learner('model.pkl')
|
7 |
+
|
8 |
+
categories = ('Kevin Durant', 'Kyrie Irving', 'Ben Simmons', 'Kawhi Leonard', 'Zach Lavine')
|
9 |
+
|
10 |
+
def classify_image(img):
|
11 |
+
pred, ids, probs = learn.predict(img)
|
12 |
+
return dict(zip(categories, map(float, probs)))
|
13 |
+
|
14 |
+
image = gr.inputs.Image(shape=(192, 192))
|
15 |
+
label = gr.outputs.Label()
|
16 |
+
examples = ['kevindurant.jpg', 'kyrieirving.jpg', 'kawhileonard.jpg', 'bensimmons.jpg', 'zachlavine.jpg']
|
17 |
+
|
18 |
+
iface = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples)
|
19 |
+
iface.launch(inline=False)
|
kawhileonard.jpg
ADDED
kevindurant.jpg
ADDED
kyrieirving.jpg
ADDED
model.pkl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:fba97d8c849abd3ba5b8175e7ae539df77322b123cb1dd2d192584872a5613d9
|
3 |
+
size 46974049
|
zachlavine.jpg
ADDED
Git LFS Details
|