RaiRachit commited on
Commit
4768c45
1 Parent(s): 1e85486

Upload 7 files

Browse files
Files changed (7) hide show
  1. .gitattributes +2 -0
  2. GOPR0915.JPG +3 -0
  3. IMG_5618.jpg +3 -0
  4. app.py +18 -4
  5. export.pkl +3 -0
  6. russian-mail.jpg +0 -0
  7. russian.jpeg +0 -0
.gitattributes CHANGED
@@ -33,3 +33,5 @@ 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
+ GOPR0915.JPG filter=lfs diff=lfs merge=lfs -text
37
+ IMG_5618.jpg filter=lfs diff=lfs merge=lfs -text
GOPR0915.JPG ADDED

Git LFS Details

  • SHA256: 22b66e97308d4e097108e84a7ab541754b596d0e9fa5566ae0bb872ac8794443
  • Pointer size: 132 Bytes
  • Size of remote file: 6.2 MB
IMG_5618.jpg ADDED

Git LFS Details

  • SHA256: 96134bc03745fb1b2d036f54f1065a8012a741490ae4f86f2bde241a9ef665c8
  • Pointer size: 132 Bytes
  • Size of remote file: 4.23 MB
app.py CHANGED
@@ -1,7 +1,21 @@
 
 
 
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
+ __all__ = ['is_cat', 'learn', 'classify_image', 'categories', 'image', 'label', 'example', 'intf']
2
+
3
+
4
  import gradio as gr
5
+ from fastai.vision.all import *
6
+
7
+ def is_cat(x):
8
+ return x[0].isupper()
9
+
10
+ learn = load_learner('export.pkl')
11
+ categories = ('Indian', 'Russian')
12
 
13
+ def classify_image(img):
14
+ pred, idx, probs = learn.predict(img)
15
+ return dict(zip(categories, map(float, probs)))
16
 
17
+ image = gr.inputs.Image(shape=(192, 192))
18
+ label = gr.outputs.Label()
19
+ examples = ['GOPRO0915.jpg', 'IMG_5618.jpg', 'russian-mail.jpg']
20
+ intf = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples)
21
+ intf.launch(inline=False)
export.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:285e3e4907ce5fc3eeab83aad64ede5311f202fbea1fd0013501b48f0f12e35c
3
+ size 46965965
russian-mail.jpg ADDED
russian.jpeg ADDED