Bboxes and Masks have different sizes #1270
-
Hi,
the bboxes have a different size as the masks i get. For example:
returns
Any ideas why this could happen? |
Beta Was this translation helpful? Give feedback.
Replies: 3 comments 5 replies
-
What is this |
Beta Was this translation helpful? Give feedback.
-
I think Refer to , you can find the following codes to get the bbox [x0, y0, x1, y1] of a mask. auto x0 = std::max(std::floor(bbox[0]) - 1, 0.f);
auto y0 = std::max(std::floor(bbox[1]) - 1, 0.f);
auto x1 = std::min(std::ceil(bbox[2]) + 1, (float)img_w);
auto y1 = std::min(std::ceil(bbox[3]) + 1, (float)img_h);
auto width = static_cast<int>(x1 - x0);
auto height = static_cast<int>(y1 - y0); @lzhangzz can it be guaranteed that |
Beta Was this translation helpful? Give feedback.
I think
boxes = boxes_and_scores[:,:-1].astype(np.int32)
is not precisely in your code.Refer to
mmdeploy/csrc/mmdeploy/codebase/mmdet/instance_segmentation.cpp
Line 74 in de96f51
@lzhangzz can it be guaran…