2,事先转换一下格式
ffmpeg -i D:\Media\IMG_0873.MOV D:\Media\output.avi
ffmpeg -i inference/input_directory/M2U08403.MPG inference/input_directory/M2U08403.MP4
也可以不转换格式,但是我没试验
3,解决方案:代码的错误一直迷惑了我。其实按照教程所说的只是位置参数/,关键参数*,其余的不用加
cd C:\Users\Salab students\Downloads\VideoPose3D-master (1)\VideoPose3D-master\inference
python infer_video_d2.py --cfg COCO-Keypoints/keypoint_rcnn_R_101_FPN_3x.yaml --output-dir output_directory --image-ext mp4 input_directory
来自 https://github.com/facebookresearch/VideoPose3D/blob/master/INFERENCE.md
无法定位程序输入点pyd
4,cd C:\Users\Salab students\Downloads\VideoPose3D-master (1)\VideoPose3D-master\data
python prepare_data_2d_custom.py -i …\inference\output_directory -o myvideos
来自 https://github.com/facebookresearch/VideoPose3D/blob/master/INFERENCE.md
读取npz格式文件内容:
data=np.load(‘data_2d_custom_myvideos.npz’)
5,最正确的配置,注意其中的viz.subject为渲染的视频名称
Viz.video为渲染的视频路径加名称
cd C:\Users\Salab students\Downloads\VideoPose3D-master (1)\VideoPose3D-master
python run.py -d custom -k myvideos -arc 3,3,3,3,3 -c checkpoint --evaluate pretrained_h36m_detectron_coco.bin --render --viz-subject M2U08403.MP4 --viz-action custom --viz-camera 0 --viz-video inference/input_directory/M2U08403.MP4 --viz-output output.mp4 --viz-size 6
(官方源码:
python run.py -d custom -k myvideos -arc 3,3,3,3,3 -c checkpoint --evaluate pretrained_h36m_detectron_coco.bin --render --viz-subject input_video.mp4 --viz-action custom --viz-camera 0 --viz-video /path/to/input_video.mp4 --viz-output output.mp4 --viz-size 6)
过程中的参数:
Namespace(actions=’*’, architecture=‘3,3,3,3,3’, batch_size=1024, bone_length_term=True, by_subject=False, causal=False, channels=1024, checkpoint=‘checkpoint’, checkpoint_frequency=10, data_augmentation=True, dataset=‘custom’, dense=False, disable_optimizations=False, downsample=1, dropout=0.25, epochs=60, evaluate=‘pretrained_h36m_detectron_coco.bin’, export_training_curves=False, keypoints=‘myvideos’, learning_rate=0.001, linear_projection=False, lr_decay=0.95, no_eval=False, no_proj=False, render=True, resume=’’, stride=1, subjects_test=‘S9,S11’, subjects_train=‘S1,S5,S6,S7,S8’, subjects_unlabeled=’’, subset=1, test_time_augmentation=True, viz_action=‘custom’, viz_bitrate=3000, viz_camera=0, viz_downsample=1, viz_export=None, viz_limit=-1, viz_no_ground_truth=False, viz_output=‘output.mp4’, viz_size=6, viz_skip=0, viz_subject=‘input_video.mp4’, viz_video=’/path/to/input_video.mp4’, warmup=1)