Skip to content

Commit

Permalink
bug: fix the test cmd
Browse files Browse the repository at this point in the history
  • Loading branch information
ZIFENG278 committed Aug 1, 2024
1 parent bf1ffd9 commit e147b68
Show file tree
Hide file tree
Showing 3 changed files with 5 additions and 5 deletions.
1 change: 0 additions & 1 deletion core/imageupscaler.py
Original file line number Diff line number Diff line change
Expand Up @@ -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,
Expand Down
7 changes: 4 additions & 3 deletions core/pipeline.py
Original file line number Diff line number Diff line change
Expand Up @@ -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):
Expand Down Expand Up @@ -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'):
Expand All @@ -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:
Expand Down Expand Up @@ -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)
Expand Down
2 changes: 1 addition & 1 deletion tools/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -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":
Expand Down

0 comments on commit e147b68

Please sign in to comment.