栏目分类:
子分类:
返回
名师互学网用户登录
快速导航关闭
当前搜索
当前分类
子分类
实用工具
热门搜索
名师互学网 > IT > 软件开发 > 后端开发 > Python

paddldetection下mask-rcnn训练(自用数据集转化为coco数据集):

Python 更新时间: 发布时间: IT归档 最新发布 模块sitemap 名妆网 法律咨询 聚返吧 英语巴士网 伯小乐 网商动力

paddldetection下mask-rcnn训练(自用数据集转化为coco数据集):

1.安装 

python -m pip install paddlepaddle -i https://mirror.baidu.com/pypi/simple
#加速克隆paddledetection
git clone https://hub.fastgit.org/PaddlePaddle/PaddleDetection.git
#选择使用码云上的托管
git clone https://gitee.com/paddlepaddle/PaddleDetection
pip install
"git+https://hub.fastgit.org/cocodataset/cocoapi.git#subdirectory=PythonAPI"

2.将自己的数据集转换为coco数据集

python tools/x2coco.py --dataset_type labelme --json_input_dir ./dataset/coco/2json  --image_input_dir ./dataset/coco/2jpg  --output_dir ./output --train_proportion 0.8  --val_proportion 0.2 --test_proportion 0.0

3.修改配置文件

coco_instance.yml中修改类别数,修改数据集路径 

4.训练

#cpu训练
python tools/train.py -c configs/mask_rcnn/mask_rcnn_r50_fpn_2x_coco.yml -o use_gpu=false --eval  
#gpu训练
python -u tools/train.py -c configs/mask_rcnn_r50_vd_fpn_2x.yml  --use_vdl=true  --vdl_log_dir=vdl_dir/scalar  --eval  -o use_gpu=true

训练中出现没有各种包的错误,可以按照如下解决

pip install pyyaml -i https://pypi.douban.com/simple/

 

pip install opencv-python -i https://pypi.douban.com/simple/

 5.测试

python tools/eval.py -c configs/mask_rcnn_r50_fpn_1x.yml -o use_gpu=true weights=output/mask_rcnn_r50_fpn_1x/best_model

 

 

转载请注明:文章转载自 www.mshxw.com
本文地址:https://www.mshxw.com/it/822471.html
我们一直用心在做
关于我们 文章归档 网站地图 联系我们

版权所有 (c)2021-2022 MSHXW.COM

ICP备案号:晋ICP备2021003244-6号