diff --git a/core/imageupscaler.py b/core/imageupscaler.py index 28359b0..f9ec2e8 100644 --- a/core/imageupscaler.py +++ b/core/imageupscaler.py @@ -199,7 +199,6 @@ async def image_upscale_thread(self, res_frame, target_path, file_name, async_ta async_task.append(task) async def face_enhance_thread(self, res_frame, img_copy, target_path, file_name, async_task): - print("in") up_img = self.postprocess(res_frame, pad=False) from plugin.face_enhance import FaceEnhance face_enhancer = FaceEnhance(self.re_upscale_model, self.face_detect_model, self.face_pars_model, diff --git a/core/pipeline.py b/core/pipeline.py index e225ddb..bf83bd9 100644 --- a/core/pipeline.py +++ b/core/pipeline.py @@ -15,6 +15,7 @@ bger = Bgremover() bger2 = Bgremover2() +FFMPEG_CMD = "ffmpeg" @timer def image_pipeline(input, model, face_enhance=None, background_remove=None, bg_color="White", user_bg_color=None, bg_img=None, bg_img_up=None, output_path=None, save=False): @@ -112,7 +113,7 @@ def video_pipeline(input, model, face_enhance=None, background_remove=None, thre if input.endswith('.flv'): mp4_path = input.replace('.flv', '.mp4') - os.system(f'ffmpeg_ubuntu -i {input} -codec copy {mp4_path}') + os.system(f'{FFMPEG_CMD} -i {input} -codec copy {mp4_path}') input = mp4_path if not os.path.exists('./temp_frames'): @@ -124,7 +125,7 @@ def video_pipeline(input, model, face_enhance=None, background_remove=None, thre fps = cap.get(cv2.CAP_PROP_FPS) cap.release() print("**************") - os.system(f'ffmpeg_ubuntu -i {input} -qscale:v 1 -qmin 1 -qmax 1 -vsync 0 ./temp_frames/frame%d.png') + os.system(f'{FFMPEG_CMD} -i {input} -qscale:v 1 -qmin 1 -qmax 1 -vsync 0 ./temp_frames/frame%d.png') print("**************") if background_remove == 0: @@ -172,7 +173,7 @@ def video_pipeline(input, model, face_enhance=None, background_remove=None, thre os.makedirs(os.path.join('./result', 'video'), exist_ok=True) output_path = './result/video/out_{}.mp4'.format(uuid.uuid4()) print("merge") - os.system(f'ffmpeg_ubuntu -framerate {fps} -i ./temp_res_frames/frame%d.png -c:v libx264 -pix_fmt yuv420p -y {output_path}') + os.system(f'{FFMPEG_CMD} -framerate {fps} -i ./temp_res_frames/frame%d.png -c:v libx264 -pix_fmt yuv420p -y {output_path}') if audio: output_path = fuse_audio_with_ffmpeg(input,output_path) clean_cache_file(background_remove == 0) diff --git a/tools/utils.py b/tools/utils.py index 7a74d4c..ac644d3 100644 --- a/tools/utils.py +++ b/tools/utils.py @@ -85,7 +85,7 @@ def ratio_resize(img, target_size): return img_new, pad_black def get_model_list(mode_type="image"): - files = os.listdir('./model/{}'.format(mode_type)) + files = os.listdir('./models/{}'.format(mode_type)) model_list = [] for i in files: if i[:4].lower() == "real":