Spaces:
Sleeping
Sleeping
Update pages/Entorno de Ejecución.py
Browse files
pages/Entorno de Ejecución.py
CHANGED
@@ -34,17 +34,11 @@ DIR = os.path.join(root_dir, "models")
|
|
34 |
models = os.listdir(DIR)
|
35 |
|
36 |
model_dict = dict()
|
37 |
-
#for model in models:
|
38 |
-
# model_name = model.split(DIR)
|
39 |
-
# model_dict[model_name] = 0
|
40 |
-
#model_list = []
|
41 |
-
|
42 |
for model in models:
|
43 |
model_name = model.split(DIR)
|
44 |
model_name = str(model.split('.h5')[0])
|
45 |
model_dir = os.path.join(DIR, model)
|
46 |
model_dict[model_name] = model_dir
|
47 |
-
#model_list.append(os.path.join(DIR, model))
|
48 |
|
49 |
def extract_number(filename):
|
50 |
match = re.search(r'\d+', filename)
|
@@ -63,10 +57,10 @@ def sort_key(filename):
|
|
63 |
# sort the filenames using the custom sorting key
|
64 |
sorted_keys = sorted(model_dict.keys(), key=sort_key)
|
65 |
|
66 |
-
|
67 |
|
68 |
# Create a dropdown menu to select the model
|
69 |
-
model_choice = st.multiselect("Seleccione un modelo de clasificación",
|
70 |
|
71 |
selected_models = []
|
72 |
for model in model_choice:
|
|
|
34 |
models = os.listdir(DIR)
|
35 |
|
36 |
model_dict = dict()
|
|
|
|
|
|
|
|
|
|
|
37 |
for model in models:
|
38 |
model_name = model.split(DIR)
|
39 |
model_name = str(model.split('.h5')[0])
|
40 |
model_dir = os.path.join(DIR, model)
|
41 |
model_dict[model_name] = model_dir
|
|
|
42 |
|
43 |
def extract_number(filename):
|
44 |
match = re.search(r'\d+', filename)
|
|
|
57 |
# sort the filenames using the custom sorting key
|
58 |
sorted_keys = sorted(model_dict.keys(), key=sort_key)
|
59 |
|
60 |
+
sorted_model_dict = {k: model_dict[k] for k in sorted_keys}
|
61 |
|
62 |
# Create a dropdown menu to select the model
|
63 |
+
model_choice = st.multiselect("Seleccione un modelo de clasificación", sorted_model_dict.keys())
|
64 |
|
65 |
selected_models = []
|
66 |
for model in model_choice:
|