init
Browse files- .gitattributes +2 -0
- README.md +3 -3
- app.ipynb +0 -0
- app.py +27 -0
- basset.jpg +3 -0
- model.pkl +3 -0
- requirements.txt +3 -0
.gitattributes
CHANGED
@@ -25,3 +25,5 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
25 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
26 |
*.zstandard filter=lfs diff=lfs merge=lfs -text
|
27 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
|
|
25 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
26 |
*.zstandard filter=lfs diff=lfs merge=lfs -text
|
27 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
28 |
+
*.jpg filter=lfs diff=lfs merge=lfs -text
|
29 |
+
*.pkl filter=lfs diff=lfs merge=lfs -text
|
README.md
CHANGED
@@ -1,8 +1,8 @@
|
|
1 |
---
|
2 |
-
title:
|
3 |
-
emoji:
|
4 |
colorFrom: pink
|
5 |
-
colorTo:
|
6 |
sdk: gradio
|
7 |
sdk_version: 2.9.4
|
8 |
app_file: app.py
|
|
|
1 |
---
|
2 |
+
title: Testing
|
3 |
+
emoji: 🦀
|
4 |
colorFrom: pink
|
5 |
+
colorTo: blue
|
6 |
sdk: gradio
|
7 |
sdk_version: 2.9.4
|
8 |
app_file: app.py
|
app.ipynb
ADDED
The diff for this file is too large to render.
See raw diff
|
|
app.py
ADDED
@@ -0,0 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# AUTOGENERATED! DO NOT EDIT! File to edit: . (unless otherwise specified).
|
2 |
+
|
3 |
+
__all__ = ['learn', 'classify_image', 'categories', 'image', 'label', 'examples', 'intf']
|
4 |
+
|
5 |
+
# Cell
|
6 |
+
from fastai.vision.all import *
|
7 |
+
import gradio as gr
|
8 |
+
import timm
|
9 |
+
|
10 |
+
# Cell
|
11 |
+
learn = load_learner('model.pkl')
|
12 |
+
|
13 |
+
# Cell
|
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 |
+
# Cell
|
21 |
+
image = gr.inputs.Image(shape=(192, 192))
|
22 |
+
label = gr.outputs.Label()
|
23 |
+
examples = ['basset.jpg']
|
24 |
+
|
25 |
+
# Cell
|
26 |
+
intf = gr.Interface(fn=classify_image, inputs=image, outputs=label, examples=examples)
|
27 |
+
intf.launch()
|
basset.jpg
ADDED
Git LFS Details
|
model.pkl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:1e80ba1eb22a56fe24fe9ec809c75e588b780df5cd98989d229511acc2089038
|
3 |
+
size 348728037
|
requirements.txt
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
fastai
|
2 |
+
timm
|
3 |
+
|