mirror of
https://github.com/s0md3v/roop.git
synced 2025-10-05 00:12:51 +08:00
- refactored swapper.py to optimized code logic
- refactored "get_face" and "get_all_faces" to "get_face_single" and "get_face_many" respectively - moved all global booleans to top of file
This commit is contained in:
4
run.py
4
run.py
@@ -22,7 +22,7 @@ from PIL import Image, ImageTk
|
||||
import core.globals
|
||||
from core.swapper import process_video, process_img
|
||||
from core.utils import is_img, detect_fps, set_fps, create_video, add_audio, extract_frames, rreplace
|
||||
from core.analyser import get_face
|
||||
from core.analyser import get_face_single
|
||||
|
||||
if 'ROCMExecutionProvider' in core.globals.providers:
|
||||
del torch
|
||||
@@ -188,7 +188,7 @@ def start():
|
||||
global pool
|
||||
pool = mp.Pool(args['cores_count'])
|
||||
target_path = args['target_path']
|
||||
test_face = get_face(cv2.imread(args['source_img']))
|
||||
test_face = get_face_single(cv2.imread(args['source_img']))
|
||||
if not test_face:
|
||||
print("\n[WARNING] No face detected in source image. Please try with another one.\n")
|
||||
return
|
||||
|
Reference in New Issue
Block a user