Changed the method of specifying the path to the executable file.

Maybe it will work on linux, mac, or colab, but I don't have the environment, so I haven't checked yet. The issue of how to run ebsynth itself in those environments is also not known
pull/48/head
s9roll7 2023-03-11 11:46:37 +09:00
parent 3429e7e320
commit 644fb2a5ab
2 changed files with 9 additions and 3 deletions

View File

@ -147,7 +147,13 @@ def create_mask_clipseg(input_dir, output_dir, clipseg_mask_prompt, clipseg_excl
def create_mask_transparent_background(input_dir, output_dir, tb_use_fast_mode, tb_use_jit, st1_mask_threshold):
fast_str = " --fast" if tb_use_fast_mode else ""
jit_str = " --jit" if tb_use_jit else ""
subprocess.call("venv\\Scripts\\transparent-background --source " + input_dir + " --dest " + output_dir + " --type map" + fast_str + jit_str, shell=True)
bin_path = os.path.join("venv", "Scripts")
bin_path = os.path.join(bin_path, "transparent-background")
if os.path.isfile(bin_path) or os.path.isfile(bin_path + ".exe"):
subprocess.call(bin_path + " --source " + input_dir + " --dest " + output_dir + " --type map" + fast_str + jit_str, shell=True)
else:
subprocess.call("transparent-background --source " + input_dir + " --dest " + output_dir + " --type map" + fast_str + jit_str, shell=True)
mask_imgs = glob.glob( os.path.join(output_dir, "*.png") )
@ -194,7 +200,7 @@ def ebsynth_utility_stage1(dbg, project_args, frame_width, frame_height, st1_mas
png_path = os.path.join(frame_path , "%05d.png")
# ffmpeg.exe -ss 00:00:00 -y -i %1 -qscale 0 -f image2 -c:v png "%05d.png"
subprocess.call("ffmpeg.exe -ss 00:00:00 -y -i " + original_movie_path + " -qscale 0 -f image2 -c:v png " + png_path, shell=True)
subprocess.call("ffmpeg -ss 00:00:00 -y -i " + original_movie_path + " -qscale 0 -f image2 -c:v png " + png_path, shell=True)
dbg.print("frame extracted")

View File

@ -64,7 +64,7 @@ def merge_bg_src(base_frame_dir, bg_dir, frame_mask_path, tmp_dir, bg_type, mask
def extract_frames(movie_path , output_dir, fps):
png_path = os.path.join(output_dir , "%05d.png")
# ffmpeg.exe -ss 00:00:00 -y -i %1 -qscale 0 -f image2 -c:v png "%05d.png"
subprocess.call("ffmpeg.exe -ss 00:00:00 -y -i " + movie_path + " -vf fps=" + str( round(fps, 2)) + " -qscale 0 -f image2 -c:v png " + png_path, shell=True)
subprocess.call("ffmpeg -ss 00:00:00 -y -i " + movie_path + " -vf fps=" + str( round(fps, 2)) + " -qscale 0 -f image2 -c:v png " + png_path, shell=True)
def ebsynth_utility_stage8(dbg, project_args, bg_src, bg_type, mask_blur_size, mask_threshold, fg_transparency, export_type):
dbg.print("stage8")