From d688bc4e63e765e2744b37fc4e0364d13bc98d5e Mon Sep 17 00:00:00 2001 From: allenhooo Date: Tue, 30 May 2023 20:18:06 +0800 Subject: [PATCH] When the path of the python virtual environment is not venv, transparent_background will not be found here. This modification finds the virtual environment path as the base path from the environment variable VIRTUAL_ENV --- stage1.py | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/stage1.py b/stage1.py index 6a763d8..d8082ed 100644 --- a/stage1.py +++ b/stage1.py @@ -147,7 +147,8 @@ 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 "" - bin_path = os.path.join("venv", "Scripts") + venv = os.environ['VIRTUAL_ENV'] + 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"):