Spaces:
Sleeping
Sleeping
Update app.py
Browse files
app.py
CHANGED
@@ -947,21 +947,27 @@ with gr.Blocks(theme=gr.themes.Soft(primary_hue="teal", secondary_hue="cyan")) a
|
|
947 |
diag = go.Figure(layout={"title": "Error processing data"})
|
948 |
entropy = go.Figure(layout={"title": "Error processing data"})
|
949 |
|
950 |
-
|
951 |
-
|
952 |
-
|
953 |
-
|
954 |
-
|
955 |
-
|
956 |
-
|
|
|
|
|
|
|
957 |
|
958 |
-
|
959 |
-
|
960 |
-
|
961 |
-
|
962 |
-
|
963 |
-
|
964 |
-
|
|
|
|
|
|
|
965 |
|
966 |
return dual_holo, diag, entropy, primary_info, neighbor_info
|
967 |
|
|
|
947 |
diag = go.Figure(layout={"title": "Error processing data"})
|
948 |
entropy = go.Figure(layout={"title": "Error processing data"})
|
949 |
|
950 |
+
if primary_cmt:
|
951 |
+
primary_info = f"""
|
952 |
+
<b>Primary:</b> {primary_row['filepath']}<br>
|
953 |
+
<b>Species:</b> {primary_row['source']}<br>
|
954 |
+
<b>Label:</b> {primary_row.get('label', 'N/A')}<br>
|
955 |
+
<b>Alpha:</b> {primary_cmt['alpha']:.4f}<br>
|
956 |
+
<b>SRL:</b> {primary_cmt['srl']:.4f}
|
957 |
+
"""
|
958 |
+
else:
|
959 |
+
primary_info = ""
|
960 |
|
961 |
+
if neighbor_cmt and neighbor_row is not None:
|
962 |
+
neighbor_info = f"""
|
963 |
+
<b>Neighbor:</b> {neighbor_row['filepath']}<br>
|
964 |
+
<b>Species:</b> {neighbor_row['source']}<br>
|
965 |
+
<b>Label:</b> {neighbor_row.get('label', 'N/A')}<br>
|
966 |
+
<b>Alpha:</b> {neighbor_cmt['alpha']:.4f}<br>
|
967 |
+
<b>SRL:</b> {neighbor_cmt['srl']:.4f}
|
968 |
+
"""
|
969 |
+
else:
|
970 |
+
neighbor_info = ""
|
971 |
|
972 |
return dual_holo, diag, entropy, primary_info, neighbor_info
|
973 |
|