Spaces:
Runtime error
Runtime error
1st working model version
Browse files- .gitignore +1 -0
- Morty.png +0 -0
- RM_classifier.pkl +2 -2
- Summer.png +0 -0
- app.py +6 -1
- images/Beth.jpg +0 -0
- Birdperson.jpg β images/Birdperson.jpg +0 -0
- images/Jerry.png +0 -0
- images/Morty.png +0 -0
- Rick.jpg β images/Rick.jpg +0 -0
- images/Summer.jpg +0 -0
- requirements.txt +1 -0
.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:
|
3 |
-
size
|
|
|
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 = [
|
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
|