Files
momentry_core/v1.1/scripts/ASR_USAGE_v1.11.md
T
Accusys 2cfcfdd1af feat: Phase 2.6 edges migration to Qdrant (TKG-only architecture)
Phase 2.6.1: co_occurrence_edges migration
- build_co_occurrence_edges_from_qdrant()
- Qdrant embeddings → frame grouping → YOLO objects
- Result: 6679 edges (vs 6701 PostgreSQL)

Phase 2.6.2: face_face_edges migration
- build_face_face_edges_from_qdrant()
- Qdrant embeddings → frame grouping → face pairs
- mutual_gaze detection preserved
- Result: 6 edges (exact match)

Phase 2.6.3: speaker_face_edges migration
- build_speaker_face_edges_from_qdrant()
- Qdrant embeddings → trace_id frame ranges
- SPEAKS_AS edge creation

Architecture:
- All edges use Qdrant payload (no face_detections queries)
- PostgreSQL fallback for empty Qdrant
- Estimated 3.6x performance improvement

Testing:
- Playground (3003): ✓ All Phase 2.6 logs verified
- Edge counts: ✓ Close match with PostgreSQL
- Fallback: ✓ Working

Docs:
- docs_v1.0/DESIGN/TKG_PHASE2_6_EDGES_MIGRATION.md
- docs_v1.0/M4_workspace/2026-06-21_phase2_6_test.md
2026-06-21 04:47:49 +08:00

3.5 KiB
Raw Blame History

ASR 處理器使用指南

正式採用版本

✅ 正式處理器:asr_processor_small.py

適用場景:

  • 正式生產環境
  • 台灣腔調內容
  • 多語言內容(英語、法語等)
  • 專業詞彙識別(剪輯師、調光師等)
  • 長影片處理

使用方式:

python3 scripts/asr_processor_small.py video.mp4 output.json

特點:

  • ✅ 台灣腔調準確度 90%
  • ✅ 多語言自動識別(90+ 語言)
  • ✅ 專業詞彙識別最佳
  • ✅ 長影片處理穩定(7.3x 實時)
  • ⚠️ 處理時間 ~50 秒(短影片) / ~15 分鐘(114 分鐘長片)

⚡ 快速預覽:asr_processor.py(tiny 模型)

適用場景:

  • 快速測試流程
  • 不關心準確度
  • 僅需了解大致內容

使用方式:

python3 scripts/asr_processor.py video.mp4 output.json

特點:

  • ✅ 處理時間 ~12 秒
  • ⚠️ 準確度 70%
  • ⚠️ 不適合正式處理

測試結果總結

短影片測試(ExaSAN,2.6 分鐘)

模型 時間 片段 剪輯師識別 建議
tiny 12.68s 78 ❌ 簡吉斯 快速預覽
base 24.01s 61 ❌ 簡吉斯 不推薦
small 49.74s 83 ✅ 剪輯師 正式採用 ⭐

長影片測試(Charade 1963,114 分鐘)

模型 時間 片段 英語 法語 建議
small 15.6 分鐘 2,025 99% 95% 正式採用 ⭐

檔案清單

scripts/
├── asr_processor.py                   # tiny 模型(快速預覽)
├── asr_processor_base.py              # base 模型(備用)
├── asr_processor_small.py             # small 模型(正式處理)⭐
├── asr_processor_small_multilingual.py # small 多語言版(備用)
├── compare_asr_models.py              # 比對工具
├── ASR_PROCESSOR_README.md            # 詳細說明
└── ASR_USAGE.md                       # 本文件

使用範例

正式生產

# 影片上傳後正式處理
python3 scripts/asr_processor_small.py \
  "/Users/accusys/momentry/var/sftpgo/data/demo/video.mp4" \
  "/path/to/output.json"

快速測試

# 快速測試流程
python3 scripts/asr_processor.py \
  "/Users/accusys/momentry/var/sftpgo/data/demo/video.mp4" \
  "/tmp/test.json"

比對分析

# 對比三個模型效果
python3 scripts/compare_asr_models.py \
  /tmp/asr_tiny.json \
  /tmp/asr_base.json \
  /tmp/asr_small.json > /tmp/comparison.md

關鍵發現

台灣腔調識別

small 模型是唯一正確識別的模型:

  • ✅ 剪輯師(正確)
  • ❌ 簡吉斯(tiny/base 錯誤)

多語言識別

small 模型自動支援 90+ 語言:

  • ✅ 英語:99%
  • ✅ 法語:95%
  • ✅ 自動切換:無縫

長影片處理

效能優異:

  • ✅ 114 分鐘影片:15.6 分鐘處理
  • ✅ 7.3x 實時速度
  • ✅ 記憶體使用穩定
  • ✅ 2,025 個片段

決策

正式採用:asr_processor_small.py ⭐

理由:

  1. ✅ 台灣腔調識別最佳
  2. ✅ 多語言自動支援
  3. ✅ 長影片處理穩定
  4. ✅ 專業詞彙準確度高
  5. ✅ 性價比合理(50 秒/短影片,15 分鐘/長片)

聯絡與反饋

如有問題或需要進一步優化,請參考:

  • 詳細說明:ASR_PROCESSOR_README.md
  • 測試報告:/tmp/asr_comparison.md
  • 長影片報告:/tmp/asr_small_long.json