Media & Image v0.1.0

sampling-and-indexing

Standardize video sampling and frame indexing so interval instructions and mask frames stay aligned with a valid...

wu 更新于 2026-04-15 1 浏览
下载 SKILL

技能说明

Standardize video sampling and frame indexing so interval instructions and mask frames stay aligned with a valid key/index scheme.

使用场景

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.

直接复制以下提示词,发送给你的 AI 助手即可完成安装。

帮我下载并安装这个SKILL:https://skillhub.cstcloud.cn/download/sampling-and-indexing
  1. 点击上方「下载 SKILL」按钮,获取技能压缩包。
  2. 将压缩包解压到你的 Agent 技能目录。
  3. 重启客户端后即可在技能列表中选择该技能。

技能文件内容

4 个文件 · 15 kB
SKILL.md text/markdown
---
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."
---

# 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.

文件内容直接读取自技能仓库,仅供安装前审阅;以实际下载的压缩包为准。