ADD: gradio model and model pickle file
Browse files- .gitattributes +5 -0
- .gitignore +1 -0
- Ey.pkl +3 -0
- app.py +22 -2
- test_data/chennai_1.png +3 -0
- test_data/chennai_2.png +3 -0
- test_data/chennai_3.png +3 -0
- test_data/london_1.png +3 -0
- test_data/london_2.png +3 -0
.gitattributes
CHANGED
@@ -33,3 +33,8 @@ 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 |
+
test_data/chennai_2.png filter=lfs diff=lfs merge=lfs -text
|
37 |
+
test_data/chennai_3.png filter=lfs diff=lfs merge=lfs -text
|
38 |
+
test_data/london_1.png filter=lfs diff=lfs merge=lfs -text
|
39 |
+
test_data/london_2.png filter=lfs diff=lfs merge=lfs -text
|
40 |
+
test_data/chennai_1.png filter=lfs diff=lfs merge=lfs -text
|
.gitignore
ADDED
@@ -0,0 +1 @@
|
|
|
|
|
1 |
+
*/.DS_Store
|
Ey.pkl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:9932c642867f6f3ed93212b18636a7cf2a0ed906ce1a925779b2d409be608b87
|
3 |
+
size 46965319
|
app.py
CHANGED
@@ -1,7 +1,27 @@
|
|
1 |
import gradio as gr
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
2 |
|
3 |
def greet(name):
|
4 |
return "Hello " + name + "!!"
|
5 |
|
6 |
-
|
7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
+
from fastai.vision.all import *
|
3 |
+
|
4 |
+
nlearn = load_learner('/kaggle/working/eywa_model.pkl')
|
5 |
+
|
6 |
+
nlearn.predict('/kaggle/input/help-me/Screenshot 2024-02-08 at 23.19.37.png')
|
7 |
+
|
8 |
+
categories = ('Chennai', 'London')
|
9 |
+
|
10 |
+
def classify_img(img):
|
11 |
+
pred, idx, prob = nlearn.predict(img)
|
12 |
+
return dict(zip(categories, map(float, prob)))
|
13 |
|
14 |
def greet(name):
|
15 |
return "Hello " + name + "!!"
|
16 |
|
17 |
+
# classify_img('/kaggle/input/help-me/Screenshot 2024-02-08 at 23.19.37.png')
|
18 |
+
|
19 |
+
image = gr.inputs.Image(shape=(192,192))
|
20 |
+
label = gr.outputs.Label()
|
21 |
+
examples = ['test_data/chennai_1.png', 'test_data/chennai_2.png', 'test_data/chennai_3.png', 'test_data/london_1.png', 'test_data/chennai_1.png']
|
22 |
+
|
23 |
+
intf = gr.interface(fn=classify_img, inputs=image, outputs=label, examples=examples)
|
24 |
+
intf.launch(inline=False)
|
25 |
+
|
26 |
+
# iface = gr.Interface(fn=greet, inputs="text", outputs="text")
|
27 |
+
# iface.launch()
|
test_data/chennai_1.png
ADDED
Git LFS Details
|
test_data/chennai_2.png
ADDED
Git LFS Details
|
test_data/chennai_3.png
ADDED
Git LFS Details
|
test_data/london_1.png
ADDED
Git LFS Details
|
test_data/london_2.png
ADDED
Git LFS Details
|