Merge pull request #127 from Symbiomatrix/files2

Fix for filename selection.
This commit is contained in:
Somdev Sangwan 2023-05-30 22:05:06 +05:30 committed by GitHub
commit de7d384bca
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

5
run.py
View File

@ -161,8 +161,9 @@ def start():
process_img(args['source_img'], target_path, args['output_file'])
status("swap successful!")
return
video_name = target_path.split("/")[-1].split(".")[0]
output_dir = target_path.replace(target_path.split("/")[-1], "").rstrip("/") + "/" + video_name
video_name = os.path.basename(target_path)
video_name = os.path.splitext(video_name)[0]
output_dir = os.path.join(os.path.dirname(target_path),video_name)
Path(output_dir).mkdir(exist_ok=True)
status("detecting video's FPS...")
fps = detect_fps(target_path)