NVlabs / mask-auto-labeler

Other
160 stars 13 forks source link

Question regarding MIL loss #2

Closed WeiChihChern closed 1 year ago

WeiChihChern commented 1 year ago

In mask-auto-labeler/models/mal.py,

Line 420: # Multiple instance learning Loss loss_mil = self.mil_loss(student_seg_sigmoid, mask)

The mask in self.mil_loss(student_seg_sigmoid, mask) is from line 410, where mask = F.interpolate(x['mask'], size=(oh, ow), mode='bilinear', align_corners=False).reshape(-1, oh, ow)

I wonder does this mean we are not only using bbox but also ground truth masks during training? Thank you.

WeiChihChern commented 1 year ago

Is x['mask'] basically a tight bbox of 1s?

hongyeob-kim commented 1 year ago

@WeiChihChern

I'm not the author but If you check below lines in mask-auto-labeler/datasets/voc.py, x['mask'] is simply box shaped masking filled with 1. Is this what you are looking for?

https://github.com/NVlabs/mask-auto-labeler/blob/8427b66fe4f7dd7d230da9b0ee7073cd40d86436/datasets/voc.py#L95-L104

WeiChihChern commented 1 year ago

@hongyeob-kim Good find, thanks.

voidrank commented 1 year ago

Hi @WeiChihChern @hongyeob-kim ,

Thanks for asking and answering this question. It’s not a good idea to use mask for box-shaped mask. I will put this in the readme and maybe change the name in the future.

Best