From 4183009740a86b5ff895a47dc94dcb8b323d5bb0 Mon Sep 17 00:00:00 2001 From: LielinJiang <50691816+LielinJiang@users.noreply.github.com> Date: Thu, 4 Mar 2021 14:56:55 +0800 Subject: [PATCH] Fix predictor bug on windows (#210) * update install docs * fix windows bug * fix download when in windows * fix video2frames bug on windows platform --- ppgan/apps/dain_predictor.py | 2 +- ppgan/utils/video.py | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/ppgan/apps/dain_predictor.py b/ppgan/apps/dain_predictor.py index 8a40dd7..bf899c5 100644 --- a/ppgan/apps/dain_predictor.py +++ b/ppgan/apps/dain_predictor.py @@ -78,7 +78,7 @@ class DAINPredictor(BasePredictor): out_path = video2frames(video_path, frame_path_input) - vidname = video_path.split(os.sep)[-1].split('.')[0] + vidname = os.path.basename(video_path).split('.')[0] frames = sorted(glob.glob(os.path.join(out_path, '*.png'))) diff --git a/ppgan/utils/video.py b/ppgan/utils/video.py index 9200f0d..4204da9 100644 --- a/ppgan/utils/video.py +++ b/ppgan/utils/video.py @@ -24,7 +24,7 @@ def video2frames(video_path, outpath, **kargs): return cmd_str ffmpeg = ['ffmpeg ', ' -y -loglevel ', ' error '] - vid_name = video_path.split(os.sep)[-1].split('.')[0] + vid_name = os.path.basename(video_path).split('.')[0] out_full_path = os.path.join(outpath, vid_name) if not os.path.exists(out_full_path): -- GitLab