Sampling and Indexing
Standardize video sampling and frame indexing so interval instructions and mask frames stay aligned with a valid key/index scheme.
Install
npx skills add UCSB-NLP-Chang/Skill-Usage --skill sampling-and-indexinggit clone --depth 1 https://github.com/UCSB-NLP-Chang/Skill-Usage.git /tmp/Skill-Usage
mkdir -p ~/.claude/skills
cp -r /tmp/Skill-Usage/tasks/dynamic-object-aware-egomotion/environment/skills/sampling-and-indexing ~/.claude/skills/sampling-and-indexingPersonal skills live in ~/.claude/skills. Use .claude/skills in a project folder to share a skill with your team.
From the 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) 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.Details
- Skill name
sampling-and-indexing- Repository
- UCSB-NLP-Chang/Skill-Usage
- Path
tasks/dynamic-object-aware-egomotion/environment/skills/sampling-and-indexing/SKILL.md- Repo updated
- 8 April 2026
FAQ
What does the Sampling and Indexing skill do?
Standardize video sampling and frame indexing so interval instructions and mask frames stay aligned with a valid key/index scheme.
How do I install the Sampling and Indexing skill?
skills CLI (Claude Code, Cursor, Codex and more): npx skills add UCSB-NLP-Chang/Skill-Usage --skill sampling-and-indexing. Skills go in ~/.claude/skills (personal) or .claude/skills (project), and Claude loads them automatically when a task matches the description.
Is Sampling and Indexing popular?
It lives in UCSB-NLP-Chang/Skill-Usage, which has 49 GitHub stars and 5 forks.
Related skills
Pubchem Database
49UCSB-NLP-Chang/Skill-Usage
Query PubChem via PUG-REST API/PubChemPy (110M+ compounds). Search by name/CID/SMILES, retrieve properties, similarity/substructure searches, bioactivity, for cheminformatics.
Pymatgen
49UCSB-NLP-Chang/Skill-Usage
Materials science toolkit. Crystal structures (CIF, POSCAR), phase diagrams, band structure, DOS, Materials Project integration, format conversion, for computational materials science.
Rdkit
49UCSB-NLP-Chang/Skill-Usage
Cheminformatics toolkit for fine-grained molecular control. SMILES/SDF parsing, descriptors (MW, LogP, TPSA), fingerprints, substructure search, 2D/3D generation, similarity, reactions. For standard workflows with simpler interface, use datamol (wrapper around RDKit). Use rdkit for advanced control, custom sanitization, specialized algorithms.
Segment Combiner
49UCSB-NLP-Chang/Skill-Usage
Combine multiple segment detection results into a unified list. Use when you need to merge segments from different detectors, prepare removal lists for video processing, or consolidate detection outputs.
Report Generator
49UCSB-NLP-Chang/Skill-Usage
Generate compression reports for video processing. Use when you need to create structured JSON reports with duration statistics, compression ratios, and segment details after video processing.
Silence Detector
49UCSB-NLP-Chang/Skill-Usage
Detect initial silence segments in audio/video using energy-based analysis. Use when you need to find low-energy periods at the start of recordings (title slides, setup time, pre-roll silence).
Browse the most popular Claude skills, all images, video & audio skills, or write your own with the skills generator.