matterport / Mask_RCNN

Mask R-CNN for object detection and instance segmentation on Keras and TensorFlow
Other
24.36k stars 11.65k forks source link

Rotating Anchor Boxes #2362

Open YashRunwal opened 3 years ago

YashRunwal commented 3 years ago

Hello fellow mask_rcnn users,

I am using Mask_RCNN to perform instance segmentation. An I am using labelme as a labelling tool.

From the implementations, I can see that the bounding boxes are all straight. Is there a way to change the class to accommodate the rotation of the bounding boxes? (Please see the figure below)

image

This is important because the objects I want to detect should have the rotated anchor boxes, so that I can later determine the orientation, whether it is left or right.

I would appreciate any help I can get.

Regards, Yash Runwal.

konstantin-frolov commented 3 years ago

Unfortunately, I do not see a quick solution to the problem.

YashRunwal commented 3 years ago

@konstantin-frolov , It's okay if it's not a quick solution. I am ready to work on this but I need to know where should I start, what changes I need to make etc.

konstantin-frolov commented 3 years ago

@konstantin-frolov , It's okay if it's not a quick solution. I am ready to work on this but I need to know where should I start, what changes I need to make etc.

You can try to create a coco dataset with your custom non-square bbox. Read about coco format. I'm using pycococreator to generate coco json file. But it creates a square bounding box from a binary mask. You can try rewriting the code to create your custom boxes. Then retrain MRCNN with your data. There may be errors with loss functions

kimile599 commented 3 years ago

Hi Yash, try this rotated mask r cnn which might help you https://github.com/mrlooi/rotated_maskrcnn