initial commit
This commit is contained in:
commit
c7175dd7ff
127 files changed
+13949
No files matched your search
@@ -0,0 +1,71 @@
|
||||
import os
|
||||
import sys
|
||||
from pathlib2 import Path
|
||||
import shutil
|
||||
|
||||
|
||||
|
||||
if __name__ == "__main__":
|
||||
|
||||
path_data = Path('/yrfs/lsen/DATA/GRID/processing/s1')
|
||||
v_dir_videos = sorted(path_data.glob("*/audio/feat_ldmk_trim_norm.npy"))
|
||||
|
||||
path_audio_wav = Path("data/paper_GRID_gt/audio_wav")
|
||||
path_ldmk_25fps = Path("data/paper_GRID_gt/ldmk_25fps")
|
||||
path_audio_feat = Path("data/paper_GRID_gt/feat_mel_no_align")
|
||||
path_video_25fps = Path("data/paper_GRID_gt/video_25fps")
|
||||
|
||||
path_audio_wav.mkdir(parents=True, exist_ok=True)
|
||||
path_ldmk_25fps.mkdir(parents=True, exist_ok=True)
|
||||
path_video_25fps.mkdir(parents=True, exist_ok=True)
|
||||
path_audio_feat.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
|
||||
ncount = 0
|
||||
for i, ipath in enumerate(v_dir_videos):
|
||||
|
||||
ipath_data = ipath.parent.parent
|
||||
print(f"ipath_data = {ipath_data}")
|
||||
|
||||
ipath_audio = ipath_data.joinpath("audio/audio_extract.wav")
|
||||
ipath_ldmks = ipath_data.joinpath("audio/feat_ldmk_trim_norm.npy")
|
||||
ipath_video = ipath_data.joinpath("video/video_orignal.mp4")
|
||||
ipath_audio_feat = ipath_data.joinpath("audio/feat_mel_no_align_trim.npy")
|
||||
|
||||
# skip if not exsits
|
||||
if not ipath_ldmks.exists(): continue
|
||||
if not ipath_audio.exists(): continue
|
||||
if not ipath_video.exists(): continue
|
||||
|
||||
|
||||
# copy to
|
||||
# ipath_audio_target = path_audio_wav.joinpath(f"clips_{ncount:03d}.wav")
|
||||
# shutil.copy(src=str(ipath_audio), dst=str(ipath_audio_target))
|
||||
# print(f"copy {ipath_audio} --> {ipath_audio_target}")
|
||||
|
||||
# ipath_ldmks_target = path_ldmk_25fps.joinpath(f"clips_{ncount:03d}.npy")
|
||||
# shutil.copy(src=str(ipath_ldmks), dst=str(ipath_ldmks_target))
|
||||
# print(f"copy {ipath_ldmks} --> {ipath_ldmks_target}")
|
||||
|
||||
# ipath_video_target = path_video_25fps.joinpath(f"clips_{ncount:03d}.mp4")
|
||||
# shutil.copy(src=str(ipath_video), dst=str(ipath_video_target))
|
||||
# print(f"copy {ipath_video} --> {ipath_video_target}")
|
||||
|
||||
ipath_audio_feat_tgt = path_audio_feat.joinpath(f"clips_{ncount:03d}.npy")
|
||||
shutil.copy(src=str(ipath_audio_feat), dst=str(ipath_audio_feat_tgt))
|
||||
print(f"copy {ipath_audio_feat} --> {ipath_audio_feat_tgt}")
|
||||
|
||||
|
||||
ncount += 1
|
||||
if ncount >= 100: break
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
Reference in new issue
Block a user