phyous commited on
Commit
87e4445
Β·
1 Parent(s): 9d1b4fc

Initial commit

Browse files
Files changed (8) hide show
  1. .gitattributes +1 -0
  2. app.py +15 -0
  3. export.pkl +3 -0
  4. fetuccini.jpeg +0 -0
  5. fusilli.jpeg +0 -0
  6. lasagna.jpeg +0 -0
  7. orzo.jpeg +0 -0
  8. radiatori.jpeg +0 -0
.gitattributes CHANGED
@@ -29,3 +29,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
29
  *.zip filter=lfs diff=lfs merge=lfs -text
30
  *.zst filter=lfs diff=lfs merge=lfs -text
31
  *tfevents* filter=lfs diff=lfs merge=lfs -text
 
 
29
  *.zip filter=lfs diff=lfs merge=lfs -text
30
  *.zst filter=lfs diff=lfs merge=lfs -text
31
  *tfevents* filter=lfs diff=lfs merge=lfs -text
32
+ export.pkl filter=lfs diff=lfs merge=lfs -text
app.py ADDED
@@ -0,0 +1,15 @@
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
1
+ import gradio as gr
2
+ from fastcore.all import *
3
+ from fastai.vision.all import *
4
+
5
+ learn = load_learner('export.pkl')
6
+ labels = learn.dls.vocab
7
+ def predict(img):
8
+ img = PILImage.create(img)
9
+ pred,pred_idx,probs = learn.predict(img)
10
+ return {labels[i]: float(probs[i]) for i in range(len(labels))}
11
+
12
+ examples = ['radiatori.jpeg', 'fusilli.jpeg', 'fetuccini.jpeg', 'lasagna.jpeg', 'orzo.jpeg']
13
+
14
+ description = "# 🍝 PASTA MACHINE 🍝 - the pasta AI"
15
+ gr.Interface(fn=predict, description=description, inputs=gr.inputs.Image(shape=(512, 512)), outputs=gr.outputs.Label(num_top_classes=3), examples=examples).launch(share=True)
export.pkl ADDED
@@ -0,0 +1,3 @@
 
 
 
 
1
+ version https://git-lfs.github.com/spec/v1
2
+ oid sha256:8684e8fd6ad71562aa836c27d6a6441c6bd3ae4f602cef250dee226b0e302894
3
+ size 179328551
fetuccini.jpeg ADDED
fusilli.jpeg ADDED
lasagna.jpeg ADDED
orzo.jpeg ADDED
radiatori.jpeg ADDED