Mohammed Albrayh commited on
Commit
808bac7
·
1 Parent(s): 1644d08
Files changed (2) hide show
  1. SaudiLandmarkClassifier.pkl +3 -0
  2. app.py +15 -4
SaudiLandmarkClassifier.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:d9c66c5a2d169a62cb1fcbcaf240104778f8efd636fadaefc0df37def5c31ed0
3
+ size 102930582
app.py CHANGED
@@ -1,7 +1,18 @@
1
- import gradio as gr
2
 
3
- def greet(name):
4
- return "Hello " + name + "!!"
 
 
5
 
6
- iface = gr.Interface(fn=greet, inputs="text", outputs="text")
 
 
 
 
 
 
 
 
 
7
  iface.launch()
 
1
+ from fastai.vision.all import *
2
 
3
+ #Windows fix
4
+ import pathlib
5
+ temp = pathlib.PosixPath
6
+ pathlib.PosixPath = pathlib.WindowsPath
7
 
8
+
9
+ learn = load_learner('SaudiLandmarkClassifier.pkl')
10
+
11
+ def predict(input):
12
+ # image = gr.Image(height=224,type="pil",image_obj=input)
13
+ image = PILImage.create(input).resize((224,224))
14
+ results = learn.predict(image)[0]
15
+ return results
16
+
17
+ iface = gr.Interface(fn=predict, inputs="image", outputs="text", examples=['Examples\A.png', 'Examples\B.png', 'Examples\C.png'])
18
  iface.launch()