代码阅读:Faster RCNN

来源:互联网 发布:ubuntu创建新用户组 编辑:程序博客网 时间:2024/05/19 05:04

1.由图片生产imdb

2.由imdb和其他信息产生roidb

 voc_rec = PASreadrecord(sprintf(VOCopts.annopath, imdb.image_ids{i*2-1}));

准备完毕

3.生成网络

model = Faster_RCNN_Train.set_cache_folder(cache_base_proposal, cache_base_fast_rcnn, model);

4.准备anchor

 conf如下:

function [anchors, output_width_map, output_height_map] = proposal_prepare_anchors(conf, cache_name, test_net_def_file)  [output_width_map, output_height_map] ...  = proposal_calc_output_size(conf, test_net_def_file);  anchors = proposal_generate_anchors(cache_name, ...  'scales', 2.^[3:5]);end


function [output_width_map, output_height_map] = proposal_calc_output_size(conf, test_net_def_file)返回 output_width_map 和  output_height_map 为:output_width_map = containers.Map(input, output_w);output_height_map = containers.Map(input, output_h);#input和output_w的对应关系#input:从100到1000output_width_map:#从7到63[cls_score = caffe_net.blobs('proposal_cls_score').get_data(); ]

5.anchor的产生

ip.addParamValue('base_size', 16, @isscalar);#16x16=256 这是基础大小w = anchor(3) - anchor(1) + 1;h = anchor(4) - anchor(2) + 1;x_ctr = anchor(1) + (w - 1) / 2;y_ctr = anchor(2) + (h - 1) / 2;size = w * h;ws = round(sqrt(size_ratios));hs = round(ws .* ratios);#ws = 23 16 11#hs = 12 16 22#这是找中心

3个ratio的

9个anchor完毕

5.1 RPN stage1

conf:  batch_size: 256  bg_thresh_hi: 0.3000  bg_thresh_lo: 0  bg_weight: 1  drop_boxes_runoff_image: 1  feat_stride: 16  fg_fraction: 0.5000  fg_thresh: 0.7000  image_means: [1x1x3 single]  ims_per_batch: 1  max_size: 1000  rng_seed: 6  scales: 600  target_only_gt: 1  test_binary: 0  test_drop_boxes_runoff_image: 0  test_max_size: 1000  test_min_box_size: 16  test_nms: 0.3000  test_scales: 600  use_flipped: 1  use_gpu: 1  anchors: [9x4 double]  output_width_map: [901x1 containers.Map]  output_height_map: [901x1 containers.Map]

在VOC中长这样,每个框对里面的物品给个概率

proposal_prepare_image_roidb 

5.2  one iter SGD update

迭代训练开始

0 0