mirror of
https://github.com/s0md3v/roop.git
synced 2025-10-17 22:00:48 +08:00
Add GPU support, Quit on missing model, Remove globals (sorry)
This commit is contained in:

committed by
Somdev Sangwan

parent
d05b9ea6e6
commit
8701123ee3
@@ -1,11 +1,15 @@
|
||||
import os
|
||||
import cv2
|
||||
import insightface
|
||||
import onnxruntime
|
||||
import core.globals
|
||||
from core.config import get_face
|
||||
from core.utils import rreplace
|
||||
|
||||
face_swapper = insightface.model_zoo.get_model('inswapper_128.onnx', providers=core.globals.providers)
|
||||
if os.path.isfile('inswapper_128.onnx'):
|
||||
face_swapper = insightface.model_zoo.get_model('inswapper_128.onnx', providers=onnxruntime.get_available_providers())
|
||||
else:
|
||||
quit('File "inswapper_128.onnx" does not exist!')
|
||||
|
||||
|
||||
|
||||
def process_video(source_img, frame_paths):
|
||||
@@ -25,6 +29,7 @@ def process_video(source_img, frame_paths):
|
||||
pass
|
||||
print(flush=True)
|
||||
|
||||
|
||||
def process_img(source_img, target_path):
|
||||
frame = cv2.imread(target_path)
|
||||
face = get_face(frame)
|
||||
|
Reference in New Issue
Block a user