Closed alecGraves closed 5 years ago
@jbovee will you be able to check the issue?
I'm pretty sure the issue is a result of how shapes are saved in the COCO format. Since the shape type (rect, polygon, circle) is not saved, a rectangle and a polygon with the exact same points and with the polygon points created in clockwise order are indistinguishable. I'll try taking a closer look to see if there's any way around it.
Thanks for your attention.
On Wed, 7 Nov 2018 09:57 jbovee, notifications@github.com wrote:
I'm pretty sure the issue is a result of how shapes are saved in the COCO format. Since the shape type (rect, polygon, circle) is not saved, a rectangle and a polygon with the exact same points and with the polygon points created in clockwise order are indistinguishable. I'll try taking a closer look to see if there's any way around it.
— You are receiving this because you commented. Reply to this email directly, view it on GitHub https://github.com/NaturalIntelligence/imglab/issues/136#issuecomment-436501009, or mute the thread https://github.com/notifications/unsubscribe-auth/AHVgKAL8u3RIMmv9lQ71jqa9wNNxPUzRks5usmEvgaJpZM4YRsTH .
@jbovee I believe you wanted to check if the saved shape is rectangle then don't create polygon. What's about this condition;
} else if (segLength !== 8 || (segmentation[2] - segmentation[0]) !== (segmentation[4] - segmentation[6]) || (segmentation[3] - segmentation[1]) !== (segmentation[5] - segmentation[7]) ) {
//crete polygon
}
I've fixed this change. @alecGraves I hope you should not see the issue anymore. Feel free to reopen the issue if you still face it.
Describe the bug Stored type 'rect' shape objects are turned into type 'polygon' when imported from a .json with the coco.js dataformatter
To Reproduce
console.log(shape)
in the toCOCO loop in dataformatters/coco.jsconsole.log(labellingData[ image.file_name ].shapes[-1])
in the fromCOCO function in dataformatters/coco.jsExport then import some rectangle labels to/from a coco .json while watching console log
notice the change in shape.type from 'rect' to 'polygon'
Device detail (please complete the following information):
Additional context This did not impact saving and loading bbox data, which is the functionality I need. I have added this issue mostly to document the problem.
I think it may have something to do with this logic that tries to reconstruct different shapes.