未验证 提交 c12176e8 编写于 作者: W wenbin 提交者: GitHub

fix yolo (#36240)

上级 56b04bc1
...@@ -119,10 +119,10 @@ __device__ inline void GetYoloBox(float* box, const T* x, const int* anchors, ...@@ -119,10 +119,10 @@ __device__ inline void GetYoloBox(float* box, const T* x, const int* anchors,
int img_height, int img_width, float scale, int img_height, int img_width, float scale,
float bias) { float bias) {
box[0] = static_cast<float>( box[0] = static_cast<float>(
(i + sigmoid(static_cast<float>(x[index]) * scale + bias)) * img_width / (i + sigmoid(static_cast<float>(x[index])) * scale + bias) * img_width /
grid_size_w); grid_size_w);
box[1] = static_cast<float>( box[1] = static_cast<float>(
(j + sigmoid(static_cast<float>(x[index + stride]) * scale + bias)) * (j + sigmoid(static_cast<float>(x[index + stride])) * scale + bias) *
img_height / grid_size_h); img_height / grid_size_h);
box[2] = static_cast<float>(expf(static_cast<float>(x[index + 2 * stride])) * box[2] = static_cast<float>(expf(static_cast<float>(x[index + 2 * stride])) *
anchors[2 * an_idx] * img_width / input_size_w); anchors[2 * an_idx] * img_width / input_size_w);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册