docs: remove frame-extraction workflow from SKILL.md, keep video-direct approach only
register-skill-release / register (push) Successful in 20s Details

Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
ywkj 2026-04-25 16:53:50 +08:00
parent db4735e54e
commit e9e1f01728
1 changed files with 16 additions and 41 deletions

View File

@ -1,11 +1,11 @@
--- ---
name: video-product-snapshot name: video-product-snapshot
description: "Detect ecommerce products in video frames using Claude Vision, extract the best product snapshot, and optionally search via image-search API. Use when the user provides a video and wants to find/identify products shown in it. / 检测视频中的商品提取最佳商品截图并通过图片搜索在1688找同款。当用户提供视频想找商品时使用。" description: "Upload video to API for product analysis and 1688 keyword search. / 上传视频直接识别商品并在1688搜索同款。当用户提供视频想找商品时使用。"
--- ---
# Video Product Snapshot — 视频商品截图 # Video Product Snapshot — 视频商品截图
从视频中提取最佳商品画面,通过 Claude Vision 检测并截取,然后在 1688 上以图搜图 + 关键词重排序找到同款商品。 上传视频到 API由多模态模型识别商品主体生成中文关键词在 1688 上搜索找到同款商品。
## 运行 ## 运行
@ -17,17 +17,14 @@ bun dist/run.js <command> [args] [--dry-run]
| 命令 | 使用场景 | | 命令 | 使用场景 |
|------|---------| |------|---------|
| `detect-video-and-search <video>` | **推荐。** 直接上传视频到 API 识别商品主体,然后 1688 关键词搜索。跳过本地抽帧,无需 Vision API。 | | `detect-video-and-search <video>` | **推荐。** 上传视频到 API 识别商品,然后 1688 关键词搜索。 |
| `detect-best-and-search <video>` | 旧版。抽帧 + Vision 排名 + 搜图。需要 Vision API key。 |
| `detect-video <video>` | 只识别商品描述和生成关键词,不搜图。 | | `detect-video <video>` | 只识别商品描述和生成关键词,不搜图。 |
| `detect-best <video>` | 旧版。只提取最佳画面,不搜图。 |
| `search <image-path>` | 已经有商品截图了,跳过检测直接搜图。 | | `search <image-path>` | 已经有商品截图了,跳过检测直接搜图。 |
| `detect-and-search <video>` | 旧版。**不推荐。** |
| `session` | 获取当前认证会话 token。 | | `session` | 获取当前认证会话 token。 |
## `detect-video` / `detect-video-and-search` ## `detect-video` / `detect-video-and-search`
上传视频到 API 直接识别商品主体,不走本地抽帧 上传视频到 API 直接识别商品主体。
流程: 流程:
1. 上传视频 → 获取公开 URL复用现有上传接口 1. 上传视频 → 获取公开 URL复用现有上传接口
@ -41,45 +38,24 @@ bun dist/run.js <command> [args] [--dry-run]
- LiteLLM 代理支持 `video_url` 内容类型 - LiteLLM 代理支持 `video_url` 内容类型
- 上传接口返回公开 URL - 上传接口返回公开 URL
## `detect-best` / `detect-best-and-search` 选项
| 参数 | 默认值 | 说明 |
|------|--------|------|
| `--interval=<秒>` | `0.5` | 抽帧间隔(秒) |
| `--max-frames=<数量>` | `60` | 最多抽帧数 |
| `--output-dir=<目录>` | 视频同目录 | 帧图片保存目录 |
## 画面选择原理
两轮 Vision 流水线:
1. **过滤轮**(仅 `detect` / `detect-and-search`)—— 每帧二分类:保留/丢弃。可能过于严格返回空。
2. **排名轮** —— 所有候选帧一起发给模型,从中选出最清晰、最完整、最突出的一张商品图。
`detect-best` 跳过第一轮,所有帧直接进排名轮。超过 20 帧时会均匀采样到 20 帧再调用。**只要视频能出帧,就一定返回结果。**
## 输出格式 ## 输出格式
### `detect-video-and-search`
```json ```json
{ {
"bestSnapshot": { "videoUrl": "https://...",
"frameIndex": 4, "description": "白色帆布收纳盒,带提手,可折叠",
"timestampSeconds": 2, "keyword": "帆布收纳盒",
"imagePath": "/path/to/frame_0004.jpg", "searchResults": [
"croppedImagePath": "/path/to/frame_0004_cropped.jpg", { "num_iid": 123, "title": "...", "price": "15.00", "promotion_price": "12.00", "sales": 500, "detail_url": "..." }
"confidence": 0.95, ]
"description": "White sneaker with blue logo, left side view",
"boundingHint": "Product fully visible, centered, no hands"
},
"rerank": {
"results": [...]
}
} }
``` ```
## 结果展示格式 ## 结果展示格式
CLI 执行完成后,将 `rerank.results` 格式化为 markdown 表格,**每页 5 行**(如不足 5 行则全显示)。 `searchResults` 格式化为 markdown 表格,**每页 5 行**(不足 5 行则全显示):
| # | 商品名称 | 价格 | 销量 | 链接 | | # | 商品名称 | 价格 | 销量 | 链接 |
|---|----------|------|------|------| |---|----------|------|------|------|
@ -93,7 +69,7 @@ CLI 执行完成后,将 `rerank.results` 格式化为 markdown 表格,**每
### 视频命令(慢 — 用 sub-agent 执行) ### 视频命令(慢 — 用 sub-agent 执行)
涉及命令:`detect-video-and-search`、`detect-best-and-search`、`detect-best`、`detect-and-search`、`detect-video` 涉及命令:`detect-video-and-search`、`detect-video`
使用 `sessions_spawn` 创建 sub-agent 执行,**不要直接运行**。 使用 `sessions_spawn` 创建 sub-agent 执行,**不要直接运行**。
@ -114,6 +90,5 @@ sessions_spawn(
### 通用规则 ### 通用规则
1. **视频输入 → 优先用 `detect-video-and-search`。** 比抽帧方案更可靠。如果没配视频模型,降级到 `detect-best-and-search`。不要用 `detect-and-search` 1. **不要重试。** 命令失败就直接报错。
2. **不要重试。** 命令失败就直接报错。 2. **信任工具输出。** CLI 内部已处理 session 管理和错误格式化。
3. **信任工具输出。** CLI 内部已处理 session 管理和错误格式化。