MMAction2中:基于人体姿态预测动作标签
!python demo/demo_video_structuralize.py --skeleton-stdet-checkpoint checkpoints/posec3d_ava.pth \
--det-config demo/faster_rcnn_r50_fpn_2x_coco.py \
--det-checkpoint checkpoints/faster_rcnn_r50_fpn_2x_coco_bbox_mAP-0.384_20200504_210434-a5d8aa15.pth \
--pose-config demo/hrnet_w32_coco_256x192.py \
--pose-checkpoint checkpoints/hrnet_w32_coco_256x192-c78dce93_20200708.pth \
--skeleton-config configs/skeleton/posec3d/slowonly_r50_u48_240e_ntu120_xsub_keypoint.py \
--skeleton-checkpoint checkpoints/posec3d_k400.pth \
--use-skeleton-stdet \
--use-skeleton-recog \
--label-map-stdet tools/data/ava/label_map.txt \
--label-map tools/data/kinetics/label_map_k400.txt
之后显示以下消息后,表明正在构建和编写视频:
Moviepy - Building video demo/test_stdet_recognition_output.mp4.
Moviepy - Writing video demo/test_stdet_recognition_output.mp4
但出现以下错误提示:
Traceback (most recent call last):
File "demo/demo_video_structuralize.py", line 786, in <module>
main()
File "demo/demo_video_structuralize.py", line 779, in main
vid.write_videofile(args.out_filename)
File "C:\Users\HASEE\miniconda3\lib\site-packages\decorator.py", line 232, in fun
return caller(func, *(extras + args), **kw)
File "C:\Users\HASEE\miniconda3\lib\site-packages\moviepy\decorators.py", line 54, in requires_duration
return f(clip, *a, **k)
File "C:\Users\HASEE\miniconda3\lib\site-packages\decorator.py", line 232, in fun
return caller(func, *(extras + args), **kw)
File "C:\Users\HASEE\miniconda3\lib\site-packages\moviepy\decorators.py", line 135, in use_clip_fps_by_default
return f(clip, *new_a, **new_kw)
File "C:\Users\HASEE\miniconda3\lib\site-packages\decorator.py", line 232, in fun
return caller(func, *(extras + args), **kw)
File "C:\Users\HASEE\miniconda3\lib\site-packages\moviepy\decorators.py", line 22, in convert_masks_to_RGB
return f(clip, *a, **k)
File "C:\Users\HASEE\miniconda3\lib\site-packages\moviepy\video\VideoClip.py", line 300, in write_videofile
ffmpeg_write_video(self, filename, fps, codec,
File "C:\Users\HASEE\miniconda3\lib\site-packages\moviepy\video\io\ffmpeg_writer.py", line 213, in ffmpeg_write_video
with FFMPEG_VideoWriter(filename, clip.size, fps, codec = codec,
File "C:\Users\HASEE\miniconda3\lib\site-packages\moviepy\video\io\ffmpeg_writer.py", line 88, in __init__
'-r', '%.02f' % fps,
TypeError: must be real number, not NoneType
通过参考网友建议:
python - 每当尝试将 write_videofile 运行到 moviepy 中的剪辑时,都会出现 "TypeError: must be real number, not NoneType" - IT工具网 (coder.work)
最佳方式是升级moviepy安装包文章来源:https://www.toymoban.com/news/detail-687290.html
pip install moviepy --upgrade
果然,在升级moviepy安装包之后bug真的解决了!亲测有效,强力推荐!!!文章来源地址https://www.toymoban.com/news/detail-687290.html
到了这里,关于【已解决】moviepy视频剪辑TypeError: must be real number, not NoneType问题的文章就介绍完了。如果您还想了解更多内容,请在右上角搜索TOY模板网以前的文章或继续浏览下面的相关文章,希望大家以后多多支持TOY模板网!