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

fix yolo precision issue(#36365)

上级 31a5829a
......@@ -119,10 +119,10 @@ __device__ inline void GetYoloBox(float* box, const T* x, const int* anchors,
int img_height, int img_width, float scale,
float bias) {
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);
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);
box[2] = static_cast<float>(expf(static_cast<float>(x[index + 2 * stride])) *
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.
先完成此消息的编辑!
想要评论请 注册