出于在csdn上面学到很多东西这里也帮自己的一些收获和大家分享一下
直奔主题~~
前提是已经安装好caffe的环境 本文是在Ubuntu 15.04下做的测试 $Faster_rcnn表示py-faster-rcnn根目录
1. 修改数据接口 ($Faster_rcnn/lib/datasets)
目录下面的pascal_voc.py是主要的数据读取接口
- self._classes = ('__background__', # always index 0
'bottle', 'bus', 'car', 'cat', 'chair',
'cow', 'diningtable', 'dog', 'horse',
'motorbike', 'person', 'pottedplant',
'sheep', 'sofa', 'train', 'tvmonitor')
这里定义了要训练的类别,修改这里为自己需要训练数据的类标签,注意总类别包括背景
- 如果需要使用PASCAL数据库中的个别类 需要在
if not self.config['use_diff']:
# Exclude the samples labeled as difficult
non_diff_objs = [
obj for obj in objs if int(obj.find('difficult').text) == 0]
# if len(non_diff_objs) != l