Fix GUI startup

This commit is contained in:
henryruhs 2023-06-14 10:38:29 +02:00
parent 71b6b1d030
commit aecd51b635
2 changed files with 8 additions and 7 deletions

View File

@ -34,9 +34,9 @@ warnings.simplefilter(action='ignore', category=FutureWarning)
def parse_args() -> None:
signal.signal(signal.SIGINT, lambda signal_number, frame: destroy())
parser = argparse.ArgumentParser()
parser.add_argument('-f', '--face', help='use a face image', dest='source_path', required=True)
parser.add_argument('-t', '--target', help='replace image or video with face', dest='target_path', required=True)
parser.add_argument('-o', '--output', help='save output to this file', dest='output_path', required=True)
parser.add_argument('-f', '--face', help='use a face image', dest='source_path')
parser.add_argument('-t', '--target', help='replace image or video with face', dest='target_path')
parser.add_argument('-o', '--output', help='save output to this file', dest='output_path')
parser.add_argument('--frame-processor', help='list of frame processors to run', dest='frame_processor', default=['face_swapper'], choices=['face_swapper', 'face_enhancer'], nargs='+')
parser.add_argument('--keep-fps', help='maintain original fps', dest='keep_fps', action='store_true', default=False)
parser.add_argument('--keep-audio', help='maintain original audio', dest='keep_audio', action='store_true', default=True)

View File

@ -75,10 +75,11 @@ def get_temp_output_path(target_path: str) -> str:
def normalize_output_path(source_path: str, target_path: str, output_path: str) -> str:
source_name, _ = os.path.splitext(os.path.basename(source_path))
target_name, target_extension = os.path.splitext(os.path.basename(target_path))
if os.path.isdir(output_path):
return os.path.join(output_path, source_name + '-' + target_name + target_extension)
if source_path and target_path:
source_name, _ = os.path.splitext(os.path.basename(source_path))
target_name, target_extension = os.path.splitext(os.path.basename(target_path))
if os.path.isdir(output_path):
return os.path.join(output_path, source_name + '-' + target_name + target_extension)
return output_path