Spaces:
Sleeping
Sleeping
Lee Henriques commited on
Commit Β·
ea899fb
1
Parent(s): 5a8fd19
update
Browse files- app.py +10 -10
- packages.txt +2 -0
app.py
CHANGED
|
@@ -381,7 +381,7 @@ def render_sidebar():
|
|
| 381 |
st.markdown("**Eigen-IG**")
|
| 382 |
eigen_components = st.slider("Number of principal components", 1, 12, 5, 1)
|
| 383 |
|
| 384 |
-
run_btn = st.button("βΆ Run Analysis",
|
| 385 |
|
| 386 |
return {
|
| 387 |
"model_name": model_name,
|
|
@@ -577,7 +577,7 @@ def run_batch_benchmark(model, config, cfg, labels, device):
|
|
| 577 |
|
| 578 |
st.markdown("#### Results summary (mean Β± std)")
|
| 579 |
summary = df.groupby("method")[["deletion_auc", "insertion_auc", "infidelity"]].agg(["mean", "std"]).round(4)
|
| 580 |
-
st.dataframe(summary,
|
| 581 |
|
| 582 |
csv_bytes = df.to_csv(index=False).encode()
|
| 583 |
st.download_button(
|
|
@@ -586,9 +586,9 @@ def run_batch_benchmark(model, config, cfg, labels, device):
|
|
| 586 |
file_name="xai_benchmark_results.csv",
|
| 587 |
mime="text/csv",
|
| 588 |
type="primary",
|
| 589 |
-
|
| 590 |
)
|
| 591 |
-
st.dataframe(df,
|
| 592 |
|
| 593 |
# βββ Main βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 594 |
|
|
@@ -731,11 +731,11 @@ def main():
|
|
| 731 |
st.info("Click **βΆ Run Analysis** in the sidebar to compute attributions.")
|
| 732 |
col1, col2 = st.columns([1, 2])
|
| 733 |
with col1:
|
| 734 |
-
st.image(display_img, caption="Input Image",
|
| 735 |
with col2:
|
| 736 |
st.plotly_chart(
|
| 737 |
plot_top_predictions(probs, labels, top_k=5),
|
| 738 |
-
|
| 739 |
)
|
| 740 |
return
|
| 741 |
|
|
@@ -796,12 +796,12 @@ def main():
|
|
| 796 |
colormap=cfg["colormap"],
|
| 797 |
alpha=cfg["alpha"],
|
| 798 |
)
|
| 799 |
-
st.image(fig_to_pil(fig),
|
| 800 |
|
| 801 |
st.markdown("#### Top-5 Predictions")
|
| 802 |
st.plotly_chart(
|
| 803 |
plot_top_predictions(probs, labels, top_k=5),
|
| 804 |
-
|
| 805 |
)
|
| 806 |
|
| 807 |
# ββ Tab 2: Individual interactive maps βββββββββββββββββββββββββββββββββββββ
|
|
@@ -817,7 +817,7 @@ def main():
|
|
| 817 |
method_name,
|
| 818 |
colormap="Hot",
|
| 819 |
)
|
| 820 |
-
st.plotly_chart(plotly_fig,
|
| 821 |
st.divider()
|
| 822 |
|
| 823 |
# ββ Tab 3: Statistics ββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
@@ -889,7 +889,7 @@ def main():
|
|
| 889 |
ann.font.color = "white"
|
| 890 |
fig.update_xaxes(gridcolor="#2a2f3e")
|
| 891 |
fig.update_yaxes(gridcolor="#2a2f3e")
|
| 892 |
-
st.plotly_chart(fig,
|
| 893 |
|
| 894 |
# ββ Tab 4: Method Info βββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 895 |
with tabs[3]:
|
|
|
|
| 381 |
st.markdown("**Eigen-IG**")
|
| 382 |
eigen_components = st.slider("Number of principal components", 1, 12, 5, 1)
|
| 383 |
|
| 384 |
+
run_btn = st.button("βΆ Run Analysis", use_column_width=True)
|
| 385 |
|
| 386 |
return {
|
| 387 |
"model_name": model_name,
|
|
|
|
| 577 |
|
| 578 |
st.markdown("#### Results summary (mean Β± std)")
|
| 579 |
summary = df.groupby("method")[["deletion_auc", "insertion_auc", "infidelity"]].agg(["mean", "std"]).round(4)
|
| 580 |
+
st.dataframe(summary, use_column_width=True)
|
| 581 |
|
| 582 |
csv_bytes = df.to_csv(index=False).encode()
|
| 583 |
st.download_button(
|
|
|
|
| 586 |
file_name="xai_benchmark_results.csv",
|
| 587 |
mime="text/csv",
|
| 588 |
type="primary",
|
| 589 |
+
use_column_width=True,
|
| 590 |
)
|
| 591 |
+
st.dataframe(df, use_column_width=True)
|
| 592 |
|
| 593 |
# βββ Main βββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 594 |
|
|
|
|
| 731 |
st.info("Click **βΆ Run Analysis** in the sidebar to compute attributions.")
|
| 732 |
col1, col2 = st.columns([1, 2])
|
| 733 |
with col1:
|
| 734 |
+
st.image(display_img, caption="Input Image", use_column_width=True).use_column_width
|
| 735 |
with col2:
|
| 736 |
st.plotly_chart(
|
| 737 |
plot_top_predictions(probs, labels, top_k=5),
|
| 738 |
+
use_column_width=True,
|
| 739 |
)
|
| 740 |
return
|
| 741 |
|
|
|
|
| 796 |
colormap=cfg["colormap"],
|
| 797 |
alpha=cfg["alpha"],
|
| 798 |
)
|
| 799 |
+
st.image(fig_to_pil(fig), use_column_width=True).use_column_width
|
| 800 |
|
| 801 |
st.markdown("#### Top-5 Predictions")
|
| 802 |
st.plotly_chart(
|
| 803 |
plot_top_predictions(probs, labels, top_k=5),
|
| 804 |
+
use_column_width=True,
|
| 805 |
)
|
| 806 |
|
| 807 |
# ββ Tab 2: Individual interactive maps βββββββββββββββββββββββββββββββββββββ
|
|
|
|
| 817 |
method_name,
|
| 818 |
colormap="Hot",
|
| 819 |
)
|
| 820 |
+
st.plotly_chart(plotly_fig, use_column_width=True)
|
| 821 |
st.divider()
|
| 822 |
|
| 823 |
# ββ Tab 3: Statistics ββββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
|
|
|
| 889 |
ann.font.color = "white"
|
| 890 |
fig.update_xaxes(gridcolor="#2a2f3e")
|
| 891 |
fig.update_yaxes(gridcolor="#2a2f3e")
|
| 892 |
+
st.plotly_chart(fig, use_column_width=True)
|
| 893 |
|
| 894 |
# ββ Tab 4: Method Info βββββββββββββββββββββββββββββββββββββββββββββββββββββ
|
| 895 |
with tabs[3]:
|
packages.txt
ADDED
|
@@ -0,0 +1,2 @@
|
|
|
|
|
|
|
|
|
|
| 1 |
+
libgl1-mesa-glx
|
| 2 |
+
libglib2.0-0
|