add AR model

This commit is contained in:
Sen Liang committed 2022-03-17 15:17:20 +08:00
1 parent e0f24982d1
commit a09d220b85
13 files changed
+184 -67

No files matched your search

+11 -8
View File
@@ -15,9 +15,9 @@ if __name__ == '__main__':
print(f"Have {len(vpath_videos)} dir files")
# IDs = ["clip_full"]
durations = 0
# for each video
for i, ipath_item in enumerate(vpath_videos[2:]):
for i, ipath_item in enumerate(vpath_videos):
iname = ipath_item.stem
print(f"processing {i}/{len(vpath_videos)} -> {ipath_item} ... ")
@@ -36,12 +36,12 @@ if __name__ == '__main__':
ipath_video.mkdir(parents=True, exist_ok=True)
ipath_audio.mkdir(parents=True, exist_ok=True)
# # load video info
if ipath_infor.exists():
continue
# with open(str(ipath_infor), "r") as f:
# info = json.load(f)
# nframe_info = info['nframes']
# # # load video info
# if ipath_infor.exists():
# continue
# # with open(str(ipath_infor), "r") as f:
# # info = json.load(f)
# # nframe_info = info['nframes']
# load video
video = VideoFileClip(str(ipath_item))
@@ -51,6 +51,9 @@ if __name__ == '__main__':
print("\nERROR: audio info is None")
continue
durations += video.duration
print(f"\t -> Total durations = ({durations / 60 } min) ({durations / 3600 } h))")
continue
# Trim
# video = video.subclip(t_start=5.0, t_end=int(video.duration)-5.0) before 03.14
@@ -32,7 +32,7 @@ if __name__ == "__main__":
path_data = Path("/yrfs/lsen/DATA/Actor2/processing")
path_save = Path('data/Actor2/Actor2-raw-2h') # processing
path_save = Path('data/Actor2/Actor2-raw-6h') # processing
path_save.mkdir(parents=True, exist_ok=True)
v_dir_videos = sorted(path_data.glob("*/audio/feat_DECA_exp_trim.npy"))
@@ -42,8 +42,8 @@ if __name__ == "__main__":
vids = set([ipath.stem for ipath in v_dir_videos])
# print(f"vids total= {vids}")
vid_test = set(["AA7A9568"])
vid_valid = set(["AA7A9569"])
vid_test = set(["AA7A9568", "AA7A9577"])
vid_valid = set(["AA7A9569", "AA7A9578"])
vid_train = vids - vid_test - vid_valid
# vids = set(["2021-P09", "2021-P14", "2021-P22"])
@@ -63,7 +63,7 @@ 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 > 2: break
if durations_train / 3600 > 6: break
print(f"\n processing the {i}-th video {vid} ... ")