frncscp commited on
Commit
bf4858a
·
1 Parent(s): 6814fbb

Update pages/Entorno de Ejecución.py

Browse files
Files changed (1) hide show
  1. pages/Entorno de Ejecución.py +11 -10
pages/Entorno de Ejecución.py CHANGED
@@ -31,11 +31,6 @@ with col_a:
31
 
32
  threshold = .8
33
 
34
- ultra_button = st.checkbox('Ultra-Patacotrón (mejores resultados)')
35
- ultra_flag = False
36
- if ultra_button:
37
- ultra_flag = True
38
-
39
  models = os.listdir(DIR)
40
 
41
  model_dict = dict()
@@ -44,13 +39,18 @@ with col_a:
44
  model_name = str(model.split('.h5')[0])
45
  model_dir = os.path.join(DIR, model)
46
  model_dict[model_name] = model_dir
47
-
48
- ultraptctrn = ['ptctrn_v1.4', 'ptctrn_v1.5', 'ptctrn_v1.6', 'ptctrn_v1.12']
 
 
 
 
 
49
 
50
  # Create a dropdown menu to select the model
51
  model_choice = st.multiselect("Seleccione uno o varios modelos de clasificación", model_dict.keys())
52
 
53
- selected_models = []
54
 
55
  def ensemble_model(model_list, img):
56
  y_gorrito = np.zeros((1, 1))
@@ -67,8 +67,9 @@ with col_a:
67
  y_gorrito += tf.cast(model(tf.expand_dims(img/255., 0)), dtype=tf.float32)
68
  return y_gorrito / len(model_list)
69
 
70
- for model in model_choice:
71
- selected_models.append(model)
 
72
 
73
  # Set the image dimensions
74
  IMAGE_WIDTH = IMAGE_HEIGHT = 224
 
31
 
32
  threshold = .8
33
 
 
 
 
 
 
34
  models = os.listdir(DIR)
35
 
36
  model_dict = dict()
 
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
+ ultraversions = ['ptctrn_v1.4', 'ptctrn_v1.5', 'ptctrn_v1.6', 'ptctrn_v1.12']
44
+ ultra_button = st.checkbox('Ultra-Patacotrón (mejores resultados)')
45
+ ultra_flag = False
46
+ if ultra_button:
47
+ ultra_flag = True
48
+ ultraptctrn = [load_model(model_dict[model]) for model in ultraversions]
49
 
50
  # Create a dropdown menu to select the model
51
  model_choice = st.multiselect("Seleccione uno o varios modelos de clasificación", model_dict.keys())
52
 
53
+ #selected_models = []
54
 
55
  def ensemble_model(model_list, img):
56
  y_gorrito = np.zeros((1, 1))
 
67
  y_gorrito += tf.cast(model(tf.expand_dims(img/255., 0)), dtype=tf.float32)
68
  return y_gorrito / len(model_list)
69
 
70
+ #for model in model_choice:
71
+ #selected_models.append(model)
72
+ selected_models = [load_model(model) for model in model_choice]
73
 
74
  # Set the image dimensions
75
  IMAGE_WIDTH = IMAGE_HEIGHT = 224