add AR model
This commit is contained in:
1 parent
e0f24982d1
commit
a09d220b85
13 files changed
+184
-67
No files matched your search
@@ -13,14 +13,16 @@ if __name__ == '__main__':
|
||||
vpath_videos = sorted(path_root.glob("raw/*.MP4"), reverse=False)
|
||||
print(f"Have {len(vpath_videos)} dir files")
|
||||
|
||||
IDs = ["1-29min", "2-23min", "3-27min"]
|
||||
# IDs = ["1-29min", "2-23min", "3-27min"]
|
||||
# IDs = ["1-29min", "2-23min", "3-27min"]
|
||||
durations = 0
|
||||
# for each video
|
||||
for i, ipath_item in enumerate(vpath_videos):
|
||||
iname = ipath_item.stem
|
||||
print(f"processing {i}/{len(vpath_videos)} -> {ipath_item} ... ")
|
||||
|
||||
# if i < 40: continue
|
||||
if iname in IDs: continue
|
||||
# if iname in IDs: continue
|
||||
|
||||
# data path
|
||||
ipath_data = path_root.joinpath("processing", ipath_item.stem)
|
||||
@@ -43,6 +45,10 @@ if __name__ == '__main__':
|
||||
video = VideoFileClip(str(ipath_item))
|
||||
print(f"video duration = {video.duration}, fps = {video.fps}, (start, end)=({video.start},{video.end}), nframes={int(video.duration * video.fps)}")
|
||||
|
||||
# durations += video.duration
|
||||
# print(f"\t -> Total durations = ({durations / 60 } min) ({durations / 3600 } h))")
|
||||
# continue
|
||||
|
||||
if video.audio is None:
|
||||
print("\nERROR: audio info is None")
|
||||
continue
|
||||
|
||||
@@ -18,7 +18,7 @@ def main(args):
|
||||
|
||||
|
||||
# device = args.device
|
||||
device = "cuda:3"
|
||||
device = "cuda:8"
|
||||
|
||||
# run DECA
|
||||
deca_cfg.model.use_tex = args.useTex
|
||||
@@ -33,12 +33,15 @@ def main(args):
|
||||
# IDs = ["actor-2HD", "actor-3HD"]
|
||||
# IDs = ["clip_full"]
|
||||
|
||||
|
||||
# for each video
|
||||
for ipath_data in v_dir_videos:
|
||||
for i, ipath_data in enumerate(v_dir_videos):
|
||||
ivideo_name = ipath_data.stem
|
||||
print("\nprocessing ...", ivideo_name)
|
||||
print(f"\n processing {i}/{len(v_dir_videos)} ...", ivideo_name)
|
||||
# if ivideo_name not in IDs: continue
|
||||
|
||||
# if i > 30: break
|
||||
|
||||
ipath_infor = ipath_data.joinpath("video/info.json")
|
||||
ipath_frame = ipath_data.joinpath("frames")
|
||||
|
||||
|
||||
@@ -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} ... ")
|
||||
|
||||
|
||||
Reference in new issue
Block a user