Spaces:
Runtime error
Runtime error
Commit 路
2482664
1
Parent(s): 33347ae
Add gr.Examples block (gated on demo file presence)
Browse filesThe 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).
1121 unmodified lines1122112311241125112611271121 unmodified lineslabel="", language="json", lines=18,)gr.HTML('<div id="ovc-footer">''<b>OneVision Encoder</b> 路 codec-style patch saliency demo 路 '1121 unmodified lines11221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671121 unmodified lineslabel="", language="json", lines=18,)DEMO_VIDEO = os.path.join(os.path.dirname(os.path.abspath(__file__)),"examples", "demo_codec_heatmap.mp4",)if os.path.exists(DEMO_VIDEO):with gr.Group(elem_classes="ovc-card"):gr.Markdown("### Demo video")gr.Markdown("<small>Click any row below to load the bundled clip with a ""preset configuration. Or upload your own video at the top.</small>")gr.Examples(examples=[[DEMO_VIDEO, 16, 14, 1024, 150000,"selection", 0.55, 0.0, 0.0,"gradient", False, 99.0, 0.55, "global",],[DEMO_VIDEO, 16, 14, 1024, 150000,"heatmap", 0.55, 0.0, 0.0,"combined", True, 96.0, 0.55, "dynamic",],[DEMO_VIDEO, 24, 14, 2048, 150000,"sbs", 0.55, 0.0, 0.0,"combined", True, 95.0, 0.55, "8",],],inputs=[video_in, sample_frames, patch_size, top_k, max_pixels,viz_mode, heatmap_alpha, start_sec, end_sec,saliency_signal, score_log_scale, bitcost_pct,fade_strength, gop,],label="",cache_examples=False,examples_per_page=5,)gr.HTML('<div id="ovc-footer">''<b>OneVision Encoder</b> 路 codec-style patch saliency demo 路 '
app.py+40