Michael Stivala commited on
Commit
920dca5
β€’
1 Parent(s): b2d7b0a
.DS_Store ADDED
Binary file (6.15 kB). View file
 
app.py CHANGED
@@ -1,14 +1,20 @@
1
  import gradio as gr
2
- import pickle
 
 
 
 
 
 
 
 
 
3
 
4
- categories = ['Telecaster', 'Stratocaster', 'Jazzmaster']
5
- examples = ['stratocaster.jpt', 'telecaster.jpg', 'jazzmaster.jpg']
6
  image = gr.inputs.Image(shape=(192, 192))
7
  label = gr.outputs.Label()
8
 
9
  # Load the trained model from the model.pkl file
10
- with open("model.pkl", "rb") as f:
11
- model = pickle.load(f)
12
 
13
 
14
  def predict(image):
 
1
  import gradio as gr
2
+ from fastai.vision.all import *
3
+ import os
4
+
5
+ # list all file names in the samples directory
6
+ examples = []
7
+ for file in os.listdir('samples'):
8
+ examples.append(['samples/' + file])
9
+
10
+ categories = ['Jazzmaster', 'Stratocaster', 'Telecaster']
11
+
12
 
 
 
13
  image = gr.inputs.Image(shape=(192, 192))
14
  label = gr.outputs.Label()
15
 
16
  # Load the trained model from the model.pkl file
17
+ model = load_learner('model.pkl')
 
18
 
19
 
20
  def predict(image):
jazzmaster.jpeg DELETED
Binary file (96.8 kB)
 
model.pkl CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:f516a4010723ec3b58a91e97fa317ddb97dd81a8b34becce9956714efa219199
3
- size 102886051
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:cea884c093ed7feadcfa6b49f383795ccec5f59ea4df33dad4deb40a9f26207b
3
+ size 102886559
stratocaster.jpeg β†’ samples/stratocaster.jpeg RENAMED
File without changes
samples/stratocaster2.jpeg ADDED
samples/stratocaster3.jpeg ADDED
telecaster.jpeg β†’ samples/telecaster.jpeg RENAMED
File without changes
samples/telecaster2.jpeg ADDED