Sampling and indexing

From xuansenpa1/skillrevise · View interactive version

Sampling and indexing is an AI agent skill from the GitHub repository xuansenpa1/skillrevise. Standardize video sampling and frame indexing so interval instructions and mask frames stay aligned with a valid key/index scheme.

How to use this skill

Skill file

When to use

Core steps

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

Use this skill with your AI agent: Open on Skill Issue to copy, download, or add to your library. Works with Claude, ChatGPT, Gemini, Cursor, Windsurf and more.