From 9153b4ce8ff12860e4a376c5dee9265c009b6d08 Mon Sep 17 00:00:00 2001 From: harisreedhar Date: Sat, 22 Mar 2025 14:14:37 +0530 Subject: [PATCH] add 'ffhq_to_arcface_128_v2' template --- face_swapper/src/helper.py | 5 +++++ face_swapper/src/types.py | 2 +- 2 files changed, 6 insertions(+), 1 deletion(-) diff --git a/face_swapper/src/helper.py b/face_swapper/src/helper.py index b1377d5..0839a40 100644 --- a/face_swapper/src/helper.py +++ b/face_swapper/src/helper.py @@ -10,6 +10,11 @@ WARP_TEMPLATE_SET : WarpTemplateSet =\ [ 1.01305414, -0.00140513, -0.00585911 ], [ 0.00140513, 1.01305414, 0.11169602 ] ]), + 'ffhq_to_arcface_128_v2': torch.tensor( + [ + [ 8.50048894e-01, -1.29486822e-04, 1.90956388e-03 ], + [ 1.29486822e-04, 8.50048894e-01, 9.56254653e-02 ] + ]), 'arcface_128_v2_to_arcface_112_v2': torch.tensor( [ [ 8.75000016e-01, -1.07193451e-08, 3.80446920e-10 ], diff --git a/face_swapper/src/types.py b/face_swapper/src/types.py index 915741d..417f6b7 100644 --- a/face_swapper/src/types.py +++ b/face_swapper/src/types.py @@ -21,5 +21,5 @@ FaceParserModule : TypeAlias = Module OptimizerSet : TypeAlias = Any -WarpTemplate = Literal['vgg_face_hq_to_arcface_128_v2', 'arcface_128_v2_to_arcface_112_v2'] +WarpTemplate = Literal['vgg_face_hq_to_arcface_128_v2', 'ffhq_to_arcface_128_v2', 'arcface_128_v2_to_arcface_112_v2'] WarpTemplateSet : TypeAlias = Dict[WarpTemplate, Tensor]