Merge branch 'master' of ssh://dev.rcrai.com:30022/liangsen/audio-to-motion
This commit is contained in:
commit
4d4015350c
53 files changed
+4284
-1371
No files matched your search
@@ -32,7 +32,7 @@ if __name__ == "__main__":
|
||||
|
||||
path_data = Path("/mfs/lsen/DATA/Actor1/processing")
|
||||
|
||||
path_save = Path('data/Actor1/Actor1-raw-7h') # processing
|
||||
path_save = Path('data/Actor1/Actor1-raw-16h') # processing
|
||||
path_save.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
v_dir_videos = sorted(path_data.glob("*/audio/feat_DECA_exp_trim.npy"))
|
||||
@@ -63,6 +63,7 @@ if __name__ == "__main__":
|
||||
print(f"vid test= {vid_test} \nvalid= {vid_valid}")
|
||||
print(f"vid train= {vid_train}")
|
||||
|
||||
# vid_tmp = ["34-28min"]
|
||||
# for each video
|
||||
data_train, data_valid, data_test = {}, {}, {}
|
||||
durations_train, durations_valid, durations_test = 0, 0, 0
|
||||
@@ -71,8 +72,10 @@ if __name__ == "__main__":
|
||||
|
||||
# if vid not in vids: continue
|
||||
# if vid in vid_test: continue
|
||||
# if vid in vid_valid:continue
|
||||
# if durations_train / 3600 > 5: break
|
||||
|
||||
# if vid in vid_tmp:continue
|
||||
|
||||
if durations_train / 3600 > 8: break
|
||||
# if durations_valid / 3600 > 4: break
|
||||
|
||||
print(f"\n processing the {i}-th video {vid} ... ")
|
||||
@@ -100,14 +103,13 @@ if __name__ == "__main__":
|
||||
print(f"info={info}, duration = {nframes/fps}")
|
||||
assert fps == 50, "fps should be 50"
|
||||
|
||||
|
||||
# laod motion
|
||||
data_exp = np.load(ipath_feat_exp) # (nframe, 50)
|
||||
data_pos = np.load(ipath_feat_pos) # (nframe, 6)
|
||||
data_idn = np.load(ipath_feat_idn) # (nframe, 100)
|
||||
# data_idn = np.load(ipath_feat_idn) # (nframe, 100)
|
||||
|
||||
assert data_exp.shape[0] == data_pos.shape[0], f"data_exp shape={data_exp.shape}, data_pos shape={data_pos.shape}"
|
||||
assert data_exp.shape[0] == data_idn.shape[0], f"data_exp shape={data_exp.shape}, data_idn shape={data_idn.shape}"
|
||||
# assert data_exp.shape[0] == data_idn.shape[0], f"data_exp shape={data_exp.shape}, data_idn shape={data_idn.shape}"
|
||||
|
||||
data_pos_head = data_pos[:, :3] # (nframe, 3)
|
||||
data_pos_lips = data_pos[:, 3:] # (nframe, 3)
|
||||
@@ -146,7 +148,7 @@ if __name__ == "__main__":
|
||||
"nframe": nframes,
|
||||
"data_motion": data_motion,
|
||||
"data_speech": audio_raw,
|
||||
"data_shape": data_idn,
|
||||
# "data_shape": data_idn,
|
||||
}
|
||||
|
||||
|
||||
@@ -159,7 +161,7 @@ if __name__ == "__main__":
|
||||
"nframe": nframes,
|
||||
"data_motion": data_motion,
|
||||
"data_speech": audio_raw,
|
||||
"data_shape": data_idn,
|
||||
# "data_shape": data_idn,
|
||||
}
|
||||
|
||||
|
||||
@@ -172,7 +174,7 @@ if __name__ == "__main__":
|
||||
"nframe": nframes,
|
||||
"data_motion": data_motion,
|
||||
"data_speech": audio_raw,
|
||||
"data_shape": data_idn,
|
||||
# "data_shape": data_idn,
|
||||
}
|
||||
|
||||
print(f"frames: data_train ({durations_train / 60 } min) ({durations_train / 3600 } h) , ids = ({len(data_train)})")
|
||||
|
||||
Reference in new issue
Block a user