ooferdoodles commited on
Commit
8aa942e
1 Parent(s): 21b10af
Files changed (7) hide show
  1. .gitattributes +3 -0
  2. .gitignore +2 -0
  3. app.py +29 -0
  4. dunno.jpg +3 -0
  5. model.pkl +3 -0
  6. pasta.jpg +3 -0
  7. pizza.jpg +3 -0
.gitattributes CHANGED
@@ -33,3 +33,6 @@ 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
+ pasta.jpg filter=lfs diff=lfs merge=lfs -text
37
+ .jpg filter=lfs diff=lfs merge=lfs -text
38
+ *.jpg filter=lfs diff=lfs merge=lfs -text
.gitignore ADDED
@@ -0,0 +1,2 @@
 
 
 
1
+ venv
2
+ flagged
app.py ADDED
@@ -0,0 +1,29 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import sys
2
+ import pathlib
3
+
4
+ if sys.platform == "win32":
5
+ temp = pathlib.PosixPath
6
+ pathlib.PosixPath = pathlib.WindowsPath
7
+
8
+ from fastai.vision.all import *
9
+ import gradio as gr
10
+
11
+ learn = load_learner(Path("model.pkl"))
12
+
13
+ categories = {'Pizza', 'Pasta'}
14
+
15
+
16
+ def classify_image(img):
17
+ pred, idx, probs = learn.predict(img)
18
+ return dict(zip(categories, map(float, probs)))
19
+
20
+
21
+ image = gr.Image(shape=(192, 192))
22
+ label = gr.Label()
23
+ examples = ['pizza.jpg', 'pasta.jpg', 'dunno.jpg']
24
+
25
+ app = gr.Interface(fn=classify_image,
26
+ inputs=image,
27
+ outputs=label,
28
+ examples=examples)
29
+ app.launch()
dunno.jpg ADDED

Git LFS Details

  • SHA256: 9399dbe2bade59c95f21daccbdb53c78808b7924fffd855c5cbffce275791895
  • Pointer size: 130 Bytes
  • Size of remote file: 55.8 kB
model.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:9b9c27ae184cb5923593c03f6d71b2109cd7adeeee80fbca817b28173a4be2ad
3
+ size 46966653
pasta.jpg ADDED

Git LFS Details

  • SHA256: c6dad47c32ce112f1ce75a8f4e6e773cc3c842ed76b37b2e45c0966cebd1b1c6
  • Pointer size: 130 Bytes
  • Size of remote file: 80.4 kB
pizza.jpg ADDED

Git LFS Details

  • SHA256: c8acaa4a509a08f6465451520c265aeeaf566526f4532fa8507059d7a752d6a0
  • Pointer size: 131 Bytes
  • Size of remote file: 300 kB