Spaces:
Sleeping
Sleeping
prasanth.thangavel
commited on
Commit
·
43f0ea7
1
Parent(s):
9fd2c60
Update files
Browse files- README.md +2 -2
- app.ipynb +0 -0
- app.py +13 -9
- fastai-prd-apps-pets-training.ipynb +0 -0
- model.pkl +2 -2
- requirements.txt +6 -3
README.md
CHANGED
@@ -4,11 +4,11 @@ emoji: 🐶
|
|
4 |
colorFrom: pink
|
5 |
colorTo: blue
|
6 |
sdk: gradio
|
7 |
-
sdk_version: 3.
|
8 |
app_file: app.py
|
9 |
pinned: true
|
10 |
license: apache-2.0
|
11 |
duplicated_from: jph00/pets
|
12 |
---
|
13 |
|
14 |
-
|
|
|
4 |
colorFrom: pink
|
5 |
colorTo: blue
|
6 |
sdk: gradio
|
7 |
+
sdk_version: 3.33.1
|
8 |
app_file: app.py
|
9 |
pinned: true
|
10 |
license: apache-2.0
|
11 |
duplicated_from: jph00/pets
|
12 |
---
|
13 |
|
14 |
+
Kaggle Training notebook: https://www.kaggle.com/code/prasanth07/fastai-prd-apps-pets-training
|
app.ipynb
CHANGED
The diff for this file is too large to render.
See raw diff
|
|
app.py
CHANGED
@@ -1,27 +1,31 @@
|
|
1 |
-
# AUTOGENERATED! DO NOT EDIT! File to edit: .
|
2 |
|
3 |
-
|
|
|
4 |
|
5 |
-
#
|
6 |
from fastai.vision.all import *
|
7 |
import gradio as gr
|
8 |
import timm
|
9 |
|
10 |
-
#
|
11 |
learn = load_learner('model.pkl')
|
12 |
|
13 |
-
#
|
14 |
categories = learn.dls.vocab
|
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.inputs.Image(shape=(192, 192))
|
22 |
label = gr.outputs.Label()
|
23 |
examples = ['basset.jpg']
|
24 |
|
25 |
-
#
|
26 |
-
intf = gr.Interface(
|
27 |
-
|
|
|
|
|
|
|
|
1 |
+
# AUTOGENERATED! DO NOT EDIT! File to edit: app.ipynb.
|
2 |
|
3 |
+
# %% auto 0
|
4 |
+
__all__ = ['learn', 'categories', 'image', 'label', 'examples', 'intf', 'classify_image']
|
5 |
|
6 |
+
# %% app.ipynb 2
|
7 |
from fastai.vision.all import *
|
8 |
import gradio as gr
|
9 |
import timm
|
10 |
|
11 |
+
# %% app.ipynb 4
|
12 |
learn = load_learner('model.pkl')
|
13 |
|
14 |
+
# %% app.ipynb 6
|
15 |
categories = learn.dls.vocab
|
16 |
|
17 |
def classify_image(img):
|
18 |
pred,idx,probs = learn.predict(img)
|
19 |
return dict(zip(categories, map(float,probs)))
|
20 |
|
21 |
+
# %% app.ipynb 8
|
22 |
image = gr.inputs.Image(shape=(192, 192))
|
23 |
label = gr.outputs.Label()
|
24 |
examples = ['basset.jpg']
|
25 |
|
26 |
+
# %% app.ipynb 9
|
27 |
+
intf = gr.Interface(
|
28 |
+
fn=classify_image, inputs=image, outputs=label, examples=examples,
|
29 |
+
title="Dog Breed Classifier",
|
30 |
+
description="Classifier is fine-tuned on pre-trained resnet34 model")
|
31 |
+
intf.launch(inline=False)
|
fastai-prd-apps-pets-training.ipynb
ADDED
The diff for this file is too large to render.
See raw diff
|
|
model.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:4059bcf6ae28130f7b1f8aaaa1e2bf632ce598c1208cfa94c9e0e995c109e91d
|
3 |
+
size 114793185
|
requirements.txt
CHANGED
@@ -1,3 +1,6 @@
|
|
1 |
-
|
2 |
-
|
3 |
-
|
|
|
|
|
|
|
|
1 |
+
fastai==2.7.12
|
2 |
+
torch==2.0.1
|
3 |
+
gradio==3.33.1
|
4 |
+
timm==0.9.2
|
5 |
+
numpy
|
6 |
+
pandas
|