Upload app.py with huggingface_hub
Browse files
app.py
CHANGED
|
@@ -378,11 +378,11 @@ def _saliency_figure(sal, p_mean, net_names=None, net_bounds=None, net_colors=No
|
|
| 378 |
for s, e in zip(_nb[:-1], _nb[1:])
|
| 379 |
])
|
| 380 |
|
| 381 |
-
fig = plt.figure(figsize=(20,
|
| 382 |
fig.patch.set_facecolor("#0e1015")
|
| 383 |
import matplotlib.gridspec as gridspec
|
| 384 |
gs = gridspec.GridSpec(2, 2, figure=fig, hspace=0.38, wspace=0.32,
|
| 385 |
-
height_ratios=[1.
|
| 386 |
axes = [
|
| 387 |
fig.add_subplot(gs[0, 0]), # heatmap
|
| 388 |
fig.add_subplot(gs[0, 1]), # bar chart
|
|
@@ -423,8 +423,8 @@ def _saliency_figure(sal, p_mean, net_names=None, net_bounds=None, net_colors=No
|
|
| 423 |
for i in range(n_nets):
|
| 424 |
for j in range(n_nets):
|
| 425 |
txt_color = "#111" if net_sal[i, j] > 0.6 * vmax else "#666"
|
| 426 |
-
ax.text(j, i, f"{net_sal[i, j]:.
|
| 427 |
-
fontsize=
|
| 428 |
if (i, j) in top5_cells:
|
| 429 |
rect = plt.Rectangle((j - 0.48, i - 0.48), 0.96, 0.96,
|
| 430 |
linewidth=1.8, edgecolor="#ffffff",
|
|
|
|
| 378 |
for s, e in zip(_nb[:-1], _nb[1:])
|
| 379 |
])
|
| 380 |
|
| 381 |
+
fig = plt.figure(figsize=(20, 22))
|
| 382 |
fig.patch.set_facecolor("#0e1015")
|
| 383 |
import matplotlib.gridspec as gridspec
|
| 384 |
gs = gridspec.GridSpec(2, 2, figure=fig, hspace=0.38, wspace=0.32,
|
| 385 |
+
height_ratios=[1.0, 1.4])
|
| 386 |
axes = [
|
| 387 |
fig.add_subplot(gs[0, 0]), # heatmap
|
| 388 |
fig.add_subplot(gs[0, 1]), # bar chart
|
|
|
|
| 423 |
for i in range(n_nets):
|
| 424 |
for j in range(n_nets):
|
| 425 |
txt_color = "#111" if net_sal[i, j] > 0.6 * vmax else "#666"
|
| 426 |
+
ax.text(j, i, f"{net_sal[i, j]:.5f}", ha="center", va="center",
|
| 427 |
+
fontsize=7.5, color=txt_color, zorder=3)
|
| 428 |
if (i, j) in top5_cells:
|
| 429 |
rect = plt.Rectangle((j - 0.48, i - 0.48), 0.96, 0.96,
|
| 430 |
linewidth=1.8, edgecolor="#ffffff",
|