这次我们来解析keras版Faster R-CNN,在之前解析的版本中代码晦涩难读。这次带来一个简单易懂的Faster R-CNN版本的解读,来帮助大家了解Faster R-CNN的细节内容。
先上源代码:https://github.com/nnresearcher/keras_frcnn(代码是我fork的,不是本人写的)。
首先看最开始的代码(地址keras_frcnn/train_frcnn_kitti.py):
def train_kitti():
# config for data argument
cfg = config.Config()
cfg.use_horizontal_flips = True
cfg.use_vertical_flips = True
cfg.rot_90 = True
cfg.num_rois = 32
cfg.base_net_weights = os.path.join('./model/', nn.get_weight_path())
# TODO: the only file should to be change for other data to train
cfg.model_path = './model/kitti_frcnn_last.hdf5'
cfg.simple_label_file = 'kitti_simple_label.txt'
......
这段代码主要的就是cfg,Config是一个预先定义好的类,作者将许多可调参数都保存在这个类中,通过修改这个类中的参数可以方便修改整个网络的参数。
在后续