add audio2mesh_ar

This commit is contained in:
Sen Liang committed 2022-03-14 18:13:13 +08:00
1 parent ded9b27f71
commit e0f24982d1
46 files changed
+3917 -325

No files matched your search

@@ -22,13 +22,18 @@ def main(args):
deca = DECA(config = deca_cfg, device=device)
path_data = Path("/yrfs/lsen/DATA/TestData/processing")
# path_data = Path("/yrfs/lsen/DATA/Actor1/processing")
v_dir_videos = sorted(path_data.glob("*"), reverse=False)
print(f"Have {len(v_dir_videos)} dir files")
# IDs = ["actor-2HD", "actor-3HD"]
IDs = ["clip_full"]
# for each video
for ipath_data in v_dir_videos[1:]:
for ipath_data in v_dir_videos:
ivideo_name = ipath_data.stem
print("\nprocessing ...", ivideo_name)
if ivideo_name not in IDs: continue
ipath_infor = ipath_data.joinpath("video/info.json")
ipath_frame = ipath_data.joinpath("frames")
@@ -50,7 +55,7 @@ def main(args):
with open(str(ipath_infor), "r") as f:
info = json.load(f)
nframes = info['nframes']
nframes = info['nframes']
nframe_real = len(list(ipath_frame.glob("*.jpg")))
@@ -58,7 +63,6 @@ def main(args):
print(f"\n ERROR: nframe_real ={nframe_real} / nframe_info ={nframes}")
continue
# check if finish
nkpt2d = len(list(ipath_kpt2d.glob("*.txt")))
if nkpt2d + 10 > nframes:
@@ -66,7 +70,7 @@ def main(args):
continue
datatest = ObamaData(ipath_frame, iscrop=args.iscrop, face_detector=args.detector)
dataloader = DataLoader(datatest, batch_size=48, shuffle=False, drop_last=False)
dataloader = DataLoader(datatest, batch_size=64, shuffle=False, drop_last=False)
for i, ibatch_data in enumerate(dataloader):
@@ -114,7 +118,7 @@ if __name__ == '__main__':
parser.add_argument('-i', '--inputpath', default='TestSamples/examples', type=str,
help='path to the test data, can be image folder, image path, image list, video')
parser.add_argument('-d', '--device', default='cuda:2', type=str,
parser.add_argument('-d', '--device', default='cuda:0', type=str,
help='set device, cpu for using cpu' )
# process test images
parser.add_argument('--iscrop', default=True, type=lambda x: x.lower() in ['true', '1'],