What does the variance mean in the PriorBox of SSD?

290 views
Skip to first unread message

GENG YANG

unread,
Jul 26, 2017, 2:45:56 AM7/26/17
to Caffe Users
My question is as the title, and I find it strange that in the source code "prior_box_layer.cpp", the top_data containing the coordinates of default boxes is replaced by the values of variance. What does this part of code mean?


layer {
  name
: "conv9_2_mbox_priorbox"
  type
: "PriorBox"
  bottom
: "conv9_2"
  bottom
: "data"
  top
: "conv9_2_mbox_priorbox"
  prior_box_param
{
    min_size
: 264.0
    max_size
: 315.0
    aspect_ratio
: 2
    flip
: true
    clip
: false
    variance
: 0.1
    variance
: 0.1
    variance
: 0.2
    variance
: 0.2
 
}
}


// set the variance.
  top_data += top[0]->offset(0, 1);
  if (variance_.size() == 1) {
    caffe_set<Dtype>(dim, Dtype(variance_[0]), top_data);
  } else {
    int count = 0;
    for (int h = 0; h < layer_height; ++h) {
      for (int w = 0; w < layer_width; ++w) {
        for (int i = 0; i < num_priors_; ++i) {
          for (int j = 0; j < 4; ++j) {
            top_data[count] = variance_[j];
            ++count;
          }
        }
      }
    }
  }
}


Reply all
Reply to author
Forward
0 new messages