Xiao WANG commited on
Commit
fc9cbd5
1 Parent(s): 6f7a0f1

Deploy model to HF Space

Browse files
.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
+ *.jpg filter=lfs diff=lfs merge=lfs -text
Baroque Architecture.jpg ADDED

Git LFS Details

  • SHA256: 6706d156d81cf2279bd47fd12f4e08da7f68f027a37e005f0be88fd0ac38f587
  • Pointer size: 132 Bytes
  • Size of remote file: 3.6 MB
Gothic Architecture.jpg ADDED

Git LFS Details

  • SHA256: ad020e92074f96b7b4bed2b6f790da77cd7d241ead3a6366350fd20b2aec679d
  • Pointer size: 132 Bytes
  • Size of remote file: 2.65 MB
Modern Architecture.jpg ADDED

Git LFS Details

  • SHA256: 561e0fbbaa85fe344cd8f96d58febb798eabfcb50e5dfa71d587f7a09d8161bc
  • Pointer size: 131 Bytes
  • Size of remote file: 146 kB
app.py ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ from fastai.vision.all import *
2
+ import gradio as gr
3
+
4
+ learn = load_learner('archi_styles_model.pkl')
5
+
6
+ styles = ('Baroque Architecture','Gothic Architecture', 'Greek and Roman Classical Architecture', 'Modern Architecture', 'Neoclassical Architecture', 'Neofuturist Architecture', 'Post-Modern Architecture', 'Victorian Architecture')
7
+ examples = ['Baroque Architecture.jpg', 'Gothic Architecture.jpg', 'Modern Architecture.jpg']
8
+
9
+ # Use dict() and zip() to build a dict, not formaliar with data object in python.
10
+ def image_classifier(img):
11
+ pred_styles,pred_idx,probs = learn.predict(img)
12
+ return dict(zip(styles, map(float, probs)))
13
+
14
+ demo = gr.Interface(fn=image_classifier, inputs="image", outputs="label", examples = examples)
15
+ demo.launch()
archi_styles_model.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8054a45e7972e17cf127c12a4e04a3689ebf8f01349dbb3b4a5c0a2365770b00
3
+ size 46989487