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

fix gt_masks type in maskiou_head._get_area_ratio #1988

Closed
wants to merge 1 commit into from
Closed

fix gt_masks type in maskiou_head._get_area_ratio #1988

wants to merge 1 commit into from

Conversation

tyomj
Copy link
Contributor

@tyomj tyomj commented Jan 15, 2020

Current version throws an exception bellow:

File "/home/user/mmdetection/mmdet/models/mask_heads/maskiou_head.py", line 160, in _get_area_ratio gt_instance_mask_area = gt_masks.sum((-1, -2)) AttributeError: 'list' object has no attribute 'sum'

gt_masks is a list of masks, so the simplest fix is to convert them into np.array.

(I'm actually surprised that no one faced with this bug before ¯_(ツ)_/¯)

@tyomj tyomj requested a review from yhcao6 January 15, 2020 14:16
@yhcao6
Copy link
Collaborator

yhcao6 commented Jan 16, 2020

Currently the Pad transform will convert gt_mask into ndarray, you can look up this line

results[key] = np.stack(padded_masks, axis=0)

dict(type='Pad', size_divisor=32),

I tried to run this confighttps://github.com/open-mmlab/mmdetection/blob/master/configs/ms_rcnn/ms_rcnn_r50_caffe_fpn_1x.py with the latest mmdetection, but the program reported no error.

Have you modified something?

@tyomj
Copy link
Contributor Author

tyomj commented Jan 16, 2020

Yes, you are right. Thanks for your help.
I was just confused by the docstring:

https://github.com/open-mmlab/mmdetection/blob/master/mmdet/models/mask_heads/maskiou_head.py#L115-L116

The problem I faced comes when applying albu transformation after Pad like this:

dict(type='Pad', size_divisor=32),
dict(
type='Albu',

So I caught my own bug in this transform which has to be fixed.
I have checked the same pipeline for both mask-rcnn and ms-rcnn. Everything is ok now.

But I see failure during CI building stage, which is not likely to be connected with my small fix. Could you please help with that?

@hellock
Copy link
Member

hellock commented Jan 21, 2020

#1818

@tyomj
Copy link
Contributor Author

tyomj commented Jan 21, 2020

Thanks! Waiting #1818 to be merged.

@tyomj tyomj closed this Jan 21, 2020
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

Successfully merging this pull request may close these issues.

3 participants