Spaces:
Running
Running
Commit
路
2562163
1
Parent(s):
b94baa7
Include Check to Hide All Smples Different to Real Ones
Browse files
app.py
CHANGED
@@ -887,32 +887,36 @@ def run_model(model_name):
|
|
887 |
legend_label=f"Real: {label}",
|
888 |
source=source)
|
889 |
|
890 |
-
|
891 |
-
|
892 |
-
|
893 |
-
|
894 |
-
|
895 |
-
|
896 |
-
|
897 |
-
|
898 |
-
|
899 |
-
|
900 |
-
|
901 |
-
|
902 |
-
|
903 |
-
|
904 |
-
|
905 |
-
|
906 |
-
|
907 |
-
|
908 |
-
|
909 |
-
|
910 |
-
|
911 |
-
|
912 |
-
|
913 |
-
|
914 |
-
|
915 |
-
|
|
|
|
|
|
|
|
|
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()
|