[Decoder] integ division accepted/tizen/unified/20220426.132012 submit/tizen/20220425.043951 submit/tizen/20220426.050006
authorJaeyun <jy1210.jung@samsung.com>
Fri, 22 Apr 2022 09:29:40 +0000 (18:29 +0900)
committerjaeyun-jung <39614140+jaeyun-jung@users.noreply.github.com>
Mon, 25 Apr 2022 02:10:32 +0000 (11:10 +0900)
Convert float value to get the object.

Signed-off-by: Jaeyun <jy1210.jung@samsung.com>
ext/nnstreamer/tensor_decoder/tensordec-boundingbox.c

index 5a4cf0e..64d5fe3 100644 (file)
@@ -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_; \