-
Notifications
You must be signed in to change notification settings - Fork 9.8k
Description
Describe the bug
rtmdet_ins_head.py mask resize error while doing the upsampling process (features mask to the target mask). the ori mask size is (512, 112), and I add Resize, where the scale is (256, 256), but the output become (112, 112). All mask size describe above is in (H, W) format.
Reproduction
use rtmdet for the instance segmentation task, and use the ori image in different size in H and W. during training and testing, add resize, where the scale for H and W is the same
Environment
mdurl 0.1.2
mmcv 2.0.0
mmdet 3.0.0
mmengine 0.7.2
mpmath 1.3.0
pillow 10.4.0
opencv-python 4.10.0.84
Bug fix
I think the problem comes from the rtmdet_ins_head.py in line 500:
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]
the scale_factor is in (W, H) format, but mask_logits and the input param size in F.interpolate are in (H, W) format. change the scale_factor from
to
the problem solves