怎样创作网站,有了域名 怎么做网站,网站开发管理方案,wordpress 4.6.3 漏洞根据requirements - 开源项目默认的.txt进行库安装
环境#xff1a;WIN10 Anoconda Pycharm python3.6.2
mask_rcnn基本流程1、训练
1)labelme进行目标物体标记#xff0c;生成json文件#xff0c;含点坐标、以及各个物体的标签label;
json文件的格式#xff1a;…根据requirements - 开源项目默认的.txt进行库安装
环境WIN10 Anoconda Pycharm python3.6.2
mask_rcnn基本流程1、训练
1)labelme进行目标物体标记生成json文件含点坐标、以及各个物体的标签label;
json文件的格式在balloon.py中提到
# { filename: 28503151_5b5b7ec140_b.jpg,# regions: {# 0: {# region_attributes: {},# shape_attributes: {# all_points_x: [...],# all_points_y: [...],# name: polygon}},# ... more regions ...# },# size: 100202# }2)修改E:\gitHubProjects\Mask_RCNN-master\Mask_RCNN-master\samples\balloon\balloon.py代码将
if args.weights.lower() coco:# Exclude the last layers because they require a matching# number of classes,coco数据集含有80个类但是对于通常来说只有前景和背景两类因此#需要将if。。coco给注释掉model.load_weights(weights_path, by_nameTrue, exclude[mrcnn_class_logits, mrcnn_bbox_fc,mrcnn_bbox, mrcnn_mask])else:model.load_weights(weights_path, by_nameTrue)
改成
model.load_weights(weights_path, by_nameTrue, exclude[mrcnn_class_logits, mrcnn_bbox_fc,mrcnn_bbox, mrcnn_mask])3)利用balloon.py修改后的进行训练注意需要修改的地方
class BalloonConfig(Config):Configuration for training on the toy dataset.Derives from the base Config class and overrides some values.# Give the configuration a recognizable nameNAME balloonDataset# We use a GPU with 12GB memory, which can fit two images.# Adjust down if you use a smaller GPU.IMAGES_PER_GPU 1 # 每个GPU同时训练的图片数如果是CPU建议修改为1# Number of classes (including background)# 类别数一般是你自己数据物体的类别数11是背景coco默认的是801类NUM_CLASSES 1 1 # Background balloonDataset# Number of training steps per epoch # 每一个迭代循环的步长数STEPS_PER_EPOCH 100# Skip detections with 90% confidence 置信度小于这个则跳过检测提高检测效率DETECTION_MIN_CONFIDENCE 0.9
除了上面的还可以修改训练好的模型存放的位置一般存放在E:\gitHubProjects\Mask_RCNN-master\Mask_RCNN-master\logs4) 利用命令行进行训练具体命令见见“E:\gitHubProjects\Mask_RCNN-master\Mask_RCNN-master\samples\balloon\README.md”
python3 balloon.py train --datasetdataset_path --weightsweughts_path2、测试
1)修改E:\gitHubProjects\Mask_RCNN-master\Mask_RCNN-master\samples\coco\coco.py代码
将
NUM_CLASSES 180
改成:
NUM_CLASSES 11(背景目标)————根据自己的类别数进行修改
1)修改E:\gitHubProjects\Mask_RCNN-master\Mask_RCNN-master\samples\demo.py代码
修改MODEL_DIR、COCO_MODEL_PATH训练好的模型、IMAGE_DIR测试集图片、class_names类别名称[BG,,,...] github项目链接
https://github.com/1371174718/Mask_RCNN_master