davidrd123 commited on
Commit
f091eea
1 Parent(s): 9758658

added code + images

Browse files
Files changed (13) hide show
  1. .gitattributes +5 -0
  2. Image00.jpg +0 -0
  3. Image01.jpg +0 -0
  4. Image02.jpg +3 -0
  5. Image03.jpg +0 -0
  6. Image04.jpg +3 -0
  7. Image05.jpg +0 -0
  8. Image06.jpg +3 -0
  9. Image07.jpg +0 -0
  10. Image08.jpg +3 -0
  11. Image09.jpg +3 -0
  12. app.py +24 -0
  13. requirements.txt +2 -0
.gitattributes CHANGED
@@ -26,3 +26,8 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
26
  *.zstandard filter=lfs diff=lfs merge=lfs -text
27
  *tfevents* filter=lfs diff=lfs merge=lfs -text
28
  rn50_256px_18genre_10epoch_err313.pkl filter=lfs diff=lfs merge=lfs -text
 
 
 
 
 
 
26
  *.zstandard filter=lfs diff=lfs merge=lfs -text
27
  *tfevents* filter=lfs diff=lfs merge=lfs -text
28
  rn50_256px_18genre_10epoch_err313.pkl filter=lfs diff=lfs merge=lfs -text
29
+ Image06.jpg filter=lfs diff=lfs merge=lfs -text
30
+ Image08.jpg filter=lfs diff=lfs merge=lfs -text
31
+ Image04.jpg filter=lfs diff=lfs merge=lfs -text
32
+ Image09.jpg filter=lfs diff=lfs merge=lfs -text
33
+ Image02.jpg filter=lfs diff=lfs merge=lfs -text
Image00.jpg ADDED
Image01.jpg ADDED
Image02.jpg ADDED

Git LFS Details

  • SHA256: aad47eeb4cbc5980af9720fea49edd76e52e3b0691cd434e99a6036ad608232b
  • Pointer size: 131 Bytes
  • Size of remote file: 218 kB
Image03.jpg ADDED
Image04.jpg ADDED

Git LFS Details

  • SHA256: 351b1792a1c1ba8c7b73a0265f19335ac0eed6b393cc6d9c7643f10bfa089f63
  • Pointer size: 131 Bytes
  • Size of remote file: 518 kB
Image05.jpg ADDED
Image06.jpg ADDED

Git LFS Details

  • SHA256: cc5fcba4916047663d56a0fc75ad7bd7fd80534cc89e4ec412dea693a46f6112
  • Pointer size: 130 Bytes
  • Size of remote file: 28.9 kB
Image07.jpg ADDED
Image08.jpg ADDED

Git LFS Details

  • SHA256: 3c5a279b05083713472ed049fe1f6f782018aa522bcedf06795ec3e02326b7a8
  • Pointer size: 131 Bytes
  • Size of remote file: 988 kB
Image09.jpg ADDED

Git LFS Details

  • SHA256: 084d2011bd02e6e3d06512545b2e1552774e951e98c8d7766acf59df1f57e17d
  • Pointer size: 131 Bytes
  • Size of remote file: 173 kB
app.py ADDED
@@ -0,0 +1,24 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from fastai.vision.all import *
3
+ import skimage
4
+
5
+ learn = load_learner('rn50_256px_18genre_10epoch_err313.pkl')
6
+
7
+ labels = learn.dls.vocab
8
+ def predict(img):
9
+ img = PILImage.create(img)
10
+ pred,pred_idx,probs = learn.predict(img)
11
+ return {labels[i]: float(probs[i]) for i in range(len(labels))}
12
+
13
+ examples = [f"Image{n:02d}.jpg" for n in range(10)]
14
+ interpretation='default'
15
+ title = "Art Movement Classifier - WikiArt"
16
+ description = "What Art Movement Matches the Image Best?"
17
+
18
+ gr.Interface(fn=predict,
19
+ inputs=gr.inputs.Image(shape=((512,512))),
20
+ outputs=gr.outputs.Label(num_top_classes=5),
21
+ title = title,
22
+ examples = examples,
23
+ interpretation = interpretation,
24
+ description = description).launch(share=True, enable_queue=True)
requirements.txt ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ fastai
2
+ scikit-image