From 91a623751dc8096313f7e64ef5f3199ad0280b30 Mon Sep 17 00:00:00 2001 From: ywkj Date: Sat, 25 Apr 2026 15:13:07 +0800 Subject: [PATCH] skill: translate user-facing docs to Chinese, add detect-best commands - SKILL.md / README.md: full Chinese translation for Chinese users - scripts/run.ts: help text in Chinese - src/: add detectBest and detectBestAndSearch commands Co-Authored-By: Claude Opus 4.7 --- README.md | 94 ++++++++++++++-------------- SKILL.md | 135 ++++++++++++++++------------------------ scripts/run.ts | 26 ++++---- src/index.ts | 83 +++++++++++++++++++++++- src/product-detector.ts | 34 ++++++++++ src/types.ts | 2 +- 6 files changed, 232 insertions(+), 142 deletions(-) diff --git a/README.md b/README.md index 4c04364..d7904c4 100644 --- a/README.md +++ b/README.md @@ -1,62 +1,62 @@ -# video-product-snapshot +# video-product-snapshot — 视频商品截图 -Detect ecommerce products in video frames using Claude Vision, extract the best product snapshot, and optionally search for matching products via image-search API. +检测视频中的电商商品,提取最佳商品画面,并通过图片搜索在 1688 找同款。 -## How it works +## 工作原理 -1. Extracts frames from the video at a configurable interval using `ffmpeg` -2. Sends each frame to a vision model to detect whether a product is visible and rate confidence -3. Picks the highest-confidence frame as the best snapshot -4. Optionally calls an image-search API with the snapshot to find matching products +1. 使用 `ffmpeg` 按配置间隔从视频抽帧 +2. 将每帧发给视觉模型,检测是否有商品并评分 +3. 选出置信度最高的帧作为最佳商品截图 +4. 可选:用这张截图调用图片搜索 API 找同款商品 -## Install +## 安装 ```bash bun install -bun run build # outputs dist/run.js +bun run build # 输出到 dist/run.js ``` -## Usage +## 使用方法 ```bash bun dist/run.js [options] ``` -### Commands +### 命令 -| Command | Description | -|---------|-------------| -| `detect