Update run.py

This commit is contained in:
Symbiomatrix 2023-05-30 19:29:33 +03:00 committed by GitHub
parent afefc37856
commit a3617b1cff
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

7
run.py
View File

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