Deep/Sharp Mask or Mask R-CNN

Greetings and apologies if this is just a lazy question, but has anyone implemented either of the FAIR deep/sharp mask or the more recent r-cnn papers? Thanks, really enjoying learning about pytorch.


From what I know, there are no public implementations of these papers in pytorch yet.


sounds like a challenge for my infinite spare time :slight_smile:

i’m also thinking of hacking up MaskRCNN (but not deepmask / sharpmask). Maybe we could work off a common repo.


I would love that. Not sure if I’m qualified to help but it would be a good learning experience.

1 Like

I would be interested, too. Although from the looks of it, it won’t be a trivial project. It will be great to implement the instance segmentation component. I haven’t found that piece in any of the existing implementations of fast/faster RCNN. Everyone seems to stop at object detection.

Also the pytorch ecosystem for segmentation is a bit small, so this could be a big win for pytorch getting a state of the art segmentation model into the model zoo.


@bfortuner @smth Are we going ahead with development of maskRCNN …I am interested…

1 Like

did anyone start this? I tried getting either of these 2 work, but they dont work:

I would love to be able to do this in pytorch.

@deepcode I haven’t tried myself but what is the problem with these implementations? why dont they work?

Any update on Pytorch implementation of Mask RCNN ?

Commenting for updates

I’m currently trying to implement Deepmask with Pytorch but I’m struggling with some of the modifications which are done on the preloaded ResNet for the trunk (

All of the batchNormalization layers are changed in some way I don’t understand. The function’s called “BNtoFixed” which is imported from imagine-nn utils (
Unfortunately, the Pytorch version of imagine-nn is quite small in comparison and does not provide something similar. Also couldn’t find a reference in the Deepmask/Sharpmask papers.

Maybe someone can give me a hint on what this modification is for and how it works or a paper which descripes it.

Thanks in advance

Commenting for updates. Did anyone try this?

I’m trying to implement Deepmask with Pytorch, so far I have defined the Joint Loss Function, and the model’s learn-able parameters.

I was working on the training phase, and as the paper says that training must be done in an alternative back-propagation fashion across the two branches, I have written the code for the same. But there is some problem with training, I tried to train the model with a Fake Dataset, for minibatches other than the first mini-batch the loss of the model is turning out to be NAN.

Can somebody help me with this?

Here is the link to current version of code :