Commit 路
46cbd59
1
Parent(s): 616ab57
Increase cumulative chart resolution
Browse files
app.py
CHANGED
|
@@ -651,7 +651,11 @@ def make_charts(
|
|
| 651 |
The codec curve rises in bursts where saliency is high; the uniform
|
| 652 |
baseline rises in equal steps because every sampled full frame
|
| 653 |
contributes `patch_size^2` patches."""
|
| 654 |
-
|
|
|
|
|
|
|
|
|
|
|
|
|
| 655 |
|
| 656 |
fps_safe = float(fps) if fps and fps > 0 else 25.0
|
| 657 |
if grids:
|
|
@@ -726,10 +730,10 @@ def make_charts(
|
|
| 726 |
)
|
| 727 |
|
| 728 |
ax.fill_between(xx_c, yy_c, step=None, alpha=0.12, color="#4f46e5")
|
| 729 |
-
ax.plot(xx_c, yy_c, color="#4f46e5", linewidth=2.
|
| 730 |
ax.fill_between(xx_u, yy_u, step=None, alpha=0.10, color="#06b6d4")
|
| 731 |
ax.plot(
|
| 732 |
-
xx_u, yy_u, color="#06b6d4", linewidth=2.
|
| 733 |
label=uni_lbl,
|
| 734 |
)
|
| 735 |
|
|
@@ -739,7 +743,7 @@ def make_charts(
|
|
| 739 |
ax.text(
|
| 740 |
duration * 0.995, budget * 1.015,
|
| 741 |
f"budget {budget:,}", color="#475569",
|
| 742 |
-
fontsize=
|
| 743 |
)
|
| 744 |
|
| 745 |
# Group boundaries
|
|
@@ -751,7 +755,7 @@ def make_charts(
|
|
| 751 |
bx = times[end_idx]
|
| 752 |
ax.axvline(
|
| 753 |
bx, color="#cbd5e1", linestyle=(0, (3, 3)),
|
| 754 |
-
alpha=0.55, linewidth=
|
| 755 |
)
|
| 756 |
|
| 757 |
n_groups = len(groups) if groups else 1
|
|
@@ -759,17 +763,17 @@ def make_charts(
|
|
| 759 |
ax.set_title(
|
| 760 |
f"Cumulative patches selected over time 路 {saliency_signal} 路 "
|
| 761 |
f"{gop_str} ({n_groups} groups)",
|
| 762 |
-
fontsize=
|
| 763 |
)
|
| 764 |
-
ax.set_xlabel("time (s)", fontsize=
|
| 765 |
-
ax.set_ylabel("# patches selected (cumulative)", fontsize=
|
| 766 |
ax.set_xlim(-duration * 0.02, duration * 1.02)
|
| 767 |
ymax = max(budget, codec_total, uni_total) * 1.08 + 1
|
| 768 |
ax.set_ylim(0, ymax)
|
| 769 |
-
ax.tick_params(axis="both", labelsize=
|
| 770 |
ax.grid(True, alpha=0.25, linestyle="--", axis="y")
|
| 771 |
ax.spines[["top", "right"]].set_visible(False)
|
| 772 |
-
ax.legend(loc="upper left", fontsize=
|
| 773 |
|
| 774 |
fig.patch.set_facecolor("white")
|
| 775 |
return fig
|
|
|
|
| 651 |
The codec curve rises in bursts where saliency is high; the uniform
|
| 652 |
baseline rises in equal steps because every sampled full frame
|
| 653 |
contributes `patch_size^2` patches."""
|
| 654 |
+
# Use a larger physical canvas plus high DPI so Gradio/HF does not
|
| 655 |
+
# upscale a small rasterized plot into a blurry chart.
|
| 656 |
+
fig, ax = plt.subplots(
|
| 657 |
+
figsize=(11.4, 4.8), dpi=220, constrained_layout=True,
|
| 658 |
+
)
|
| 659 |
|
| 660 |
fps_safe = float(fps) if fps and fps > 0 else 25.0
|
| 661 |
if grids:
|
|
|
|
| 730 |
)
|
| 731 |
|
| 732 |
ax.fill_between(xx_c, yy_c, step=None, alpha=0.12, color="#4f46e5")
|
| 733 |
+
ax.plot(xx_c, yy_c, color="#4f46e5", linewidth=2.8, label=codec_lbl)
|
| 734 |
ax.fill_between(xx_u, yy_u, step=None, alpha=0.10, color="#06b6d4")
|
| 735 |
ax.plot(
|
| 736 |
+
xx_u, yy_u, color="#06b6d4", linewidth=2.8, linestyle="--",
|
| 737 |
label=uni_lbl,
|
| 738 |
)
|
| 739 |
|
|
|
|
| 743 |
ax.text(
|
| 744 |
duration * 0.995, budget * 1.015,
|
| 745 |
f"budget {budget:,}", color="#475569",
|
| 746 |
+
fontsize=10.0, va="bottom", ha="right",
|
| 747 |
)
|
| 748 |
|
| 749 |
# Group boundaries
|
|
|
|
| 755 |
bx = times[end_idx]
|
| 756 |
ax.axvline(
|
| 757 |
bx, color="#cbd5e1", linestyle=(0, (3, 3)),
|
| 758 |
+
alpha=0.55, linewidth=1.0,
|
| 759 |
)
|
| 760 |
|
| 761 |
n_groups = len(groups) if groups else 1
|
|
|
|
| 763 |
ax.set_title(
|
| 764 |
f"Cumulative patches selected over time 路 {saliency_signal} 路 "
|
| 765 |
f"{gop_str} ({n_groups} groups)",
|
| 766 |
+
fontsize=13, color="#1e293b",
|
| 767 |
)
|
| 768 |
+
ax.set_xlabel("time (s)", fontsize=11)
|
| 769 |
+
ax.set_ylabel("# patches selected (cumulative)", fontsize=11)
|
| 770 |
ax.set_xlim(-duration * 0.02, duration * 1.02)
|
| 771 |
ymax = max(budget, codec_total, uni_total) * 1.08 + 1
|
| 772 |
ax.set_ylim(0, ymax)
|
| 773 |
+
ax.tick_params(axis="both", labelsize=10)
|
| 774 |
ax.grid(True, alpha=0.25, linestyle="--", axis="y")
|
| 775 |
ax.spines[["top", "right"]].set_visible(False)
|
| 776 |
+
ax.legend(loc="upper left", fontsize=10, frameon=False, handlelength=2.8)
|
| 777 |
|
| 778 |
fig.patch.set_facecolor("white")
|
| 779 |
return fig
|