Imported from https://github.com/FlashTek/mask-rcnn-edge-agreement-loss