From 1ba42ac7c997f1be16c3b6156f465a23d179a718 Mon Sep 17 00:00:00 2001 From: Jaeyun Date: Fri, 22 Apr 2022 18:29:40 +0900 Subject: [PATCH] [Decoder] integ division Convert float value to get the object. Signed-off-by: Jaeyun --- ext/nnstreamer/tensor_decoder/tensordec-boundingbox.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/ext/nnstreamer/tensor_decoder/tensordec-boundingbox.c b/ext/nnstreamer/tensor_decoder/tensordec-boundingbox.c index 5a4cf0e..64d5fe3 100644 --- a/ext/nnstreamer/tensor_decoder/tensordec-boundingbox.c +++ b/ext/nnstreamer/tensor_decoder/tensordec-boundingbox.c @@ -1390,8 +1390,8 @@ nms (GArray * results, gfloat threshold) size_t boxbpi_ = config->info.info[0].dimension[0]; \ results = g_array_sized_new (FALSE, TRUE, sizeof (detectedObject), num_); \ for (d_ = 0; d_ < num_; d_++) { \ - _type y_center, x_center, h, w; \ - _type ymin, xmin; \ + gfloat y_center, x_center, h, w; \ + gfloat ymin, xmin; \ int y, x, width, height; \ detectedObject object; \ gfloat score = (gfloat)scores_[d_]; \ @@ -1402,10 +1402,10 @@ nms (GArray * results, gfloat threshold) score = 1.0f / (1.0f + exp (-score)); \ if (score < data->min_score_threshold) \ continue; \ - y_center = box[0] / i_height_ * a->h + a->y_center; \ - x_center = box[1] / i_width_ * a->w + a->x_center; \ - h = box[2] / i_height_ * a->h; \ - w = box[3] / i_width_ * a->w; \ + y_center = (box[0] * 1.f) / i_height_ * a->h + a->y_center; \ + x_center = (box[1] * 1.f) / i_width_ * a->w + a->x_center; \ + h = (box[2] * 1.f) / i_height_ * a->h; \ + w = (box[3] * 1.f) / i_width_ * a->w; \ ymin = y_center - h / 2.f; \ xmin = x_center - w / 2.f; \ y = ymin * i_height_; \ -- 2.7.4