add BG_Actor6 support
This commit is contained in:
1 parent
dd5b0646be
commit
3664438a08
19 files changed
+4089
-52
No files matched your search
@@ -0,0 +1,52 @@
|
||||
|
||||
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("/mfs/lsen/DATA/Actor6/bg/raw-rotaion")
|
||||
path_vis = Path("/mfs/lsen/DATA/Actor6/bg/openpifpaf-vis")
|
||||
path_json = Path("/mfs/lsen/DATA/Actor6/bg/openpifpaf-json")
|
||||
path_vis.mkdir(parents=True, exist_ok=True)
|
||||
path_json.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_vis = path_vis.joinpath(f"{iname}_vis.mp4")
|
||||
ipath_json = path_json.joinpath(f"{iname}_wholepose.json")
|
||||
|
||||
|
||||
cmd = f"CUDA_VISIBLE_DEVICES=9 \
|
||||
python -m openpifpaf.video \
|
||||
--source={ipath_item} \
|
||||
--checkpoint=shufflenetv2k16-wholebody \
|
||||
--long-edge=960 \
|
||||
--batch-size 32 \
|
||||
--video-fps 50 \
|
||||
--line-width 1 \
|
||||
--video-output {ipath_vis} \
|
||||
--json-output {ipath_json} \
|
||||
"
|
||||
print(f"cmd = {cmd}")
|
||||
os.system(cmd)
|
||||
Reference in new issue
Block a user