sampling-and-indexing
Sample the video at the required FPS and keep indices consistent so JSON intervals and NPZ masks refer to **sample indices** (0..S-1) with half-open ranges.
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-14
- Stars
- ★ 0
- Forks
- 1
01 前言 Front Matter
- name
- sampling-and-indexing
- description
- Sample the video at the required FPS and keep indices consistent so JSON intervals and NPZ masks refer to **sample indices** (0..S-1) with half-open ranges.
03 SKILL.md 正文
Steps
- Read video metadata (
total_frames,src_fps,H,W) from/root/input.mp4. - Set
target_fps = 5and compute a frame stridestep = max(1, int(round(src_fps / target_fps))). - Create original-frame sample positions:
sample_frame_ids = list(range(0, total_frames, step)). - Define sample indices
i = 0..S-1whereS = len(sample_frame_ids). All downstream artifacts (labels, masks) must be stored by this sample indexi(consecutive starting at 0), not by original frame number. - When writing interval keys for motion labels, use half-open sample-index ranges:
"{start}->{end}"covers sampled indices[start,end)(so0->1means sample 0 only). - Ensure the NPZ contains exactly one mask per sampled index
i(0..S-1), with matching consecutive keys.
Expected Result
A sampled frame sequence at ~5 fps with a clear mapping from sample index i to original video frame id, and all outputs (JSON intervals, NPZ masks) aligned to the same consecutive sample-index timeline [0,S).
04 同仓库更多 Skills
video-frame-extraction
Extract frames from video files and save them as images using OpenCV
openai-vision
Analyze images and multi-frame sequences using OpenAI GPT vision models
image-ocr
Extract text content from images using Tesseract OCR via Python, including structured field extraction from receipts and forms
video-frame-extraction
Extract frames from video files and save them as images using OpenCV
openai-vision
Analyze images and multi-frame sequences using OpenAI GPT vision models
image-ocr
Extract text content from images using Tesseract OCR via Python, including structured field extraction from receipts and forms