AGENT SKILL
sampling-and-indexing
Standardize video sampling and frame indexing so interval instructions and mask frames stay aligned with a valid key/index scheme.
- License 许可
- Apache-2.0
- 最近更新
- 2026-11-14
- Stars
- ★ 0
- Forks
- 1
01 前言 Front Matter
- 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.
03 SKILL.md 正文
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) whetherendis inclusive or exclusive, and be consistent.
Pseudocode
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_idsstrictly 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.
04 同仓库更多 Skills
video-frame-extraction
Extract frames from video files and save them as images using OpenCV
★ 0
openai-vision
Analyze images and multi-frame sequences using OpenAI GPT vision models
★ 0
image-ocr
Extract text content from images using Tesseract OCR via Python, including structured field extraction from receipts and forms
★ 0
video-frame-extraction
Extract frames from video files and save them as images using OpenCV
★ 0
openai-vision
Analyze images and multi-frame sequences using OpenAI GPT vision models
★ 0
image-ocr
Extract text content from images using Tesseract OCR via Python, including structured field extraction from receipts and forms
★ 0