|
1 | | -from pathlib import Path |
2 | | -from itertools import combinations |
3 | | -import re |
| 1 | +import io |
4 | 2 | import os |
5 | | -import torch |
6 | | -import streamlit as st |
7 | 3 | import pandas as pd |
8 | 4 | import plotly.express as px |
9 | 5 | import plotly.graph_objects as go |
10 | 6 | import plotly.io as pio |
11 | | -import io |
| 7 | +import re |
| 8 | +import streamlit as st |
| 9 | +import torch |
| 10 | +from itertools import combinations |
| 11 | +from pathlib import Path |
12 | 12 | from typing import List, Tuple |
13 | 13 |
|
14 | 14 | # pio.templates.default = "plotly" |
@@ -260,7 +260,6 @@ def prettify_axis_label(label: str) -> str: |
260 | 260 |
|
261 | 261 |
|
262 | 262 | def apply_minimal_layout(fig: go.Figure, size: int = 600) -> None: |
263 | | - |
264 | 263 | # fig.update_layout( |
265 | 264 | # title=None, |
266 | 265 | # xaxis=dict(visible=False), |
@@ -753,7 +752,7 @@ def match_keywords(text): |
753 | 752 | # f"\n% {interpret_name(metric)}", |
754 | 753 | f"\n% {descriptive_name(metric)}", |
755 | 754 | f"\n% {metric} &\t{metric_row['mean_average_precision']:.2f} &\t{metric_row['precision@10']:.2f}\t\\\\", |
756 | | - f"\n{descriptive_name(metric).split()[0]} & {dd} & {fm} & {trim} & {norm} & {seq_align} & {kp} &\t{metric_row['mean_average_precision']*100:.0f}\\% &\t{metric_row['precision@10']*100:.0f}\\%\t\\\\", |
| 755 | + f"\n{descriptive_name(metric).split()[0]} & {dd} & {fm} & {trim} & {norm} & {seq_align} & {kp} &\t{metric_row['mean_average_precision'] * 100:.0f}\\% &\t{metric_row['precision@10'] * 100:.0f}\\%\t\\\\", |
757 | 756 | ] |
758 | 757 |
|
759 | 758 | for mdl in markdown_lines: |
@@ -876,11 +875,10 @@ def match_keywords(text): |
876 | 875 | st.write(f"**Average on '{sort_col}' without '{kw}':** `{avg_without:.4f}`") |
877 | 876 | st.write(f"**Estimated effect on '{sort_col}' of '{kw}':** `{delta:+.4f}`") |
878 | 877 | st.write(f"{kw} count within {top_or_bottom} 100 by {sort_col}: {(has_kw['RANK'] <= 100).sum()}") |
879 | | - st.write(f"{kw} count within {top_or_bottom} 10 by {sort_col}: {(has_kw['RANK']<= 10).sum()}") |
| 878 | + st.write(f"{kw} count within {top_or_bottom} 10 by {sort_col}: {(has_kw['RANK'] <= 10).sum()}") |
880 | 879 | st.write(f"{kw} count within {top_or_bottom} 5 by {sort_col}: {(has_kw['RANK'] <= 5).sum()}") |
881 | 880 |
|
882 | 881 | if st.checkbox(f"Show distributions for {kw}?"): |
883 | | - |
884 | 882 | fig = go.Figure() |
885 | 883 |
|
886 | 884 | fig.add_trace( |
@@ -1026,5 +1024,4 @@ def match_keywords(text): |
1026 | 1024 | else: |
1027 | 1025 | plot_pareto_frontier(df) |
1028 | 1026 |
|
1029 | | - |
1030 | 1027 | # conda activate /opt/home/cleong/envs/pose_eval_src && streamlit run pose_evaluation/evaluation/explore_metric_stats.py |
0 commit comments