add BG_actor6 processing

This commit is contained in:
sen.liang committed 2022-07-14 19:19:33 +08:00
1 parent a7cd20b689
commit faeb2332b8
15 files changed
+1853 -95

No files matched your search

+4 -1
View File
@@ -10,11 +10,14 @@ if __name__ == "__main__":
# fid = "Bringing-Our-Workplace-Policies-into-the-21st-Century"
# fid = "4R3A0071"
fid = '4R3A0110'
fid = '4R3A0163'
path_root = Path("/mfs/lsen/DATA/Actor6/bg/processing")
path_root = Path("/ssdata1/lsen/DATA/Actor6/processing")
# path_save = Path("./data/Actor5/DECA_Actor5_mean_smile.npy")
path_save = Path("./data/Actor6/DECA_Actor6_mean.npy")
path_save.parent.mkdir(parents=True, exist_ok=True)
logger = Logger(path_save.parent, postfix="mean_coeff")
@@ -1,37 +0,0 @@
from pathlib import Path
import json
import os
import moviepy
from moviepy.editor import VideoFileClip, AudioFileClip
import os, sys
sys.path.insert(0, os.getcwd())
from common.logger import Logger
import sys
if __name__ == "__main__":
# path_raw = Path("/ssdata1/cf/data/raw/actor06/20220517")
path_raw = Path("/ssdata1/cf/data/raw/actor06/bg")
path_root = Path("/mfs/lsen/DATA/Actor6/bg/raw-rotaion")
path_root.mkdir(parents=True, exist_ok=True)
# get all videos
vpath_videos = sorted(path_raw.glob("*.MP4"), reverse=False)
print(f"Have {len(vpath_videos)} dir files")
# for each video
for i, ipath_item in enumerate(vpath_videos):
iname = ipath_item.stem
print(f"processing {i}/{len(vpath_videos)} -> {ipath_item} ... ")
ipath_rotaion = path_root.joinpath(f"{iname}.mp4")
cmd = f"ffmpeg -i {str(ipath_item)} -vf 'transpose=1' {str(ipath_rotaion)} "
print(f"cmd = {cmd}")
os.system(cmd)
@@ -13,10 +13,13 @@ from decalib.datasets.datasets2 import ObamaData
from decalib.utils import util
from decalib.utils.config import cfg as deca_cfg
def main(args):
# device = args.device
device = "cuda:5"
device = "cuda:0"
# run DECA
deca_cfg.model.use_tex = args.useTex
deca = DECA(config = deca_cfg, device=device)
@@ -64,9 +67,12 @@ def main(args):
nframe_real = len(list(ipath_frame.glob("*.jpg")))
if nframe_real != nframes:
if nframe_real + 10 < nframes:
print(f"\n ERROR: nframe_real ={nframe_real} / nframe_info ={nframes}")
continue
else:
nframes = nframe_real
# check if finish
nkpt2d = len(list(ipath_kpt2d.glob("*.txt")))
+2 -1
View File
@@ -7,7 +7,8 @@ from pathlib import Path
if __name__ == "__main__":
path_data = Path("/ssdata1/lsen/DATA/Actor6/processing2")
# path_data = Path("/ssdata1/lsen/DATA/Actor6/processing2")
path_data = Path("/mfs/lsen/DATA/Actor6/bg/processing")
v_dir_videos = sorted(path_data.glob("*"), reverse=False)
print(f"Have {len(v_dir_videos)} dir files")