Daniel-Sousa commited on
Commit
2e0ede2
1 Parent(s): b41d6c0

Upload 5 files

Browse files
Files changed (6) hide show
  1. .gitattributes +2 -0
  2. app.py +30 -0
  3. eggman.jpg +3 -0
  4. model.pkl +3 -0
  5. requirements.txt +2 -0
  6. sonic.jpg +3 -0
.gitattributes CHANGED
@@ -33,3 +33,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
 
33
  *.zip filter=lfs diff=lfs merge=lfs -text
34
  *.zst filter=lfs diff=lfs merge=lfs -text
35
  *tfevents* filter=lfs diff=lfs merge=lfs -text
36
+ eggman.jpg filter=lfs diff=lfs merge=lfs -text
37
+ sonic.jpg filter=lfs diff=lfs merge=lfs -text
app.py ADDED
@@ -0,0 +1,30 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from fastai.vision.all import *
3
+ import skimage
4
+
5
+ learn = load_learner('model.pkl')
6
+
7
+ categories = ('Sonic the Hedgehog', 'Doutor Eggman')
8
+ examples = ['sonic.jpg', 'eggman.jpg']
9
+
10
+
11
+ labels = learn.dls.vocab
12
+ def predict(img):
13
+ img = PILImage.create(img)
14
+ pred,pred_idx,probs = learn.predict(img)
15
+ return {labels[i]: float(probs[i]) for i in range(len(labels))}
16
+
17
+ title = "Sonic the Hedgehog and Doutor Eggman"
18
+ description = "Classificador entre o Sonic e o Doutor Eggman"
19
+ examples = ['sonic.jpg', 'eggman.jpg']
20
+ interpretation='default'
21
+ enable_queue=True
22
+
23
+ gr.Interface(fn=predict,
24
+ inputs=gr.inputs.Image(shape=(512, 512)),
25
+ outputs=gr.outputs.Label(num_top_classes=2),
26
+ title=title,
27
+ description=description,
28
+ examples=examples,
29
+ interpretation=interpretation,
30
+ enable_queue=enable_queue).launch(share=True)
eggman.jpg ADDED

Git LFS Details

  • SHA256: 9e2c01bebd6ded350b7a076a02e93dd2c2dd373b923eb3d200c2f05ae74c74a7
  • Pointer size: 132 Bytes
  • Size of remote file: 2.6 MB
model.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:066c5050719a0569e40214e6ed84b75855bb1b03b73bdbe03f93a301897bace7
3
+ size 87457561
requirements.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ fastai
2
+ scikit-image
sonic.jpg ADDED

Git LFS Details

  • SHA256: d9d1e63e8d9b055ff1c6d0d8dfb8ceef2340f77496667c6d4c9d38fdac89270b
  • Pointer size: 132 Bytes
  • Size of remote file: 5.26 MB