issue: 020.mp4 face bbox invalid (width=0, height=0)

問題:
- 020.mp4 FS VLM Summary 0/8
- Library 卡片 FS 數量只有 1
- 沒有 trace profiles

根本原因:
- Face detection 輸出 212 個 faces
- 所有 bbox 的 width 和 height 都是 0
- Face tracing 無法處理無效 bbox
- 所有 faces trace_id = -1
- 無法生成 trace profiles 和 FS VLM summary

診斷:
- face.json 有 212 個 faces
- bbox 格式: (x, y, 0, 0) - 無尺寸
- Qdrant 有 210 個無效 faces (trace_id = -1)
- 沒有任何 trace_* 目錄

影響:
- 無 trace profiles
- 無 key_frame.jpg, key_face.jpg
- 無 FS VLM summary

可能原因:
1. Face detection processor bug
2. 視頻中的 faces 太小
3. 配置參數問題

建議:
1. 添加 bbox 驗證
2. 過濾無效 bbox
3. 添加質量過濾
4. 改進錯誤處理

文檔:
- docs_v1.0/M4_workspace/2026-09-28_020_mp4_face_bbox_issue.md

狀態: ⚠️ 問題已識別,待修復
This commit is contained in:
Accusys
2026-09-29 00:46:31 +08:00
parent 798c0d747b
commit 6b1345bd5a
@@ -0,0 +1,251 @@
---
title: 020.mp4 Face BBox 問題報告
version: 1.0
date: 2026-09-28
author: OpenCode
status: issue_identified
---
## 問題描述
**文件**: 020.mp4
**UUID**: b496a68800f90770aa7246c877f38985
**狀態**: 完了(但實際上有問題)
**用戶報告**: "FS VLM Summary 0/8","Library 卡片 FS 數量只有 1"
---
## 問題診斷
### 1. Face Detection 輸出
**文件**: `b496a688...face.json` (3.4MB)
**內容**:
```
Total frames: 162
Total faces: 212
```
**BBox 檢查**:
```
✅ Valid bbox: 0
❌ Invalid bbox: 212
```
**示例**:
```
Frame 0: bbox=(1377, 219, 0, 0) # width=0, height=0
Frame 3: bbox=(1378, 220, 0, 0) # width=0, height=0
```
---
### 2. Qdrant 數據
**Total faces**: 210
**Trace ID 分布**:
```
trace_id = -1: 210 faces (100%)
```
**質量檢查**:
```
bbox: 0x0 (無效)
confidence: 0.602 (低質量)
```
---
### 3. Trace 目錄
**狀態**:
```
❌ 沒有任何 trace_* 目錄
❌ 沒有 key_frame.jpg
❌ 沒有 key_face.jpg
❌ 沒有 trace_profile.json
```
---
### 4. FS VLM Summary
**狀態**:
```
vlm_summary = 0/8
```
**原因**: 沒有有效的 traces,無法生成 FS VLM summary
---
## 根本原因
### Face BBox 無效
**問題**:
- Face detection 輸出了 212 個 faces
- 所有 bbox 的 **width 和 height 都是 0**
- 只有 x, y 坐標,沒有尺寸
**影響**:
1. Face tracing 無法處理無效 bbox
2. 所有 faces 被標記為 trace_id = -1
3. 沒有生成任何 trace profiles
4. 無法生成 FS VLM summary
---
### 可能的原因
1. **Face detection processor bug**
- 輸出格式錯誤
- bbox 計算錯誤
2. **視頻中的 faces 太小**
- Face detection 檢測到位置
- 但無法確定尺寸
3. **Face detection 配置問題**
- 使用了錯誤的參數
- 質量閾值設置不當
---
## Worker 日誌
```
✅ Processor face completed (162 chunks, 527 frames)
⚠️ [TRACE_STORE stderr] face.json not found
📝 Face dedup waiting: 15 missing files in trace sample
⚠️ TKG build proceeding with 210 faces, 0 traces
[TKG] No traced faces in Qdrant
✅ TKG build completed: 0 nodes, 0 edges
[Ingestion] vlm_summary=0/8
```
---
## 修復方案
### 方案 A: 重新運行 Face Detection
**步驟**:
1. 刪除無效的 face.json
2. 刪除 Qdrant 中的無效 faces
3. 使用修正後的參數重新運行 face detection
4. 重新運行 face tracing
5. 生成 trace profiles
6. 生成 FS VLM summary
---
### 方案 B: 跳過 Face Processing
**步驟**:
1. 刪除 Qdrant 中的無效 faces
2. 標記文件為 "無 face 數據"
3. 跳過 face 相關的處理
---
### 方案 C: 修復 Face Detection Processor
**步驟**:
1. 檢查 face detection processor 代碼
2. 修復 bbox 計算邏輯
3. 添加 bbox 驗證
4. 重新運行所有受影響的文件
---
## 緊急修復
### 立即行動
1. **清理無效數據**
```python
# 刪除 Qdrant 中的無效 faces
DELETE 210 points from _faces collection
# 刪除無效的 face.json
rm b496a688...face.json
```
2. **重新處理**
- 重新運行 face detection
- 使用更高的質量閾值
- 驗證 bbox 有效性
---
## 預防措施
### 1. 添加 BBox 驗證
**位置**: Face detection processor
**檢查**:
```python
if bbox['w'] > 0 and bbox['h'] > 0:
# Valid bbox, save to output
else:
# Invalid bbox, skip or warn
```
---
### 2. 添加質量過濾
**建議**:
```python
# 過濾低質量檢測
if confidence < 0.7:
warn("Low confidence face, skipping")
continue
# 過濾無效 bbox
if width == 0 or height == 0:
warn("Invalid bbox, skipping")
continue
```
---
### 3. 改進 Face Tracing
**建議**:
- 檢查 face.json 中的 bbox 有效性
- 如果所有 bbox 都無效,報告錯誤
- 不要保存無效數據到 Qdrant
---
## 總結
### ✅ 已識別
1. **根本原因**: Face detection 輸出無效 bbox (width=0, height=0)
2. **影響範圍**: 212 個 faces 無法被追蹤
3. **後果**: 無 trace profiles, 無 FS VLM summary
### ⏳ 待處理
1. 清理無效數據
2. 修復 face detection processor
3. 重新處理文件
### 🔄 需要檢查
- 其他文件是否有相同問題
- Face detection processor 的 bug
- 配置參數是否正確
---
**日期**: 2026-09-28
**狀態**: ⚠️ **問題已識別,待修復**