Real uploadl.
Browse files
120.png
ADDED
45.png
ADDED
80.png
ADDED
app.py
CHANGED
@@ -1,7 +1,27 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
import gradio as gr
|
2 |
|
3 |
-
def greet(name):
|
4 |
-
return "Hello " + name + "!!"
|
5 |
|
6 |
-
|
7 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# AUTOGENERATED! DO NOT EDIT! File to edit: instaspeed.ipynb.
|
2 |
+
|
3 |
+
# %% auto 0
|
4 |
+
__all__ = ['learn', 'categories', 'image', 'examples', 'classify_image']
|
5 |
+
|
6 |
+
# %% instaspeed.ipynb 0
|
7 |
+
from fastai.vision.all import *
|
8 |
import gradio as gr
|
9 |
|
|
|
|
|
10 |
|
11 |
+
# %% instaspeed.ipynb 2
|
12 |
+
learn = load_learner('norot.pkl')
|
13 |
+
|
14 |
+
# %% instaspeed.ipynb 5
|
15 |
+
categories = ['0', '100', '105', '110', '115', '120', '130', '140', '35', '40', '45', '50', '55', '60', '65', '70', '75', '80', '85', '90', '95']
|
16 |
+
|
17 |
+
def classify_image(img):
|
18 |
+
pred, idx, probs = learn.predict(img)
|
19 |
+
|
20 |
+
return dict(zip(categories, map(float, probs)))
|
21 |
+
|
22 |
+
# %% instaspeed.ipynb 7
|
23 |
+
image = gr.Image()
|
24 |
+
|
25 |
+
examples = ['45.png', '80.png', '120.png']
|
26 |
+
|
27 |
+
gr.Interface(fn=classify_image, inputs=image, outputs='label', examples=examples).launch()
|
norot.pkl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:02babde10bfc6bbeabe857f3c03db3a82c07b4874f26ec7485e6af8ebacee950
|
3 |
+
size 47021950
|