| 133 | } |
| 134 | |
| 135 | void bbox_tranform_inv(float* m_box, float* local_anchors, int height, int width, int channel, int num_anchors) |
| 136 | { |
| 137 | int step = height * width; |
| 138 | float* a = m_box; |
| 139 | float* b = local_anchors; |
| 140 | int c_4 = channel / 4; |
| 141 | for(int i = 0; i < c_4; ++i) |
| 142 | { |
| 143 | _axpy_(2 * step, b + (i * 4 + 0) * step, b + (i * 4 + 2) * step); |
| 144 | _add_one(2 * step, b + (i * 4 + 2) * step); |
| 145 | _axpy_half(2 * step, b + (i * 4 + 2) * step, b + (i * 4 + 0) * step); |
| 146 | |
| 147 | _mul(2 * step, b + (i * 4 + 2) * step, a + (i * 4 + 0) * step, a + (i * 4 + 0) * step); |
| 148 | _add(2 * step, b + (i * 4 + 0) * step, a + (i * 4 + 0) * step, a + (i * 4 + 0) * step); |
| 149 | |
| 150 | _exp(2 * step, a + (i * 4 + 2) * step, a + (i * 4 + 2) * step); |
| 151 | _mul(2 * step, b + (i * 4 + 2) * step, a + (i * 4 + 2) * step, a + (i * 4 + 2) * step); |
| 152 | } |
| 153 | } |
| 154 | |
| 155 | void filter_boxs(std::vector<SBox>& boxes, float* box, float* score, int min_size, int src_scale, int src_w, int src_h, |
| 156 | int feat_w, int feat_h, int num_anchors, int feat_c) |