Commit Β·
0102b7e
1
Parent(s): 46cbd59
Remove cumulative-patches chart and packed-canvases gallery; trim hero tagline
Browse files
app.py
CHANGED
|
@@ -1039,21 +1039,10 @@ def process(
|
|
| 1039 |
+ (" (log1p applied)" if score_log_scale else ""),
|
| 1040 |
"elapsed_sec": round(time.time() - t0, 2),
|
| 1041 |
}
|
| 1042 |
-
progress(0.95, desc="Building charts")
|
| 1043 |
-
duration_sec = (total / fps) if fps > 0 else 0.0
|
| 1044 |
-
chart_fig = make_charts(
|
| 1045 |
-
grids, masks, fids, uniform_frame_ids, uniform_requested_frames,
|
| 1046 |
-
uniform_full_frame_patches,
|
| 1047 |
-
fps, duration_sec,
|
| 1048 |
-
int(total_patches), saliency_signal,
|
| 1049 |
-
groups=groups, gop_label=gop_resolved,
|
| 1050 |
-
)
|
| 1051 |
-
|
| 1052 |
progress(1.0, desc="Done")
|
| 1053 |
return (
|
| 1054 |
-
vis_path,
|
| 1055 |
json.dumps(info, indent=2, ensure_ascii=False),
|
| 1056 |
-
chart_fig,
|
| 1057 |
)
|
| 1058 |
|
| 1059 |
|
|
@@ -1507,8 +1496,7 @@ HERO_HTML = """
|
|
| 1507 |
<h1>OneVision Encoder</h1>
|
| 1508 |
<p class="tagline">
|
| 1509 |
Codec-style patch saliency for video understanding — see which
|
| 1510 |
-
patches the encoder picks from your video
|
| 1511 |
-
canvas LLaVA-OneVision consumes.
|
| 1512 |
</p>
|
| 1513 |
<div class="ovc-links">
|
| 1514 |
<a href="https://www.lmms-lab.com/onevision-encoder/index.html" target="_blank" rel="noopener">π Homepage</a>
|
|
@@ -1655,51 +1643,17 @@ with gr.Blocks(**_BLOCK_KW) as demo:
|
|
| 1655 |
label="", show_label=False, autoplay=True, height=460,
|
| 1656 |
)
|
| 1657 |
|
| 1658 |
-
with gr.Group(elem_classes="ovc-card
|
| 1659 |
-
gr.Markdown("###
|
| 1660 |
gr.Markdown(
|
| 1661 |
-
"<small>
|
| 1662 |
-
"
|
| 1663 |
-
"
|
| 1664 |
-
"sampling β evenly samples complete frames from the same "
|
| 1665 |
-
"time window, targeting the same sampled-frame count as "
|
| 1666 |
-
"codec when the budget allows. Each step costs "
|
| 1667 |
-
"<b>patch_size^2</b> patches, regardless of the preview "
|
| 1668 |
-
"frame resolution. The dotted line marks the requested "
|
| 1669 |
-
"budget.</small>"
|
| 1670 |
)
|
| 1671 |
-
|
| 1672 |
-
|
| 1673 |
-
|
| 1674 |
-
|
| 1675 |
-
with gr.Group(elem_classes="ovc-card"):
|
| 1676 |
-
gr.Markdown("### Packed canvases (one per GOP group)")
|
| 1677 |
-
gr.Markdown(
|
| 1678 |
-
"<small>Each canvas is one GOP group rendered in "
|
| 1679 |
-
"<b>I/P structure</b>: the group's first frame is "
|
| 1680 |
-
"the <b>I-frame</b> kept whole on top, and each "
|
| 1681 |
-
"later frame gets its own packed <b>P-frame</b> "
|
| 1682 |
-
"section below in time order. Fixed GOP=N means "
|
| 1683 |
-
"<b>one canvas per N sampled frames</b>.</small>"
|
| 1684 |
-
)
|
| 1685 |
-
canvas_out = gr.Gallery(
|
| 1686 |
-
label="", show_label=False,
|
| 1687 |
-
columns=2, rows=2, height=520,
|
| 1688 |
-
object_fit="contain",
|
| 1689 |
-
preview=True,
|
| 1690 |
-
)
|
| 1691 |
-
with gr.Column(scale=5, min_width=340):
|
| 1692 |
-
with gr.Group(elem_classes="ovc-card"):
|
| 1693 |
-
gr.Markdown("### Raw JSON")
|
| 1694 |
-
gr.Markdown(
|
| 1695 |
-
"<small>Full reproducible record of this run "
|
| 1696 |
-
"(params, frame ids, group spans). Collapsed by "
|
| 1697 |
-
"default β click to expand.</small>"
|
| 1698 |
-
)
|
| 1699 |
-
with gr.Accordion("Show full JSON", open=False):
|
| 1700 |
-
info_out = gr.Code(
|
| 1701 |
-
label="", language="json", lines=22,
|
| 1702 |
-
)
|
| 1703 |
|
| 1704 |
gr.HTML(
|
| 1705 |
'<div id="ovc-footer">'
|
|
@@ -1718,7 +1672,7 @@ with gr.Blocks(**_BLOCK_KW) as demo:
|
|
| 1718 |
saliency_signal, score_log_scale, bitcost_pct, fade_strength,
|
| 1719 |
gop,
|
| 1720 |
],
|
| 1721 |
-
outputs=[vis_out,
|
| 1722 |
)
|
| 1723 |
|
| 1724 |
btn_demo.click(
|
|
|
|
| 1039 |
+ (" (log1p applied)" if score_log_scale else ""),
|
| 1040 |
"elapsed_sec": round(time.time() - t0, 2),
|
| 1041 |
}
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1042 |
progress(1.0, desc="Done")
|
| 1043 |
return (
|
| 1044 |
+
vis_path,
|
| 1045 |
json.dumps(info, indent=2, ensure_ascii=False),
|
|
|
|
| 1046 |
)
|
| 1047 |
|
| 1048 |
|
|
|
|
| 1496 |
<h1>OneVision Encoder</h1>
|
| 1497 |
<p class="tagline">
|
| 1498 |
Codec-style patch saliency for video understanding — see which
|
| 1499 |
+
patches the encoder picks from your video.
|
|
|
|
| 1500 |
</p>
|
| 1501 |
<div class="ovc-links">
|
| 1502 |
<a href="https://www.lmms-lab.com/onevision-encoder/index.html" target="_blank" rel="noopener">π Homepage</a>
|
|
|
|
| 1643 |
label="", show_label=False, autoplay=True, height=460,
|
| 1644 |
)
|
| 1645 |
|
| 1646 |
+
with gr.Group(elem_classes="ovc-card"):
|
| 1647 |
+
gr.Markdown("### Raw JSON")
|
| 1648 |
gr.Markdown(
|
| 1649 |
+
"<small>Full reproducible record of this run "
|
| 1650 |
+
"(params, frame ids, group spans). Collapsed by "
|
| 1651 |
+
"default β click to expand.</small>"
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1652 |
)
|
| 1653 |
+
with gr.Accordion("Show full JSON", open=False):
|
| 1654 |
+
info_out = gr.Code(
|
| 1655 |
+
label="", language="json", lines=22,
|
| 1656 |
+
)
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
| 1657 |
|
| 1658 |
gr.HTML(
|
| 1659 |
'<div id="ovc-footer">'
|
|
|
|
| 1672 |
saliency_signal, score_log_scale, bitcost_pct, fade_strength,
|
| 1673 |
gop,
|
| 1674 |
],
|
| 1675 |
+
outputs=[vis_out, info_out],
|
| 1676 |
)
|
| 1677 |
|
| 1678 |
btn_demo.click(
|