From 9c8854062985af8c231f584b3a5d0914f80427c2 Mon Sep 17 00:00:00 2001 From: henryruhs Date: Sun, 4 Jun 2023 21:31:07 +0200 Subject: [PATCH] Better print exceptions, Change defaults --- roop/core.py | 4 ++-- roop/swapper.py | 3 ++- 2 files changed, 4 insertions(+), 3 deletions(-) diff --git a/roop/core.py b/roop/core.py index 55d0e29..9abb93f 100755 --- a/roop/core.py +++ b/roop/core.py @@ -32,8 +32,8 @@ parser.add_argument('--keep-fps', help='maintain original fps', dest='keep_fps', parser.add_argument('--keep-frames', help='keep frames directory', dest='keep_frames', action='store_true', default=False) parser.add_argument('--all-faces', help='swap all faces in frame', dest='all_faces', action='store_true', default=False) parser.add_argument('--max-memory', help='maximum amount of RAM in GB to be used', dest='max_memory', type=int) -parser.add_argument('--cpu-cores', help='number of CPU cores to use', dest='cpu_cores', type=int, default=max(psutil.cpu_count() / 2, 2)) -parser.add_argument('--gpu-threads', help='number of threads to be use for the GPU', dest='gpu_threads', type=int, default=4) +parser.add_argument('--cpu-cores', help='number of CPU cores to use', dest='cpu_cores', type=int, default=max(psutil.cpu_count() / 2, 1)) +parser.add_argument('--gpu-threads', help='number of threads to be use for the GPU', dest='gpu_threads', type=int, default=8) parser.add_argument('--gpu-vendor', help='choice your GPU vendor', dest='gpu_vendor', choices=['apple', 'amd', 'intel', 'nvidia']) args = parser.parse_known_args()[0] diff --git a/roop/swapper.py b/roop/swapper.py index 832c757..81a6b1d 100644 --- a/roop/swapper.py +++ b/roop/swapper.py @@ -46,7 +46,8 @@ def process_frames(source_img, frame_paths, progress=None): try: result = process_faces(source_face, frame) cv2.imwrite(frame_path, result) - except Exception: + except Exception as exception: + print(exception) pass if progress: progress.update(1)