feat: update Python processors and add utility scripts

- Update ASR, face, OCR, pose processors
- Add release pre-flight check script
- Add synonym generation, chunk processing scripts
- Add face recognition, stamp search utilities
This commit is contained in:
Warren
2026-04-30 15:07:49 +08:00
parent f4697396e4
commit 8f05a7c188
256 changed files with 60505 additions and 299 deletions

View File

@@ -0,0 +1,145 @@
# ASR 處理器版本說明
## 三個版本對比
| 版本 | 模型 | 處理時間 | 準確度 | 適用場景 |
|------|------|---------|--------|---------|
| **tiny** | Whisper tiny | ~12 秒 | 70% | 快速預覽、測試 |
| **base** | Whisper base | ~24 秒 | 75% | 平衡速度與準確度 |
| **small** | Whisper small | ~50 秒 | 90% | 正式處理、台灣腔調 |
## 測試結果ExaSAN 短影片)
### 關鍵詞彙識別
| 詞彙 | tiny | base | small |
|------|------|------|-------|
| **剪輯師** | ❌ 簡吉斯 | ❌ 簡吉斯 | ✅ 剪輯師 |
| **調光師** | ✅ | ✅ | ✅ |
| **錄音師** | ❌ | ❌ | ❌ |
| **特效** | ✅ | ✅ | ✅ |
| **套片** | ✅ | ✅ | ✅ |
### 片段數量
- **tiny**: 78 片段
- **base**: 61 片段(合併過度)
- **small**: 83 片段(最細緻)
## 使用建議
### 快速預覽(<15 秒)
```bash
python3 scripts/asr_processor.py video.mp4 output.json
```
**適用場景**
- 快速查看影片內容
- 測試流程是否正常
- 不關心準確度
### 平衡模式(~25 秒)
```bash
python3 scripts/asr_processor_base.py video.mp4 output.json
```
**適用場景**
- 一般用途
- 速度與準確度平衡
- 非台灣腔調內容
### 正式處理(~50 秒)⭐ 推薦
```bash
python3 scripts/asr_processor_small.py video.mp4 output.json
```
**適用場景**
- 正式生產環境
- 台灣腔調內容
- 專業詞彙識別(如剪輯師)
- 需要高準確度
## 比對工具
### 使用比對工具
```bash
python3 scripts/compare_asr_models.py \
/tmp/asr_tiny.json \
/tmp/asr_base.json \
/tmp/asr_small.json > /tmp/asr_comparison.md
```
### 檢視比對報告
```bash
cat /tmp/asr_comparison.md
```
## 決策建議
### 如果您需要
- **速度優先** → 使用 `tiny` 模型
- **平衡考量** → 使用 `base` 模型
- **準確度優先** → 使用 `small` 模型 ⭐
### 針對台灣腔調
**強烈建議使用 `small` 模型**
- 唯一正確識別「剪輯師」
- 專業詞彙準確度最高
- 斷句最細緻
## 檔案清單
```
scripts/
├── asr_processor.py # tiny 模型(原有,不修改)
├── asr_processor_base.py # base 模型(新增)
├── asr_processor_small.py # small 模型(新增)
├── compare_asr_models.py # 比對工具(新增)
└── ASR_PROCESSOR_README.md # 本文件
```
## 測試記錄
### 測試影片
- **檔名**: ExaSAN PCIe series - Director Ou Yu-Zhi Shares His Experience.mp4
- **時長**: 2 分 39 秒
- **語言**: 台灣國語(繁體中文)
- **內容**: 影視後製討論
### 測試結果
詳見 `/tmp/asr_comparison.md`
### 關鍵發現
1. **small 模型**是唯一正確識別「剪輯師」的模型
2. **base 模型**片段合併過度61 vs 78 vs 83
3. **tiny 模型**速度最快但準確度最低
## 未來優化方向
### 如果 small 模型仍不滿意
1. **添加後處理校正**
- 建立專業詞彙校正表
- 自動修正常見錯誤
2. **添加上下文提示詞**
- 提供影視後製專業詞彙列表
- 提升特定領域準確度
3. **考慮其他方案**
- 阿里雲繁體中文 API如果不能使用雲端則跳過
- 其他專門優化台灣腔調的模型
## 聯絡與反饋
如有問題或建議,請提供更多測試樣本,我們會持續優化。