Remove redundant cv2.resize in SwapFaceNode source-face branches #6

Closed
opened 2026-08-07 01:45:30 +00:00 by Mark · 0 comments
Owner

After the face-swap fix in a32bbef, auraframe/pipeline/nodes/swap_face.py lines 78 and 87 still do cv2.resize(source_face, (512, 512)) before calling model.infer().

Problem: The 512×512 resize of a non-square face crop stretches it (aspect ratio mismatch). FaceSwapper.infer() then re-detects via SCRFD and re-aligns via warp_and_crop_face — the resize is wasted work and the stretching can hurt landmark detection.

Fix: Pass the raw source face image directly to model.infer(). Drop the cv2.resize(...) calls. The detector handles any input size.

Files to modify:

  • auraframe/pipeline/nodes/swap_face.py lines 78 and 87

Test: Re-run tests/test_infer_swaps.py with INTEGRATION_MODELS=1. The fix should produce the same identity transfer (L1, shift metrics within tolerance).

After the face-swap fix in a32bbef, `auraframe/pipeline/nodes/swap_face.py` lines 78 and 87 still do `cv2.resize(source_face, (512, 512))` before calling `model.infer()`. **Problem:** The 512×512 resize of a non-square face crop stretches it (aspect ratio mismatch). `FaceSwapper.infer()` then re-detects via SCRFD and re-aligns via `warp_and_crop_face` — the resize is wasted work and the stretching can hurt landmark detection. **Fix:** Pass the raw source face image directly to `model.infer()`. Drop the `cv2.resize(...)` calls. The detector handles any input size. **Files to modify:** - `auraframe/pipeline/nodes/swap_face.py` lines 78 and 87 **Test:** Re-run `tests/test_infer_swaps.py` with INTEGRATION_MODELS=1. The fix should produce the same identity transfer (L1, shift metrics within tolerance).
Mark 2026-08-07 01:45:30 +00:00
Sign in to join this conversation.
No description provided.