update audduio2pose v1.0

This commit is contained in:
Sen Liang committed 2022-04-24 14:06:52 +08:00
1 parent c2797657f8
commit 3a15011f4d
28 files changed
+1817 -483

No files matched your search

+10 -17
View File
@@ -1,7 +1,4 @@
import os
import sys
import json
import librosa
import numpy as np
from pathlib import Path
@@ -44,23 +41,15 @@ if __name__ == "__main__":
print(f"ERROR: info['active_frames'] = {info['active_frames']}")
continue
# check
vframe_frame = list(ipath_frame.glob("*.jpg"))
vframe_coeff = list(ipath_coeff.glob("*.npy"))
print(f"vframe_frame len = {len(vframe_frame)}, vframe_coeff={len(vframe_coeff)}")
# vframe_frame = list(ipath_frame.glob("*.jpg"))
# vframe_coeff = list(ipath_coeff.glob("*.npy"))
# print(f"vframe_frame len = {len(vframe_frame)}, vframe_coeff={len(vframe_coeff)}")
duration_frame += len(vframe_frame) / fps / 60
duration_coeff += len(vframe_coeff) / fps / 60
print(f"add duration_frame = {duration_frame} min, duration_coeff={duration_coeff} min")
if len(vframe_frame) != nframe_trim:
print(f"\n ERROR: nframe_real ={len(vframe_frame)} / nframe_info ={nframe_trim}")
continue
# if len(vframe_frame) != nframe_trim:
# print(f"\n ERROR: nframe_real ={len(vframe_frame)} / nframe_info ={nframe_trim}")
# continue
if len(vframe_coeff)+1 < nframe_trim:
print(f"\n ERROR: nframe_coeff ={len(vframe_coeff)} / nframe_info ={nframe_trim}")
continue
feat_pos = []
feat_cam = []
@@ -68,6 +57,7 @@ if __name__ == "__main__":
jpath_coeff = ipath_coeff.joinpath(f"frame-{j:05d}.json.npy")
if j%1000 == 0: print(f"processing the {j}-th frame ... ")
if not jpath_coeff.exists():
print(f"\n ERROR: Path NOT FOUND! -> {jpath_coeff}")
break
@@ -84,6 +74,9 @@ if __name__ == "__main__":
np.save(ipath_save_pos, feat)
print(f"SAVE OK! pos = {feat.shape}, nframe={nframe_trim}\n save to -> {ipath_save_pos}") # (nframe, 9)
duration_coeff += nframe_trim / fps / 60
print(f"add duration_coeff={duration_coeff} min")
else:
print("ERROR, skip! ")