frncscp commited on
Commit
49b9b87
·
1 Parent(s): 1287d3b

Update pages/Entorno de Ejecución.py

Browse files
Files changed (1) hide show
  1. pages/Entorno de Ejecución.py +5 -7
pages/Entorno de Ejecución.py CHANGED
@@ -97,22 +97,20 @@ with cnn:
97
  if not executed:
98
  ultraptctrn = [load_model(model_dict[model]) for model in ultraversions]
99
  executed = True
100
- final_weights = weight_list if len(weight_list) >= 1 else [1 for i in range(len(ultraptctrn))]
101
  try:
102
- y_gorrito, raw_img = tf_predict(ultraptctrn, weight_list, img)
103
  except:
104
- y_gorrito, raw_img = basic_predict(ultraptctrn, weight_list, img)
105
 
106
  else:
107
  with st.spinner('Cargando predicción...'):
108
  selected_models = [load_model(model_dict[model]) for model in model_choice if model not in selected_models]
109
  final_weights = weight_list if len(weight_list) >= 1 else [1 for i in range(len(selected_models))]
110
  try:
111
- y_gorrito, raw_img = tf_predict(selected_models, img)
112
  except:
113
- y_gorrito, raw_img = basic_predict(selected_models, img)
114
- finally:
115
- st.write(y_gorrito, final_weights)
116
 
117
  if round(float(y_gorrito*100)) >= threshold:
118
  st.success("¡Patacón Detectado!")
 
97
  if not executed:
98
  ultraptctrn = [load_model(model_dict[model]) for model in ultraversions]
99
  executed = True
100
+ final_weights = weight_list if len(weight_list) >= 1 else [1 for i in range(len(ultraptctrn))]
101
  try:
102
+ y_gorrito, raw_img = tf_predict(ultraptctrn, final_weights, img)
103
  except:
104
+ y_gorrito, raw_img = basic_predict(ultraptctrn, final_weights, img)
105
 
106
  else:
107
  with st.spinner('Cargando predicción...'):
108
  selected_models = [load_model(model_dict[model]) for model in model_choice if model not in selected_models]
109
  final_weights = weight_list if len(weight_list) >= 1 else [1 for i in range(len(selected_models))]
110
  try:
111
+ y_gorrito, raw_img = tf_predict(selected_models, final_weights, img)
112
  except:
113
+ y_gorrito, raw_img = basic_predict(selected_models, final_weights, img)
 
 
114
 
115
  if round(float(y_gorrito*100)) >= threshold:
116
  st.success("¡Patacón Detectado!")