de-Rodrigo commited on
Commit
2562163
1 Parent(s): b94baa7

Include Check to Hide All Smples Different to Real Ones

Browse files
Files changed (1) hide show
  1. app.py +30 -26
app.py CHANGED
@@ -887,32 +887,36 @@ def run_model(model_name):
887
  legend_label=f"Real: {label}",
888
  source=source)
889
 
890
- # Ploteamos los puntos de synthetic, diferenciando cada source con su marcador
891
- if unique_subsets["synthetic"]:
892
- for source_name, labels in unique_subsets["synthetic"].items():
893
- df_source = df_all["synthetic"][df_all["synthetic"]["source"] == source_name]
894
- marker = marker_mapping.get(source_name, "square")
895
- # Para cada label en ese source, usamos la funci贸n auxiliar
896
- renderers = add_synthetic_dataset_to_fig(fig_all, df_source, labels,
897
- marker=marker,
898
- color_mapping=color_maps["synthetic"][source_name],
899
- group_label=source_name)
900
- # Ploteamos los puntos de pretrained (agrupados por label)
901
- if unique_subsets["pretrained"]:
902
- for label in unique_subsets["pretrained"]:
903
- subset = df_all["pretrained"][df_all["pretrained"]['label'] == label]
904
- source = ColumnDataSource(data={
905
- 'x': subset['x'],
906
- 'y': subset['y'],
907
- 'label': subset['label'],
908
- 'img': subset['img']
909
- })
910
- # Usamos 'triangle' para pretrained (por ejemplo)
911
- fig_all.triangle('x', 'y', size=10,
912
- fill_color=color_maps["pretrained"][label],
913
- line_color=color_maps["pretrained"][label],
914
- legend_label=f"Pretrained: {label}",
915
- source=source)
 
 
 
 
916
 
917
  # Calcular el centroide y el radio (usando solo las muestras reales)
918
  center_x = df_all["real"]['x'].mean()
 
887
  legend_label=f"Real: {label}",
888
  source=source)
889
 
890
+ show_real_only = st.checkbox("Show only real samples", value=False, key=f"show_real_only_{model_name}")
891
+
892
+ if not show_real_only:
893
+
894
+ # Ploteamos los puntos de synthetic, diferenciando cada source con su marcador
895
+ if unique_subsets["synthetic"]:
896
+ for source_name, labels in unique_subsets["synthetic"].items():
897
+ df_source = df_all["synthetic"][df_all["synthetic"]["source"] == source_name]
898
+ marker = marker_mapping.get(source_name, "square")
899
+ # Para cada label en ese source, usamos la funci贸n auxiliar
900
+ renderers = add_synthetic_dataset_to_fig(fig_all, df_source, labels,
901
+ marker=marker,
902
+ color_mapping=color_maps["synthetic"][source_name],
903
+ group_label=source_name)
904
+ # Ploteamos los puntos de pretrained (agrupados por label)
905
+ if unique_subsets["pretrained"]:
906
+ for label in unique_subsets["pretrained"]:
907
+ subset = df_all["pretrained"][df_all["pretrained"]['label'] == label]
908
+ source = ColumnDataSource(data={
909
+ 'x': subset['x'],
910
+ 'y': subset['y'],
911
+ 'label': subset['label'],
912
+ 'img': subset['img']
913
+ })
914
+ # Usamos 'triangle' para pretrained (por ejemplo)
915
+ fig_all.triangle('x', 'y', size=10,
916
+ fill_color=color_maps["pretrained"][label],
917
+ line_color=color_maps["pretrained"][label],
918
+ legend_label=f"Pretrained: {label}",
919
+ source=source)
920
 
921
  # Calcular el centroide y el radio (usando solo las muestras reales)
922
  center_x = df_all["real"]['x'].mean()