mxnet-ssd
mxnet-ssd copied to clipboard
about priorbox
inline void MultiBoxPriorForward(const Tensor<cpu, 2, DType> &out,
const std::vector
for (int r = 0; r < in_height; ++r) { float center_y = (r + offsets[0]) * step_y; for (int c = 0; c < in_width; ++c) { float center_x = (c + offsets[1]) * step_x; // ratio = 1, various sizes for (int i = 0; i < num_sizes; ++i) { float size = sizes[i]; float w = size / 2; float h = size / 2; out[count][0] = center_x - w; // xmin out[count][1] = center_y - h; // ymin out[count][2] = center_x + w; // xmax out[count][3] = center_y + h; // ymax ++count; } // various ratios, size = min_size = size[0] float size = sizes[0]; for (int j = 1; j < num_ratios; ++j) { float ratio = sqrtf(ratios[j]); float w = size * ratio / 2; float h = size / ratio / 2; out[count][0] = center_x - w; // xmin out[count][1] = center_y - h; // ymin out[count][2] = center_x + w; // xmax out[count][3] = center_y + h; // ymax ++count; } } } }
code is intend to compute priorbox,I have one questions about this 1:the anchor number is num_sizes - 1 + num_ratios, different from caffe-ssd, why? @zhreshold
"Different from caffe-ssd"??
@zhreshold i want to detect the small objects. The default boxes detect min-size in caffe is 30. how to modify the sizes of priorBox in your code ?
@315386775 It's basically the same, just use smaller relative size