update run actor4data
This commit is contained in:
1 parent
7550ffe30f
commit
e6c668fef5
5 files changed
+27
-18
No files matched your search
@@ -7,7 +7,9 @@ from moviepy.editor import VideoFileClip, AudioFileClip
|
|||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
||||||
path_raw = Path("/ssdata1/cf/data/raw/20220422")
|
# path_raw = Path("/ssdata1/cf/data/raw/20220422")
|
||||||
|
path_raw = Path("/ssdata1/cf/data/raw/20220422/smile/")
|
||||||
|
# path_raw = Path("/mfs/lsen/DATA/Actor4")
|
||||||
path_root = Path("/mfs/lsen/DATA/Actor4")
|
path_root = Path("/mfs/lsen/DATA/Actor4")
|
||||||
|
|
||||||
vpath_videos = sorted(path_raw.glob("*.MP4"), reverse=True)
|
vpath_videos = sorted(path_raw.glob("*.MP4"), reverse=True)
|
||||||
@@ -16,15 +18,15 @@ if __name__ == '__main__':
|
|||||||
# IDs = ["clip_full"]
|
# IDs = ["clip_full"]
|
||||||
durations = 0
|
durations = 0
|
||||||
# for each video
|
# for each video
|
||||||
for i, ipath_item in enumerate(vpath_videos):
|
for i, ipath_item in enumerate(vpath_videos[6:]):
|
||||||
iname = ipath_item.stem
|
iname = ipath_item.stem
|
||||||
print(f"processing {i}/{len(vpath_videos)} -> {ipath_item} ... ")
|
print(f"processing {i}/{len(vpath_videos)} -> {ipath_item} ... ")
|
||||||
|
|
||||||
# if i < 40: continue
|
# if i < 40: continue
|
||||||
# if iname not in IDs: continue
|
# if iname not in IDs: continue
|
||||||
|
|
||||||
# data path
|
# data path
|
||||||
ipath_data = path_root.joinpath("processing", ipath_item.stem)
|
ipath_data = path_root.joinpath("smile", ipath_item.stem)
|
||||||
|
|
||||||
ipath_frame = ipath_data.joinpath("frames")
|
ipath_frame = ipath_data.joinpath("frames")
|
||||||
ipath_video = ipath_data.joinpath("video")
|
ipath_video = ipath_data.joinpath("video")
|
||||||
|
|||||||
@@ -17,27 +17,26 @@ from decalib.utils.config import cfg as deca_cfg
|
|||||||
def main(args):
|
def main(args):
|
||||||
|
|
||||||
# device = args.device
|
# device = args.device
|
||||||
device = "cuda:7"
|
device = "cuda:5"
|
||||||
|
|
||||||
# run DECA
|
# run DECA
|
||||||
deca_cfg.model.use_tex = args.useTex
|
deca_cfg.model.use_tex = args.useTex
|
||||||
deca = DECA(config = deca_cfg, device=device)
|
deca = DECA(config = deca_cfg, device=device)
|
||||||
|
|
||||||
# path_data = Path("/yrfs/lsen/DATA/TestData/processing")
|
# path_data = Path("/yrfs/lsen/DATA/TestData/processing")
|
||||||
path_data = Path("/mfs/lsen/DATA/Actor4/processing")
|
path_data = Path("/mfs/lsen/DATA/Actor4/smile")
|
||||||
|
|
||||||
v_dir_videos = sorted(path_data.glob("*"), reverse=True)
|
v_dir_videos = sorted(path_data.glob("*"), reverse=True)
|
||||||
print(f"Have {len(v_dir_videos)} dir files")
|
print(f"Have {len(v_dir_videos)} dir files")
|
||||||
|
|
||||||
# IDs = ["actor-2HD", "actor-3HD"]
|
# IDs = ["actor-2HD", "actor-3HD"]
|
||||||
# IDs = ["clip_full"]
|
# IDs = ["clip_full"]
|
||||||
|
|
||||||
# for each video
|
# for each video
|
||||||
for i, ipath_data in enumerate(v_dir_videos[1:]):
|
for i, ipath_data in enumerate(v_dir_videos[4:]):
|
||||||
ivideo_name = ipath_data.stem
|
ivideo_name = ipath_data.stem
|
||||||
print(f"\n processing {i}/{len(v_dir_videos)} ...", ivideo_name)
|
print(f"\n processing {i}/{len(v_dir_videos)} ...", ivideo_name)
|
||||||
# if ivideo_name not in IDs: continue
|
# if ivideo_name not in IDs: continue
|
||||||
|
|
||||||
# if i > 25: break
|
# if i > 25: break
|
||||||
|
|
||||||
ipath_infor = ipath_data.joinpath("video/info.json")
|
ipath_infor = ipath_data.joinpath("video/info.json")
|
||||||
|
|||||||
@@ -7,8 +7,8 @@ from pathlib import Path
|
|||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
||||||
path_data = Path("/mfs/lsen/DATA/Actor4/processing")
|
path_data = Path("/mfs/lsen/DATA/Actor4/smile")
|
||||||
v_dir_videos = sorted(path_data.glob("*"), reverse=True)
|
v_dir_videos = sorted(path_data.glob("*"), reverse=False)
|
||||||
print(f"Have {len(v_dir_videos)} dir files")
|
print(f"Have {len(v_dir_videos)} dir files")
|
||||||
|
|
||||||
# for each video
|
# for each video
|
||||||
|
|||||||
@@ -5,8 +5,8 @@ import torchaudio
|
|||||||
|
|
||||||
if __name__ == "__main__":
|
if __name__ == "__main__":
|
||||||
|
|
||||||
path_data = Path("/mfs/lsen/DATA/Actor4/processing")
|
path_data = Path("/mfs/lsen/DATA/Actor4/smile")
|
||||||
path_save = Path('data/Actor4/Actor4-raw-1h') # processing
|
path_save = Path('data/Actor4/Actor4-smile-1h') # processing
|
||||||
path_save.mkdir(parents=True, exist_ok=True)
|
path_save.mkdir(parents=True, exist_ok=True)
|
||||||
|
|
||||||
v_dir_videos = sorted(path_data.glob("*/audio/feat_DECA_exp_trim.npy"))
|
v_dir_videos = sorted(path_data.glob("*/audio/feat_DECA_exp_trim.npy"))
|
||||||
@@ -16,8 +16,14 @@ if __name__ == "__main__":
|
|||||||
vids = set([ipath.stem for ipath in v_dir_videos])
|
vids = set([ipath.stem for ipath in v_dir_videos])
|
||||||
# print(f"vids total= {vids}")
|
# print(f"vids total= {vids}")
|
||||||
|
|
||||||
vid_test = set(["4R3A0024"])
|
# # actor4 raw
|
||||||
vid_valid = set(["4R3A0024"])
|
# vid_test = set(["4R3A0024"])
|
||||||
|
# vid_valid = set(["4R3A0024"])
|
||||||
|
# vid_train = vids - vid_test - vid_valid
|
||||||
|
|
||||||
|
# actor4 smile
|
||||||
|
vid_test = set(["4R3A0039"])
|
||||||
|
vid_valid = set(["4R3A0039"])
|
||||||
vid_train = vids - vid_test - vid_valid
|
vid_train = vids - vid_test - vid_valid
|
||||||
|
|
||||||
print(f"vid test= {vid_test} \nvalid= {vid_valid}")
|
print(f"vid test= {vid_test} \nvalid= {vid_valid}")
|
||||||
|
|||||||
@@ -7,7 +7,9 @@ from moviepy.editor import VideoFileClip, AudioFileClip
|
|||||||
|
|
||||||
if __name__ == '__main__':
|
if __name__ == '__main__':
|
||||||
|
|
||||||
path_raw = Path("/ssdata1/cf/data/raw/20220422/bg")
|
# path_raw = Path("/ssdata1/cf/data/raw/20220422/bg")
|
||||||
|
path_raw = Path("/mfs/lsen/DATA/Actor4")
|
||||||
|
|
||||||
path_root = Path("/mfs/lsen/DATA/Actor4")
|
path_root = Path("/mfs/lsen/DATA/Actor4")
|
||||||
|
|
||||||
vpath_videos = sorted(path_raw.glob("*.mp4"), reverse=False)
|
vpath_videos = sorted(path_raw.glob("*.mp4"), reverse=False)
|
||||||
@@ -16,7 +18,7 @@ if __name__ == '__main__':
|
|||||||
# IDs = ["clip_full"]
|
# IDs = ["clip_full"]
|
||||||
durations = 0
|
durations = 0
|
||||||
# for each video
|
# for each video
|
||||||
for i, ipath_item in enumerate(vpath_videos[1:]):
|
for i, ipath_item in enumerate(vpath_videos):
|
||||||
iname = ipath_item.stem
|
iname = ipath_item.stem
|
||||||
print(f"processing {i}/{len(vpath_videos)} -> {ipath_item} ... ")
|
print(f"processing {i}/{len(vpath_videos)} -> {ipath_item} ... ")
|
||||||
|
|
||||||
@@ -24,7 +26,7 @@ if __name__ == '__main__':
|
|||||||
# if iname not in IDs: continue
|
# if iname not in IDs: continue
|
||||||
|
|
||||||
# data path
|
# data path
|
||||||
ipath_data = path_root.joinpath("bg", ipath_item.stem)
|
ipath_data = path_root.joinpath("bg_black", ipath_item.stem)
|
||||||
|
|
||||||
ipath_frame = ipath_data.joinpath("frames")
|
ipath_frame = ipath_data.joinpath("frames")
|
||||||
ipath_video = ipath_data.joinpath("video")
|
ipath_video = ipath_data.joinpath("video")
|
||||||
|
|||||||
Reference in new issue
Block a user