mirror of
https://github.com/hacksider/Deep-Live-Cam.git
synced 2026-07-11 04:43:43 +02:00
feat: AMD DML optimization - GPU face detection, detection throttle, pre-load fix
This commit is contained in:
@@ -110,7 +110,6 @@ def get_face_swapper() -> Any:
|
||||
))
|
||||
else:
|
||||
providers_config.append(p)
|
||||
|
||||
FACE_SWAPPER = insightface.model_zoo.get_model(
|
||||
model_path,
|
||||
providers=providers_config,
|
||||
@@ -153,9 +152,10 @@ def swap_face(source_face: Face, target_face: Face, temp_frame: Frame) -> Frame:
|
||||
if not temp_frame.flags['C_CONTIGUOUS']:
|
||||
temp_frame = np.ascontiguousarray(temp_frame)
|
||||
|
||||
swapped_frame_raw = face_swapper.get(
|
||||
temp_frame, target_face, source_face, paste_back=True
|
||||
)
|
||||
with modules.globals.dml_lock:
|
||||
swapped_frame_raw = face_swapper.get(
|
||||
temp_frame, target_face, source_face, paste_back=True
|
||||
)
|
||||
|
||||
# --- START: CRITICAL FIX FOR ORT 1.17 ---
|
||||
# Check the output type and range from the model
|
||||
@@ -1183,4 +1183,4 @@ def apply_color_transfer(source, target):
|
||||
# traceback.print_exc()
|
||||
return source
|
||||
|
||||
return result_bgr
|
||||
return result_bgr
|
||||
|
||||
Reference in New Issue
Block a user