Update processor.py

This commit is contained in:
Somdev Sangwan 2023-05-31 18:24:11 +05:30 committed by GitHub
parent c0f486ed83
commit ab2fc1c221
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -2,6 +2,7 @@ import os
import cv2
import insightface
import core.globals
from core.config import get_face
FACE_SWAPPER = None
@ -11,7 +12,7 @@ def get_face_swapper():
global FACE_SWAPPER
if FACE_SWAPPER is None:
model_path = os.path.join(os.path.abspath(os.path.dirname(__file__)), '../inswapper_128.onnx')
FACE_SWAPPER = insightface.model_zoo.get_model(model_path)
FACE_SWAPPER = insightface.model_zoo.get_model(model_path, providers=core.globals.providers)
return FACE_SWAPPER