mrlooi / rotated_maskrcnn

Rotated Mask R-CNN: From Bounding Boxes to Rotated Bounding Boxes
MIT License
347 stars 62 forks source link

How to load files in (x,y,w,h,angle) format cocoDatasets? #6

Closed LUCKMOONLIGHT closed 4 years ago

LUCKMOONLIGHT commented 4 years ago

❓ Questions and Help

I don't quite understand your rotated data loading module.Can you explain how to load rotated datasets and Design principle for angle ?

LUCKMOONLIGHT commented 4 years ago

@mrlooi

mrlooi commented 4 years ago

The module takes a polygon input (COCO format: x,y,x,y) and outputs the rotated rectangle using the minAreaRect function in OpenCV. This function outputs: xcenter, ycenter, w, h, angle

See https://docs.opencv.org/2.4/modules/imgproc/doc/structural_analysis_and_shape_descriptors.html?highlight=minarearect

LUCKMOONLIGHT commented 4 years ago

Thank you for your reply and great work. i have some question: 1.when calculation bbox_head reg_loss. roi_heads.box.predictor.bbox_pred format (xcenter, ycenter, w, h, angle ), but groundTrue format (COCO format: x,y,x,y). is there a convert from horizontal to rotated?

mrlooi commented 4 years ago

In the rotated config, the bbox regression loss is the difference between predicted rotated box and gt rotated box (gt rotated box is generated from the mask polygons, the horizontal bbox is not used at all)

Btw, A horizontal bbox is the same as a rotated box when angle=0