Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Wrong size of mask in RTMDet-Ins post-processing #11230

Open
flytocc opened this issue Nov 30, 2023 · 1 comment
Open

Wrong size of mask in RTMDet-Ins post-processing #11230

flytocc opened this issue Nov 30, 2023 · 1 comment
Assignees

Comments

@flytocc
Copy link

flytocc commented Nov 30, 2023

Thanks for your error report and we appreciate it a lot.

Checklist

  1. I have searched related issues but cannot get the expected help.
  2. I have read the FAQ documentation but cannot get the expected help.
  3. The bug has not been fixed in the latest version.

Describe the bug
In _bbox_mask_post_process function, when the argument rescale is True, the mask_logits will be interpolated to the original image size, but the width and height in scale_factor are reversed when calculating the original image size. If keep_ratio in Resize tranform is False, the width and height scale factor in scale_factor is difference, and it will make mask size wrong.

if rescale:
ori_h, ori_w = img_meta['ori_shape'][:2]
mask_logits = F.interpolate(
mask_logits,
size=[
math.ceil(mask_logits.shape[-2] * scale_factor[0]),
math.ceil(mask_logits.shape[-1] * scale_factor[1])
],
mode='bilinear',
align_corners=False)[..., :ori_h, :ori_w]

Reproduction

  1. What command or script did you run?
python tools/test.py configs/rtmdet/rtmdet-ins_tiny_8xb32-300e_coco.py \
    https://download.openmmlab.com/mmdetection/v3.0/rtmdet/rtmdet-ins_tiny_8xb32-300e_coco/rtmdet-ins_tiny_8xb32-300e_coco_20221130_151727-ec670f7e.pth \
    --cfg-options test_dataloader.dataset.pipeline.1.keep_ratio=False
  1. Did you make any modifications on the code or config? Did you understand what you have modified?

There are no modifications on the code or config.

  1. What dataset did you use?

coco

Environment

not important

Error traceback
If applicable, paste the error trackback here.

none

Bug fix
If you have already identified the reason, you can provide the information here. If you are willing to create a PR to fix it, please also leave a comment here and that would be much appreciated!

#11231

@flytocc flytocc changed the title Wrong size of mask in remdet-ins post-processing Wrong size of mask in RTMDet-Ins post-processing Nov 30, 2023
@flytocc
Copy link
Author

flytocc commented Dec 21, 2023

@RangiLyu Hi, can you take a look at this issue, the same error is fixed in mmdeploy open-mmlab/mmdeploy#2581

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants