imnuvi commited on
Commit
d2e23e6
·
1 Parent(s): 0f16f49

ADD: gradio model and model pickle file

Browse files
.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
- iface = gr.Interface(fn=greet, inputs="text", outputs="text")
7
- iface.launch()
 
 
 
 
 
 
 
 
 
 
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

  • SHA256: 25967dc4e352075556edaf687fcee8a470996b57ddeaf7c2dd86abebf2ed2096
  • Pointer size: 132 Bytes
  • Size of remote file: 3.16 MB
test_data/chennai_2.png ADDED

Git LFS Details

  • SHA256: 52bb6f077c8bcf89cb6b68c54443ec58bd775ec31e788eba06cb249091cfa39b
  • Pointer size: 132 Bytes
  • Size of remote file: 3.18 MB
test_data/chennai_3.png ADDED

Git LFS Details

  • SHA256: 71da3dd380dcf93d9f658603c6edba9777fef7c977ee950a6d629cdddc997025
  • Pointer size: 132 Bytes
  • Size of remote file: 4 MB
test_data/london_1.png ADDED

Git LFS Details

  • SHA256: 357711db054fb54d81b28ce98fa3f89378ddbfc5d59c352e828594f04f3de334
  • Pointer size: 132 Bytes
  • Size of remote file: 3.94 MB
test_data/london_2.png ADDED

Git LFS Details

  • SHA256: fa9354f1b46d95f0a52a903d0498a5e2f8f1f3c5fb9964b59b358892d1e4132a
  • Pointer size: 132 Bytes
  • Size of remote file: 4.02 MB