facebookresearch / maskrcnn-benchmark

Fast, modular reference implementation of Instance Segmentation and Object Detection algorithms in PyTorch.
MIT License
9.31k stars 2.49k forks source link

Is possible to output masks on some classes but bbox on others? #358

Closed chenzhutian closed 5 years ago

chenzhutian commented 5 years ago

❓ Questions and Help

Hi. Assume that I have two classes. For the class A, I will need to output its mask. But for class B, I only need its bbox. Is it possible to do that? How should I configure the model? Thanks!

fmassa commented 5 years ago

Mask R-CNN relies on the fact that we have instance masks attached to a bounding box. If you want to work on panoptic segmentation (which includes stuff and object classes), then you can find further information in https://github.com/facebookresearch/maskrcnn-benchmark/issues/337

chenzhutian commented 5 years ago

I mean I still need to detect each instance. For some instances (e.g., category A), I need their bbox + mask (just like what we usually do in mask rcnn); but for other instances (e.g., category B), I only need their bbox. So the loss of the mask should only consider the category A but the loss of bbox should consider both A and B.

fmassa commented 5 years ago

This should be possible, but will require changing a bit the implementation (for example by masking out the losses from category B).