Spaces:
Sleeping
Sleeping
files updated
Browse files- .DS_Store +0 -0
- .gitignore +1 -0
- app.py +43 -0
- models/logo_recognizer_v1.pkl +3 -0
- test_images/Mazda-Logo.png +0 -0
- test_images/lexus-logo.png +0 -0
- test_images/marceDES.png +0 -0
- test_images/marcedes(1).png +0 -0
- test_images/toyota-logo.png +0 -0
.DS_Store
ADDED
|
Binary file (6.15 kB). View file
|
|
|
.gitignore
ADDED
|
@@ -0,0 +1 @@
|
|
|
|
|
|
|
| 1 |
+
myenv/sou
|
app.py
ADDED
|
@@ -0,0 +1,43 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
from fastai.vision.all import load_learner
|
| 2 |
+
import gradio as gr
|
| 3 |
+
|
| 4 |
+
car_logo = [
|
| 5 |
+
"Audi car logo",
|
| 6 |
+
"BMW car logo",
|
| 7 |
+
"Chevrolet car logo",
|
| 8 |
+
"Dodge car logo",
|
| 9 |
+
"Ford car logo",
|
| 10 |
+
"Honda car logo",
|
| 11 |
+
"Hyundai car logo",
|
| 12 |
+
"Jaguar car logo",
|
| 13 |
+
"Jeep car logo",
|
| 14 |
+
"Kia car logo",
|
| 15 |
+
"Land Rover car logo",
|
| 16 |
+
"Lexus car logo",
|
| 17 |
+
"Mazda car logo",
|
| 18 |
+
"Mercedes-Benz car logo",
|
| 19 |
+
"Nissan car logo",
|
| 20 |
+
"Porsche car logo",
|
| 21 |
+
"Subaru car logo",
|
| 22 |
+
"Tesla car logo",
|
| 23 |
+
"Toyota car logo",
|
| 24 |
+
"Volkswagen car logo"]
|
| 25 |
+
|
| 26 |
+
model = load_learner("models/logo_recognizer_v1.pkl")
|
| 27 |
+
|
| 28 |
+
|
| 29 |
+
def recognize_image(image):
|
| 30 |
+
pred, idx, probs = model.predict(image)
|
| 31 |
+
return dict(zip(car_logo, map(float,probs)))
|
| 32 |
+
|
| 33 |
+
|
| 34 |
+
image = gr.input.Image()
|
| 35 |
+
label = gr.output.Label()
|
| 36 |
+
examples = [
|
| 37 |
+
'test_images/lexus-logo.png',
|
| 38 |
+
'test_images/Mazda-Logo.png',
|
| 39 |
+
'test_images/toyota-logo.png']
|
| 40 |
+
|
| 41 |
+
|
| 42 |
+
demo = gr.Interface(fn=recognize_image, inputs="image", outputs="label", examples = examples)
|
| 43 |
+
demo.launch(inline = False, share = True)
|
models/logo_recognizer_v1.pkl
ADDED
|
@@ -0,0 +1,3 @@
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1 |
+
version https://git-lfs.github.com/spec/v1
|
| 2 |
+
oid sha256:a03a0630e3a463dc9c6b7f7416052fee1fb1e9f07187aa7553224d4c3ba530c5
|
| 3 |
+
size 179389295
|
test_images/Mazda-Logo.png
ADDED
|
test_images/lexus-logo.png
ADDED
|
test_images/marceDES.png
ADDED
|
test_images/marcedes(1).png
ADDED
|
test_images/toyota-logo.png
ADDED
|