← 返回
未分类 中文

sampling-and-indexing

Standardize video sampling and frame indexing so interval instructions and mask frames stay aligned with a valid key/index scheme.
标准化视频采样和帧索引,确保间隔指令和掩码帧与有效的键/索引方案对齐。
wu-uk wu-uk 来源
未分类 clawhub v0.1.0 1 版本 99705 Key: 无需
★ 0
Stars
📥 338
下载
💾 0
安装
1
版本
#latest

概述

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

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.

版本历史

共 1 个版本

  • v0.1.0 当前
    2026-05-07 18:52 安全 安全

安全检测

腾讯云安全 (Keen)

安全,无风险
查看报告

腾讯云安全 (Sanbu)

安全,无风险
查看报告

🔗 相关推荐

xlsx

wu-uk
全面的电子表格创建、编辑与分析,支持公式、格式化、数据分析和可视化。当Claude需要工作时...
★ 1 📥 1,000
office-efficiency

modora

wu-uk
使用此技能,可通过远程 MoDora HTTP 服务分析 PDF,凭据通过声明的环境变量管理,不会在服务器上存储。
★ 0 📥 504

pdf

wu-uk
全面PDF工具,支持文本/表格提取、新PDF创建、合并/拆分文档、表单处理。当Claude需要...
★ 0 📥 512