Spaces:
Runtime error
Runtime error
Upload app.py
Browse files
app.py
CHANGED
@@ -54,6 +54,36 @@ classes_list = [
|
|
54 |
"Serrure_Tringles",
|
55 |
]
|
56 |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
57 |
data_size = 384
|
58 |
fpn_size = 1536
|
59 |
num_classes = 27
|
@@ -149,7 +179,7 @@ def cal_backward(out) -> dict:
|
|
149 |
top5_scores = -np.sort(-V)[:5]
|
150 |
|
151 |
# Construction du dictionnaire pour gr.Label
|
152 |
-
top5_dict = {
|
153 |
return top5_dict
|
154 |
|
155 |
# === Chargement du modèle
|
|
|
54 |
"Serrure_Tringles",
|
55 |
]
|
56 |
|
57 |
+
short_classes_list = [
|
58 |
+
"Anti-fausse-manoeuvre",
|
59 |
+
"Busettes",
|
60 |
+
"Butées",
|
61 |
+
"Chariots",
|
62 |
+
"Charnière",
|
63 |
+
"Compas-limiteur",
|
64 |
+
"Renvois d'angle",
|
65 |
+
"Equerres aluminium moulées",
|
66 |
+
"Joints à clipser",
|
67 |
+
"Joints à coller",
|
68 |
+
"Joints à glisser",
|
69 |
+
"Joints EPDM",
|
70 |
+
"Joints PVC aluminium",
|
71 |
+
"Silicone pour vitrage alu",
|
72 |
+
"Visserie inox alu",
|
73 |
+
"Poignée carré 7 mm",
|
74 |
+
"Poignée carré 8 mm",
|
75 |
+
"Poignée crémone",
|
76 |
+
"Poignée cuvette",
|
77 |
+
"Poignée de tirage",
|
78 |
+
"Poignée pour levant coulissant",
|
79 |
+
"Serrure crémone multipoints",
|
80 |
+
"Serrure cuvette",
|
81 |
+
"Serrure gaches",
|
82 |
+
"Serrure pene crochet",
|
83 |
+
"Serrure pour porte",
|
84 |
+
"Serrure tringles",
|
85 |
+
]
|
86 |
+
|
87 |
data_size = 384
|
88 |
fpn_size = 1536
|
89 |
num_classes = 27
|
|
|
179 |
top5_scores = -np.sort(-V)[:5]
|
180 |
|
181 |
# Construction du dictionnaire pour gr.Label
|
182 |
+
top5_dict = {short_classes_list[int(idx)]: float(f"{score:.4f}") for idx, score in zip(top5_indices, top5_scores)}
|
183 |
return top5_dict
|
184 |
|
185 |
# === Chargement du modèle
|