Spaces:
Running
Running
Update app.py
Browse files
app.py
CHANGED
@@ -17,6 +17,16 @@ model_names = [
|
|
17 |
"0-ma/vit-geometric-shapes-tiny",
|
18 |
]
|
19 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
20 |
# Load the default model
|
21 |
#feature_extractor = AutoImageProcessor.from_pretrained(models["Tiny Model"])
|
22 |
#model = AutoModelForImageClassification.from_pretrained(models["Tiny Model"])
|
@@ -51,14 +61,6 @@ def predict(image):
|
|
51 |
title = "Geometric Shape Classifier"
|
52 |
description = "Select a model to classify geometric shapes."
|
53 |
|
54 |
-
examples = [
|
55 |
-
'example/1_None.jpg',
|
56 |
-
'example/2_Circle.jpg',
|
57 |
-
'example/3_Triangle.jpg',
|
58 |
-
'example/4_Square.jpg',
|
59 |
-
'example/5_Pentagone.jpg',
|
60 |
-
'example/6_Hexagone.jpg'
|
61 |
-
]
|
62 |
|
63 |
# Adding a dropdown for model selection
|
64 |
gr.Interface(
|
|
|
17 |
"0-ma/vit-geometric-shapes-tiny",
|
18 |
]
|
19 |
|
20 |
+
examples = [
|
21 |
+
'example/1_None.jpg',
|
22 |
+
'example/2_Circle.jpg',
|
23 |
+
'example/3_Triangle.jpg',
|
24 |
+
'example/4_Square.jpg',
|
25 |
+
'example/5_Pentagone.jpg',
|
26 |
+
'example/6_Hexagone.jpg'
|
27 |
+
]
|
28 |
+
|
29 |
+
labels = [example.split("_")[1].spilt(".")[0] for example in examples]
|
30 |
# Load the default model
|
31 |
#feature_extractor = AutoImageProcessor.from_pretrained(models["Tiny Model"])
|
32 |
#model = AutoModelForImageClassification.from_pretrained(models["Tiny Model"])
|
|
|
61 |
title = "Geometric Shape Classifier"
|
62 |
description = "Select a model to classify geometric shapes."
|
63 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
64 |
|
65 |
# Adding a dropdown for model selection
|
66 |
gr.Interface(
|