warn user about unselected objects (fixes #3)

This commit is contained in:
Somdev Sangwan 2023-05-29 13:01:05 +05:30 committed by GitHub
parent b4420e8caf
commit 82bd70879a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

6
run.py
View File

@ -53,6 +53,12 @@ def toggle_fps_limit():
def start(): def start():
if not args['source_img'] or not os.path.isfile(args['source_img']):
print("\n[WARNING] Please select an image containing a face.")
return
elif not args['target_path'] or not os.path.isfile(args['target_path']):
print("\n[WARNING] Please select a video/image to swap face in.")
return
global pool global pool
pool = mp.Pool(psutil.cpu_count()-1) pool = mp.Pool(psutil.cpu_count()-1)
current_dir = os.getcwd() current_dir = os.getcwd()