Skip to main content

sampling-and-indexing

Standardize video sampling and frame indexing so interval instructions and mask frames stay aligned with a valid key/index scheme.

来源信息

仓库
benchflow-ai/skillsbench
最近来源活动
2026年1月23日 22:54
检测到的 SKILL.md 语言
英语
星标
1,830
分支
370

安装方式

默认使用会先检查来源的 Prompt;你也可以切换为直接命令,或下载本地副本。

检查来源文件

决定是否安装前,请先阅读 SKILL.md,以及 SkillsMP 当前展示的配套文件。

正在显示 SKILL.md

SKILL.md
来源说明 · 只读预览
name
sampling-and-indexing
description
Standardize video sampling and frame indexing so interval instructions and mask frames stay aligned with a valid key/index scheme.
# When to use - You need to decide a sampling stride/FPS and ensure *all downstream outputs* (interval instructions, per-frame artifacts, etc.) cover the same frame range with consistent indices. # Core steps - Read video metadata: frame count, fps, resolution. - Choose a sampling strategy (e.g., every 10 frames or target ~10–15 fps) to produce `sample_ids`. - Only produce instructions and masks for `sample_ids`; the max index must be `< total_frames`. - Use a strict interval key format such as `"{start}->{end}"` (integers only). Decide (and document) whether `end` is inclusive or exclusive, and be consistent. # Pseudocode ```python import cv2 VIDEO_PATH = "<path/to/video>" cap=cv2.VideoCapture(VIDEO_PATH) n=int(cap.get(cv2.CAP_PROP_FRAME_COUNT)) fps=cap.get(cv2.CAP_PROP_FPS) step=10 # example sample_ids=list(range(0, n, step)) if sample_ids[-1] != n-1: sample_ids.append(n-1) # Generate all downstream outputs only for sample_ids ``` # Self-check list - [ ] `sample_ids` strictly increasing, all < total frame count. - [ ] Output coverage max index matches `sample_ids[-1]` (or matches your documented sampling policy). - [ ] JSON keys are plain `start->end`, no extra text. - [ ] Any per-frame artifact store (e.g., NPZ) contains exactly the sampled frames and no extras.
在 GitHub 查看