diff --git a/modules/processors/frame/core.py b/modules/processors/frame/core.py index 195a3ea..628a2a6 100644 --- a/modules/processors/frame/core.py +++ b/modules/processors/frame/core.py @@ -11,6 +11,7 @@ from tqdm import tqdm import modules import modules.globals +from modules.face_analyser import get_one_face FRAME_PROCESSORS_MODULES: List[ModuleType] = [] FRAME_PROCESSORS_INTERFACE = [ @@ -321,8 +322,6 @@ def _run_pipe_pipeline( bar_fmt = ('{l_bar}{bar}| {n_fmt}/{total_fmt} ' '[{elapsed}<{remaining}, {rate_fmt}{postfix}]') - from modules.face_analyser import get_one_face - try: with tqdm(total=total_frames, desc='Processing', unit='frame', dynamic_ncols=True, bar_format=bar_fmt) as progress: diff --git a/modules/processors/frame/face_swapper.py b/modules/processors/frame/face_swapper.py index f51a2a6..e1f141a 100644 --- a/modules/processors/frame/face_swapper.py +++ b/modules/processors/frame/face_swapper.py @@ -1,6 +1,7 @@ from typing import Any, List, Optional import cv2 import insightface +from insightface.utils import face_align import threading import numpy as np import platform @@ -241,7 +242,6 @@ def swap_face(source_face: Face, target_face: Face, temp_frame: Frame) -> Frame: return original_frame # Get the aligned input crop for the mask (same as insightface does internally) - from insightface.utils import face_align aimg, _ = face_align.norm_crop2(temp_frame, target_face.kps, face_swapper.input_size[0]) swapped_frame = _fast_paste_back(temp_frame, bgr_fake, aimg, M)