skalvv commited on
Commit
2f720de
β€’
1 Parent(s): 5b83a91

1st working model version

Browse files
.gitignore CHANGED
@@ -1 +1,2 @@
1
  app.ipynb
 
 
1
  app.ipynb
2
+ data/
Morty.png DELETED
Binary file (52.7 kB)
 
RM_classifier.pkl CHANGED
@@ -1,3 +1,3 @@
1
  version https://git-lfs.github.com/spec/v1
2
- oid sha256:3330dd6dd282482ace5c92ca1ad88dd498deb6cbcc06b7e4b96ee4eb8629361a
3
- size 46974945
 
1
  version https://git-lfs.github.com/spec/v1
2
+ oid sha256:c5069aa9d65633684dd85c9663ccf68113c80f88547be1a576e0012dcf2e07c4
3
+ size 46978017
Summer.png DELETED
Binary file (157 kB)
 
app.py CHANGED
@@ -1,5 +1,10 @@
1
  from fastai.vision.all import *
2
  import gradio as gr
 
 
 
 
 
3
 
4
  learner = load_learner('RM_classifier.pkl')
5
 
@@ -11,7 +16,7 @@ def classify_image(image):
11
 
12
  image = gr.inputs.Image(shape=(224,224))
13
  label = gr.outputs.Label()
14
- examples = ['Morty.png','Summer.png','Birdperson.jpg','Rick.jpg']
15
 
16
  interface = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples, title='Rick and Morty Character Classifier', description='Upload an image of a Rick and Morty character')
17
  interface.launch()
 
1
  from fastai.vision.all import *
2
  import gradio as gr
3
+ import os
4
+
5
+ import pathlib
6
+ temp = pathlib.PosixPath
7
+ pathlib.PosixPath = pathlib.WindowsPath
8
 
9
  learner = load_learner('RM_classifier.pkl')
10
 
 
16
 
17
  image = gr.inputs.Image(shape=(224,224))
18
  label = gr.outputs.Label()
19
+ examples = [os.path.join("./images", img_path) for img_path in os.listdir( './images')]
20
 
21
  interface = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples, title='Rick and Morty Character Classifier', description='Upload an image of a Rick and Morty character')
22
  interface.launch()
images/Beth.jpg ADDED
Birdperson.jpg β†’ images/Birdperson.jpg RENAMED
File without changes
images/Jerry.png ADDED
images/Morty.png ADDED
Rick.jpg β†’ images/Rick.jpg RENAMED
File without changes
images/Summer.jpg ADDED
requirements.txt CHANGED
@@ -2,3 +2,4 @@ fastai
2
  torch
3
  gradio
4
  numpy
 
 
2
  torch
3
  gradio
4
  numpy
5
+ os