[{"data":1,"prerenderedAt":-1},["ShallowReactive",2],{"project-79191":3},{"id":4,"name":5,"fullName":6,"owner":7,"repo":5,"description":8,"homepage":9,"htmlUrl":9,"language":10,"languages":9,"totalLinesOfCode":9,"stars":11,"forks":12,"watchers":13,"openIssues":14,"contributorsCount":14,"subscribersCount":14,"size":14,"stars1d":14,"stars7d":14,"stars30d":15,"stars90d":14,"forks30d":14,"starsTrendScore":14,"compositeScore":16,"rankGlobal":9,"rankLanguage":9,"license":17,"archived":18,"fork":18,"defaultBranch":19,"hasWiki":18,"hasPages":18,"topics":20,"createdAt":9,"pushedAt":9,"updatedAt":21,"readmeContent":22,"aiSummary":23,"trendingCount":14,"starSnapshotCount":14,"syncStatus":24,"lastSyncTime":25,"discoverSource":26},79191,"video-frame-sampler","kppox\u002Fvideo-frame-sampler","kppox","Content-aware frame sampling strategies for video-LLMs.",null,"Python",222,4227,6,0,187,10,"Other",false,"main",[],"2026-06-12 02:03:49","\u003Cdiv align=\"center\">\n\n# video-frame-sampler\n\n**Smarter frame sampling for video-language models.**\n\n[![Python 3.9+](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002Fpython-3.9+-blue.svg)](https:\u002F\u002Fwww.python.org\u002F) [![License: MIT](https:\u002F\u002Fimg.shields.io\u002Fbadge\u002FLicense-MIT-yellow.svg)](LICENSE)\n\n[Install](#install) · [Usage](#usage) · [Strategies](#strategies)\n\n\u003C\u002Fdiv>\n\n---\n\nMost video-LLM training and eval pipelines pick frames via `np.linspace(0, T, k)`.\nThat works for static scenes, fails for scenes with cuts, and over-samples for\nslow shots. This library bundles a handful of *content-aware* sampling\nstrategies behind a single interface.\n\n## Strategies\n\n| Name              | What it does                                            | Cost   |\n|-------------------|---------------------------------------------------------|--------|\n| `uniform`         | classic linspace baseline                               | free   |\n| `fps`             | fixed FPS regardless of clip length                     | free   |\n| `scene_aware`     | detect cuts, then linspace inside each scene            | medium |\n| `motion_peak`     | sample around the K highest-motion frames               | medium |\n| `clip_diverse`    | greedy CLIP-feature diversity selection                 | heavy  |\n\n## Install\n\n```bash\npip install video-frame-sampler          # not yet on PyPI\n# or: pip install -e .\n```\n\nSystem: `ffmpeg`. For `clip_diverse` you'll want a GPU torch install.\n\n## Usage\n\n```python\nfrom vfs import sample_frames\n\n# 8 evenly spaced frames around scene cuts\nframes = sample_frames(\"clip.mp4\", k=8, strategy=\"scene_aware\")\n```\n\nCLI:\n\n```bash\nvfs sample clip.mp4 --k 8 --strategy motion_peak --out frames\u002F\n```\n\n## Why bother\n\nOn a small internal video-QA eval (~2k clips, 8 frames each), switching from\n`uniform` to `scene_aware` lifted answer accuracy by 2.1 points on LLaVA-Next-V\nand 1.7 on Qwen2-VL — without changing the model.\n\n## License\n\nMIT.\n","video-frame-sampler 是一个用于视频-语言模型的内容感知帧采样策略库。其核心功能是提供多种内容感知的帧采样方法，如基于场景检测、运动峰值和特征多样性选择等，以替代传统的均匀采样方式。这些策略通过统一接口实现，易于集成和使用。项目支持Python 3.9+，并依赖于FFmpeg，部分高级功能需要GPU支持。适用于视频-语言模型训练与评估场景中，特别是当视频内容包含频繁剪辑或缓慢镜头时，能够显著提升模型性能。例如，在内部测试中，从均匀采样切换到场景感知采样后，LLaVA-Next-V 和 Qwen2-VL 模型的答案准确率分别提高了2.1和1.7个百分点。",2,"2026-06-01 03:48:11","CREATED_QUERY"]