Spaces:
Runtime error
Runtime error
Commit History
-
Remove cumulative-patches chart and packed-canvases gallery; trim hero tagline
0102b7e
-
Increase cumulative chart resolution
46cbd59 -
Clarify fixed GOP canvas count
616ab57 -
Show GOP canvases as explicit I/P sections
5a9b121
-
Align packed canvases with GOP groups
210c709 -
Use one IPPP canvas per GOP group
257cddf -
Refine border hierarchy and color balance
ff548c5 -
Widen and rebalance HF layout
cb21158 -
Override HF inner component borders
fdda169 -
Tune web-safe border colors and selection outlines
3bee947 -
Decouple cumulative chart baseline from preview resize
1476ac5 -
Restore original visualization resize behavior
34df0c5 -
Fix cumulative patches chart sampling baselines
2f7884e -
Surface per-frame patch breakdown in the chart legend + JSON
Chart : Legend now reads 'Codec · combined (1,024 total · per-frame min 32 · avg 64.0 · max 131)' 'Uniform baseline (1,024 total · 64/frame)' Telling the saliency story (uneven distribution) at a glance. JSON : Adds 'codec_per_frame_patches': [int, ...] — the raw count of patches selected by the codec at each sampled frame, so the chart numbers are reproducible / inspectable.0c2f8f4
-
Uniform baseline: same N frames as codec, equal per-frame allocation
Before, uniform baseline sampled budget // grid_size *full* frames, which often collapsed to 1 frame when the budget couldn't afford two whole grids. The chart then looked lopsided — codec hit the budget while uniform plateaued well below it. Now both methods sample the same N frames at the same timestamps; the patch budget is split equally per frame for the uniform side (budget // N each, remainder distributed). Both curves end exactly at the budget reference line, and the visual contrast becomes 'where the patches go' (saliency-skewed vs equal-height steps) instead of 'how many uniform frames fit'. Chart : 16 paired step jumps; codec uneven, uniform flat-height. JSON : 'uniform_baseline.frames' = sample_frames; 'patches_per_frame' = budget // N (and the explanation text reflects the new semantic). Subtitle clarified.75f6cf2 -
Chart: cumulative patch count over time, codec vs uniform
Replaces the two side-by-side bar panels with a single overlaid step chart so the contrast is immediate. X = time (s) Y = cumulative count of selected patches Indigo (solid) = codec saliency, rises in steps at each sampled frame by however many patches that frame contributed. Cyan (dashed) = uniform-sampling baseline at the same budget, stays flat between its evenly-spaced uniform frames and jumps by grid_size on each. Dotted gray line at y = total patches budget for reference; the codec curve hits it (== budget), the uniform curve typically falls short because budget rarely divides evenly into grid_size. Light dashed verticals show the GOP group boundaries. Section header retitled 'Cumulative patches over time' with a short legend in the subtitle explaining the two curves.b5599e7 -
IPPP canvas: overlay P-frame patches onto I-frame at same dimensions
Replaces the I-on-top + P-grid-below layout with the proper codec semantic: every frame in a group shares the picture size; a P-frame only encodes the macroblocks that need to change. Per sub-range: 1. Start canvas = I-frame's full image (canvas_h × canvas_w = hb*patch × wb*patch). 2. For each P-frame in time order, for every saliency-selected patch position (i, j), overwrite canvas[i*patch:(i+1)*patch, j*patch:(j+1)*patch] with the P-frame's pixels at that position. 3. Final canvas is what the encoder would have reconstructed at the end of this sub-range. Moving subjects produce visible 'ghost' trails because successive P-frame overlays at overlapping positions show the motion. Every canvas now ends up exactly the I-frame's dimensions — they all match each other regardless of how many P-frames the sub-range had. Accounting: total_selected_patches_incl_i_frames now sums the I-frame grid (hb*wb) plus the count of P-frame overlay hits (same position…e3d4cd8 -
Add 'Target canvases (total per video)' slider, default 4
Decouples the canvas count from the GOP grouping. The total is split across GOP groups as evenly as possible (the first `remainder` groups get +1 each, with a floor of 1 per group so nothing is invisible). Each group's frame range is then sliced into k consecutive sub-ranges, one IPPP canvas per sub-range. Examples (16 sampled frames, target=4): GOP=4 -> 4 groups × 1 canvas = 4 GOP=8 -> 2 groups × 2 canvases = 4 GOP=16 -> 1 group × 4 canvases = 4 Dynamic -> 4 groups × 1 canvas = 4 API - pack_canvases_per_group() now returns (canvases, sub_ranges, n_selected) and takes target_canvases. - Caption switches from 'Group K/N' to 'Canvas K/N · group G · I@#s + p P-frames' so the sub-range origin is visible. - Run info JSON 'canvases' entries get 'sub_range', and the params block gains 'target_canvases'. - DEMO_PRESET extended by one value.047a9df -
Canvas: one per GOP group with IPPP (I-frame + P-frame patches)
Replaces the single square 'all selected patches' canvas with one canvas per GOP group, mirroring the codec convention. Per group (frame range s..e): - frame s = I-frame: full image kept whole, occupies the top of the canvas (the keyframe anchor). - frames s+1..e = P-frames: only their saliency-selected patches go into the canvas, packed below the I-frame in a wb-wide grid in time-major raster order. Canvas width is locked to wb*patch so the I-frame and the P-grid align block-for-block, matching how LLaVA-OneVision tokenizes input. UI - gr.Image (single canvas) → gr.Gallery (N canvases, click any thumbnail to enlarge), columns=2 rows=2, height=380. - Caption per canvas: 'Group K/N · I-frame @ sampled #s + p P-frames'. - Card subtitle explains the IPPP convention. Run info JSON - Drop 'canvas_resolution' (single scalar). - Add 'canvases': [{index, size, group, structure}], 'n_canvases'. - 'total_selected_patches' renamed to 'total_selected_patches_incl…901e5ca -
Remove 'by lmms-lab' chip from hero
b4e26aa -
Rename viz mode 'Side-by-side' label to 'Both'
fefff2e -
Remove pipeline flow strip, Quick presets, Hero pills, GOP=global
UI cleanup pass: - Drop the dashed 'Sample › Score patches › GOP › Top-K › Visualize › Pack canvas' flow strip (FLOW_HTML and #ovc-flow CSS). - Drop the 'Quick presets' card with the Detail / Motion / Balanced buttons. The 'Load demo video' button in the Input card now plays the same one-click role. - Drop the three description chips at the bottom of the hero ('selection · heatmap · side-by-side', 'gradient + motion saliency', 'codec vs uniform baseline') plus their #ovc-hero .pills / .pill CSS. - Remove 'Global — one budget across the whole video' from the GOP Radio; default value moves from 'global' to '8'. The underlying grouped_topk_masks() still accepts 'global' if anyone wires it programmatically, but it is no longer exposed in the UI. - Tidy up dead code: PRESETS dict, apply_preset(), preset wiring loop, mobile @media rules that targeted the removed elements.14b5be9
-
Mobile responsive layout (≤768px and ≤480px breakpoints)
- Tag the main controls/outputs row with elem_classes='ovc-main' so we can target it specifically. - At ≤768px: collapse the two-column layout into a single stacked column (controls then outputs); shrink hero h1 (2.7rem → 2.05rem), tagline, by-line chip, link pills, and description pills; tighten pipeline-flow strip and hide its '›' arrows so the six steps wrap naturally; reduce card padding; cap the visualization video at 280px tall; trim Run button to 48px. - At ≤480px: shrink hero further (h1 1.7rem), trim links and step chips a notch, drop Run button to 46px. No JS changes; pure CSS.b7e9e0a -
Replace bottom Examples + top stats card with one demo button
- Remove the 'Run summary' tile card at the top of the output column; the four output panels (vis video, charts, canvas, raw JSON accordion) are enough. - Remove the bottom 'Demo video' card with three example rows; sat awkwardly below the layout. - Add a single 'Load demo video' button right under the upload widget in the Input card. One click fills every control with a curated preset (sbs · combined · log · GOP=dynamic · 1024 patches) and loads the bundled demo clip. - Button is hidden when examples/demo_codec_heatmap.mp4 is missing so the UI degrades cleanly on stripped checkouts. - process() is back to its 4-output signature.bb0f4d9 -
Fourth UI pass: stats tiles + tame Gradio empty placeholders
Summary tiles - render_stats_html() formats the run's headline numbers as a grid of brand-colored tiles (selected patches, groups, sampled frames, canvas, uniform baseline, saliency, patch grid, codec, elapsed). - process() now returns a 5th output and the Run button wires it into a new gr.HTML at the very top of the output column. - Empty state is itself a tile-styled placeholder so the column never feels broken. Empty placeholder polish (fix for 'output area has ugly black frame') - Drop the redundant ovc-empty placeholder gr.HTMLs that sat above each output component; they overlapped Gradio's own empty state and looked duplicated. - Blanket-override Gradio's dark default backgrounds inside .ovc-card (.video-container / .image-container / .image-frame / .preview / .plot-container / video / [data-testid="video"|"image"] / .icon-button / .upload-container) so the inner zones are transparent. - Repaint those wrappers with a soft brand-tin…82a1045 -
Merge branch 'main' of https://huggingface.co/spaces/FeilongTang/OneVision-Encoder-Codec-View into main
df94bff -
Third UI pass: pipeline flow, primary outputs, animations, empty states
Hero - "by lmms-lab" chip above the title. - Larger 2.7rem gradient title with animated background-position drift (ovc-shift, 9s loop) so the gradient feels alive. - Subtle 28px grid-pattern background reinforces the patch-grid metaphor without distracting from text. Pipeline flow strip - New dashed card under the hero showing the six pipeline stages: Sample -> Score -> GOP -> Top-K -> Visualize -> Pack canvas. Gives first-time visitors a one-glance map of what the demo does. Cards - Two tiers: regular ovc-card and accented ovc-card-primary used on the visualization video and the codec-vs-uniform charts. Primary cards carry an indigo ring + soft shadow so the eye lands on outputs first. - Section headers re-styled as pill chips (uppercase, tinted background, gradient bullet) for stronger visual hierarchy. - Card fade-in keyframe so newly rendered components animate in. Run button - Idle pulse (2.6s) draws attention before the first run…8c97d5b -
Add demo video for the Examples block
Verified signature9aa02e8 -
Add gr.Examples block (gated on demo file presence)
The block renders only if examples/demo_codec_heatmap.mp4 exists in the Space root, so checkouts without the binary still launch cleanly. Three preset rows ready for the demo clip: 1. Selection · gradient · global (baseline) 2. Heatmap · combined · log · dynamic (readiness story) 3. Side-by-side · combined · GOP=8 · 2048 budget (full feature) The video itself is uploaded separately via xet (binary files are not allowed through plain git push to HF Spaces).2482664 -
Add GOP parameter: fixed (4/8/16) and dynamic (energy-adaptive)
Mirrors codec_tools' grouping_mode {fixed, readiness} for the patch-selection stage of the demo. - global : one group across the whole video (current behavior). - 4/8/16 : fixed-size groups; budget split equally, top-K within each group. Forces patches to spread along the timeline instead of clumping on the single most salient moment. - dynamic : adaptive groups via build_dynamic_groups, walking sampled frames in time order and closing each group when its cumulative score sum reaches total_energy / target_groups. This is the simplified readiness rule from codec_tools/pipeline/process_video_bitcost_mv_mask_collage.py (equal-energy groups, no coverage_bins / delta-ratio refinement — this is a demo). The codec-vs-uniform chart now shows group boundaries as dashed vertical lines on the codec panel, and the title carries the GOP label and group count. Run info JSON gains…33347ae -
Rename to OneVision Encoder; global top-K; codec-vs-uniform charts
UI / brand - Rename Space and headings to "OneVision Encoder". - Hero now carries Homepage / Models / Tech Report / Model Card / Data Card links as pill-style buttons (white -> gradient on hover). - Card hover lift; tighter typography rhythm. Algorithm - Patch budget is now a single global Top-K spent across the whole video, not per-frame. High-saliency frames may receive many patches; low-saliency frames may receive zero. - Slider renamed to "Total patches budget (whole video)" with explanatory `info` text; range bumped to 64..8192, default 1024. Charts (gr.Plot) - Replaced the score histogram with a codec-vs-uniform comparison: * Left : x = time (s), y = patches selected at that timestamp by the codec saliency, including zero bars where the budget skipped the frame. * Right : x = time (s), y = full grid size, drawn for the N_uniform = budget // grid frames a uniform sampler would extract un…67e22fc -
Rename to OneVision Patch Inspector + presets, charts, UI polish
- Rename title in README and Hero block to "OneVision Patch Inspector". - Run info JSON moved into a default-collapsed Accordion to keep the output area tidy; a small summary blurb sits above it. - Visualization mode and saliency signal Radios now use (label, value) pairs so the meaning of "sbs" / "frame_diff" / etc. is visible. - Quick presets: three buttons (Detail / Motion / Balanced) wire through to atomically set saliency_signal + log + percentile + viz_mode. - Charts panel: matplotlib gr.Plot with a log-y patch-score histogram and a per-frame selected-count line, refreshed each run. - CSS pass: bigger hero with subtle radial glow, accent-bullet card headers, larger gradient Run button with hover lift, soft-gradient preset chips, footer divider. Container widened to 1320px. - requirements: matplotlib added (used for the charts panel).27a601e -
Fix Gradio 6.0 API breakage on HF Spaces
- Image() no longer accepts show_download_button; remove it. - theme/css moved off Blocks(...) to launch() in Gradio 6.0; detect gr.__version__ and route accordingly so the file still works under Gradio 4.x (local dev) and Gradio 6.x (HF Space).5c5ab4f -
Codec patch selection demo: visualization + canvas
- Replace probe with the codec_tools-style pipeline: uniform sample -> smart_resize -> per-patch saliency -> top-K selection -> visualization video + packed canvas. - Three viz modes: selection (kept-in-color, dropped fade-to-gray), heatmap (full-frame JET overlay), sbs (side-by-side). - Saliency: gradient (Sobel), frame_diff (motion), or combined. - Tunables: time window (start/end sec), top-K, patch size, max_pixels, log1p scoring, percentile normalization, fade strength, heatmap blend alpha. - Designer pass on UI: indigo Soft theme, hero gradient title, card-grouped controls, prominent Run button, output-priority layout, footer credit.36a9b0a
-
Add minimal ffprobe-based codec inspector
14590e3 -
initial commit
Verified signature3ba51be