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.
Install this agent skill to your Project
npx add-skill https://github.com/benchflow-ai/skillsbench/tree/main/tasks/dynamic-object-aware-egomotion/environment/skills/sampling-and-indexing
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.
Recommended Agent Skills
Expand your agent's capabilities with these related and highly-rated skills.
csv-processing
Use this skill when reading sensor data from CSV files, writing simulation results to CSV, processing time-series data with pandas, or handling missing values in datasets.
pid-controller
Use this skill when implementing PID control loops for adaptive cruise control, vehicle speed regulation, throttle/brake management, or any feedback control system requiring proportional-integral-derivative control.
yaml-config
Use this skill when reading or writing YAML configuration files, loading vehicle parameters, or handling config file parsing with proper error handling.
simulation-metrics
Use this skill when calculating control system performance metrics such as rise time, overshoot percentage, steady-state error, or settling time for evaluating simulation results.
vehicle-dynamics
Use this skill when simulating vehicle motion, calculating safe following distances, time-to-collision, speed/position updates, or implementing vehicle state machines for cruise control modes.
web-interface-guidelines
Vercel's comprehensive UI guidelines for building accessible, performant web interfaces. Use this skill when reviewing or building UI components for compliance with best practices around accessibility, performance, animations, and visual stability.
Didn't find tool you were looking for?