frncscp commited on
Commit
b610afe
1 Parent(s): d0328cd

Update pages/Entorno de Ejecución.py

Browse files
Files changed (1) hide show
  1. pages/Entorno de Ejecución.py +6 -5
pages/Entorno de Ejecución.py CHANGED
@@ -182,7 +182,8 @@ with vit:
182
  #classifier = pipeline("image-classification", model= model_dict[model_choice[0]])
183
  img = preprocess(uploaded_file, module = 'pil')
184
 
185
-
 
186
  #def vit_ensemble(classifier_list, img):
187
  # y_gorrito = 0
188
  # for classifier in classifier_list:
@@ -192,17 +193,17 @@ with vit:
192
  # y_gorrito += clase["score"]
193
  # return y_gorrito / len(classifier_list)
194
 
195
- models = [model_choice[i] for i in range(len(model_choice))]
196
- st.write(type(models), models)
197
 
198
  #st.write(model_choice)
199
 
200
  y_gorrito = 0
201
  #y_gorrito = query(uploaded_file.read(), model_choice[0])[1]["score"]
202
  i = -1
203
- for model in model_choice:
204
  i+=1
205
- y_gorrito += query(uploaded_file.read(), model_dict[model_choice[i]])
206
  y_gorrito /= i
207
 
208
  #st.write("y gorrito calculado", len(model_choice))
 
182
  #classifier = pipeline("image-classification", model= model_dict[model_choice[0]])
183
  img = preprocess(uploaded_file, module = 'pil')
184
 
185
+ models = [model_dict[model] for model in model_choice]
186
+ st.write(models)
187
  #def vit_ensemble(classifier_list, img):
188
  # y_gorrito = 0
189
  # for classifier in classifier_list:
 
193
  # y_gorrito += clase["score"]
194
  # return y_gorrito / len(classifier_list)
195
 
196
+ #models = [model_dict[i] for i in range(len(model_choice))]
197
+ #st.write(type(models), models)
198
 
199
  #st.write(model_choice)
200
 
201
  y_gorrito = 0
202
  #y_gorrito = query(uploaded_file.read(), model_choice[0])[1]["score"]
203
  i = -1
204
+ for model in models:
205
  i+=1
206
+ y_gorrito += query(uploaded_file.read(), model)
207
  y_gorrito /= i
208
 
209
  #st.write("y gorrito calculado", len(model_choice))