Skip to content

Fix/remove redundant face detection - #22

Merged
wailbentafat merged 2 commits into
mainfrom
fix/remove-redundant-face-detection
Mar 19, 2026
Merged

Fix/remove redundant face detection#22
wailbentafat merged 2 commits into
mainfrom
fix/remove-redundant-face-detection

Conversation

@maya-ots

Copy link
Copy Markdown
Collaborator

Summary

compute_average_embedding() was calling model.get() twice on the same image, once to extract bboxes, then again inside embed() via a thread. Since model.get() already returns face.embedding in the first call, the second detection pass was redundant and doubled the compute unnecessarily.

Changes

  • Removed bbox extraction loop and embed() call from compute_average_embedding()
  • Moved model.get() into asyncio.to_thread() where the CPU-heavy work belongs
  • Used faces[0].embedding directly from the single detection pass

@wailbentafat
wailbentafat merged commit 9fde07c into main Mar 19, 2026
1 check passed
@maya-ots
maya-ots deleted the fix/remove-redundant-face-detection branch June 27, 2026 00:16
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants