如何训练LightWeight OpenPose

如何训练LightWeight OpenPose,第1张

前期准备:

1 下载COCO2017数据集,数据集地址为:http://cocodataset.org/#download](http://cocodataset.org/#download

解压至文件夹

2 安装要求的环境  pip install -r requirements.txt
训练

训练包含三个步骤

1.训练MobileNet权重,经过此轮训练期望AP值达到38%

2.训练上一阶段的权重,期待达到AP39%

3训练上一阶段的权重,期待达到AP40%

具体步骤:

1.下载MobileNet v1权重 mobilenet_sgd_68.848.pth.tar
2. 转换标签格式

python scripts/prepare_train_labels.py --labels /annotations/person_keypoints_train2017.json

产生prepared_train_annotation.pkl

3.python train.py --train-images-folder /train2017/ --prepared-train-labels prepared_train_annotation.pkl --val-labels val_subset.json --val-images-folder /val2017/ --checkpoint-path /mobilenet_sgd_68.848.pth.tar --from-mobilenet

4. python train.py --train-images-folder /train2017/ --prepared-train-labels prepared_train_annotation.pkl --val-labels val_subset.json --val-images-folder /val2017/ --checkpoint-path /checkpoint_iter_420000.pth --weights-only

5. 继续训练,三步调优, python train.py --train-images-folder /train2017/ --prepared-train-labels prepared_train_annotation.pkl --val-labels val_subset.json --val-images-folder /val2017/ --checkpoint-path /checkpoint_iter_280000.pth --weights-only --num-refinement-stages 3  采用 checkpoint 370000 迭代后作为最终的结果.

We did not perform the best checkpoint selection at any step, so similar result may be achieved after less number of iterations.

欢迎分享,转载请注明来源:内存溢出

原文地址:https://54852.com/langs/873281.html

(0)
打赏 微信扫一扫微信扫一扫 支付宝扫一扫支付宝扫一扫
上一篇 2022-05-13
下一篇2022-05-13

发表评论

登录后才能评论

评论列表(0条)

    保存