Joshua
commited on
Commit
•
bf447bc
1
Parent(s):
32ccc5c
Added the model pkl, the example jpg, and evapp.py to the folder
Browse files- .gitattributes +1 -0
- bmw ix.jpg +3 -0
- evapp.py +38 -0
- export.pkl +3 -0
- merc eqc.jpg +3 -0
- tesla model 3.jpg +3 -0
.gitattributes
CHANGED
@@ -32,3 +32,4 @@ saved_model/**/* filter=lfs diff=lfs merge=lfs -text
|
|
32 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
33 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
34 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
|
|
|
32 |
*.zip filter=lfs diff=lfs merge=lfs -text
|
33 |
*.zst filter=lfs diff=lfs merge=lfs -text
|
34 |
*tfevents* filter=lfs diff=lfs merge=lfs -text
|
35 |
+
*.jpg filter=lfs diff=lfs merge=lfs -text
|
bmw ix.jpg
ADDED
![]() |
Git LFS Details
|
evapp.py
ADDED
@@ -0,0 +1,38 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
1 |
+
# AUTOGENERATED! DO NOT EDIT! File to edit: evclassifierapp.ipynb.
|
2 |
+
|
3 |
+
# %% auto 0
|
4 |
+
__all__ = ['learn', 'labels', 'title', 'description', 'interpretation', 'examples', 'enable_queue', 'intf', 'classify_image']
|
5 |
+
|
6 |
+
# %% evclassifierapp.ipynb 1
|
7 |
+
from fastai.vision.all import *
|
8 |
+
|
9 |
+
# %% evclassifierapp.ipynb 2
|
10 |
+
learn = load_learner('export.pkl')
|
11 |
+
|
12 |
+
# %% evclassifierapp.ipynb 4
|
13 |
+
labels = learn.dls.vocab
|
14 |
+
|
15 |
+
def classify_image(img):
|
16 |
+
img = PILImage.create(img)
|
17 |
+
pred,idx,probs = learn.predict(img)
|
18 |
+
return {labels[i]: float(probs[i]) for i in range(len(labels))}
|
19 |
+
|
20 |
+
# %% evclassifierapp.ipynb 5
|
21 |
+
title = "EV Car Classifier"
|
22 |
+
description = "This model will recognise the EV car in question"
|
23 |
+
interpretation='default'
|
24 |
+
examples = ['bmw ix.jpg','merc eqc.jpg','tesla model 3.jpg']
|
25 |
+
enable_queue=True
|
26 |
+
|
27 |
+
# %% evclassifierapp.ipynb 6
|
28 |
+
import gradio as gr
|
29 |
+
|
30 |
+
intf = gr.Interface(fn=classify_image,
|
31 |
+
inputs=gr.inputs.Image(shape=(512, 512)),
|
32 |
+
outputs=gr.outputs.Label(num_top_classes=3),
|
33 |
+
title=title,
|
34 |
+
description=description,
|
35 |
+
examples=examples,
|
36 |
+
interpretation=interpretation,
|
37 |
+
enable_queue=enable_queue)
|
38 |
+
intf.launch()
|
export.pkl
ADDED
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
1 |
+
version https://git-lfs.github.com/spec/v1
|
2 |
+
oid sha256:f8f6b1327e9cc02ee81185305acf46fc643e1eef2b3b71338e6b58d87ae3c05c
|
3 |
+
size 46956766
|
merc eqc.jpg
ADDED
![]() |
Git LFS Details
|
tesla model 3.jpg
ADDED
![]() |
Git LFS Details
|