feat: AMD DML optimization - GPU face detection, detection throttle, pre-load fix

This commit is contained in:
ozp3
2026-03-28 13:09:20 +03:00
parent 9e6f30c0a4
commit eac2ad2307
7 changed files with 52 additions and 17 deletions
+5 -5
View File
@@ -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