fix: ONNX face detection model scores/boxes dimension mismatch #592

Merged
chris merged 1 commit from fix/face-pipeline-box-dim-mismatch into main 2026-07-11 20:29:04 +02:00
Owner

Summary

Fix dimension mismatch between ONNX model outputs: scores has 4410 entries but boxes has only 3200 entries.

Root Cause

The loop iterated over range(scores.shape[0]) = 4410, but boxes only has 3200 entries. This caused index out-of-bounds at i=3200. This was masked by an earlier numpy .item() bug (fixed in PR #588) that prevented the detection loop from reaching the out-of-bounds index.

Changes

  • Changed loop bound to min(scores.shape[0], boxes.shape[0]) for safety when output dimensions diverge
  • Added debug logging of model output shapes (scores, boxes, landmarks) for future debugging
  • Added landmarks variable extraction (3rd model output) for completeness
## Summary Fix dimension mismatch between ONNX model outputs: scores has 4410 entries but boxes has only 3200 entries. ## Root Cause The loop iterated over `range(scores.shape[0])` = 4410, but `boxes` only has 3200 entries. This caused index out-of-bounds at i=3200. This was masked by an earlier numpy `.item()` bug (fixed in PR #588) that prevented the detection loop from reaching the out-of-bounds index. ## Changes - Changed loop bound to `min(scores.shape[0], boxes.shape[0])` for safety when output dimensions diverge - Added debug logging of model output shapes (scores, boxes, landmarks) for future debugging - Added landmarks variable extraction (3rd model output) for completeness
fix: ONNX model output dimension mismatch, scores vs boxes size differ
All checks were successful
Build and Deploy / Detect changed services and test scopes (push) Successful in 11s
Build and Deploy / Run scoped PR tests (push) Has been skipped
Build and Deploy / Smoke API and media worker (push) Has been skipped
Build and Deploy / Smoke web (push) Has been skipped
Build and Deploy / Smoke ML worker (push) Has been skipped
Build and Deploy / Build plants worker image (push) Has been skipped
Build and Deploy / Build people worker image (push) Has been skipped
Build and Deploy / Build converter worker image (push) Has been skipped
Build and Deploy / Build API image (push) Has been skipped
Build and Deploy / Build media worker image (push) Has been skipped
Build and Deploy / Build web image (push) Has been skipped
Build and Deploy / Build ML worker image (push) Has been skipped
Build and Deploy / Deploy API (push) Has been skipped
Build and Deploy / Deploy web (push) Has been skipped
Build and Deploy / Deploy media worker (push) Has been skipped
Build and Deploy / Deploy ML worker (push) Has been skipped
Build and Deploy / Deploy plants worker (push) Has been skipped
Build and Deploy / Deploy people worker (push) Has been skipped
Build and Deploy / Deploy converter worker (push) Has been skipped
Build and Deploy / Clean Docker build artifacts (push) Has been skipped
4745767d0b
chris merged commit 5939eecd6a into main 2026-07-11 20:29:04 +02:00
Sign in to join this conversation.
No reviewers
No labels
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set

Reference
chris/memories!592
No description provided.