--- title: ToolMerge Video Keyframe Retrieval emoji: 🎬 colorFrom: pink colorTo: gray sdk: gradio sdk_version: 6.20.0 app_file: app.py short_description: Decompose queries into tool calls for keyframe retrieval python_version: "3.12" startup_duration_timeout: 1h pinned: false --- # ToolMerge — Long-Video Keyframe Retrieval Live demo of **[ToolMerge](https://github.com/michalsr/ToolMerge)** ("Decomposing Queries into Tool Calls for Long-Video Keyframe Retrieval", [paper 2605.23826](https://huggingface.co/papers/2605.23826)). A text-only **Qwen3-VL planner** ([`michalsr/toolmerge-planner-grpo`](https://huggingface.co/michalsr/toolmerge-planner-grpo)) decomposes your question + answer choices into independent visual-search tool calls combined with **AND / OR** boolean operators. Each query is text-encoded with [SigLIP-2](https://huggingface.co/google/siglip2-giant-opt-patch16-384) and scored against every sampled frame; the per-tool percentile ranks are merged (AND = min, OR = max), and greedy temporal NMS (τ = min(D/2K, 10)s) selects the final top-K keyframes. This demo runs the paper's **SigLIP path**. The T-REN region-text tool and the OCR-judge stage require offline-built per-video caches and separate weights and are omitted; the boolean merge runs SigLIP-only, exactly as the reference code does when other tools are disabled via `enabled_tools`.