batch_swap: detect+align source once, swap N times #9
Labels
No labels
blocked:needs-attention
blocked:needs-decision
blocked:needs-decompose
blocked:needs-design
blocked:needs-triage
blocked:preflight
blocked:unclassified
bug
documentation
enhancement
gsd-spec
in-progress
lint-cleanup
needs-decompose
priority:high
priority:low
priority:medium
quickfix
test
triage-approved
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference
Mark/kimi_agent_local_ai_image_enhancer#9
Loading…
Add table
Add a link
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
After the face-swap fix in
a32bbef, every call toFaceSwapper.infer()does SCRFD detection + ArcFace embedding extraction + INSwapper inference. For multi-face targets (the common case), this re-detects/re-embeds the same source face N times.Fix: Refactor
infer()to accept either a raw source face image (current behavior) or a pre-computed embedding (skip detect+align+embed). Then updatebatch_swap()to detect+align+embed ONCE on the source image, then callbatch_swap_with_embedding()for each target face box. Expected ~Nx speedup on N-face targets.Files:
auraframe/models/face_swapper.py—infer(),batch_swap()Test: Benchmark timing before/after on a multi-face target. Identity transfer metrics unchanged.
Caveat: Performance optimization. Current behavior is correct (just slow). Don't bundle with other fixes.