datumaro icon indicating copy to clipboard operation
datumaro copied to clipboard

converting voc->coco for segmentation task

Open jihyeonyi opened this issue 3 years ago • 5 comments

I've converted the voc data to coco format for segmentation task and tried to train OTE instance segmentation models with the data.

voc.export(out_path, "coco", save_images=True, reindex=True)

However, OTE training didn't proceed anymore after outputting this log.

2021-04-28 17:09:50,822 - mmdet - INFO - workflow: [('train', 1)], max: 12 epochs

OTE can process the original coco data, which consists of mostly polygons. In contrast, the converted data consists of RLE masks. So, I've converted VOC masks to polygons before exporting them to coco format.

converted = Dataset(MasksToPolygons(voc))
converted.export(out_path, "coco", save_images=True, reindex=True)

Finally, OTE training can be done.

I'm not sure that OTE has a problem with handling RLE masks, or datumaro can't generate proper RLE masks. So I report this.

jihyeonyi avatar Apr 29 '21 02:04 jihyeonyi

For your information, the OTE model I've tried is efficientnet_b2b-mask_rcnn-480x480 at https://github.com/openvinotoolkit/training_extensions/tree/develop/models/instance_segmentation/model_templates/custom-instance-segmentation

jihyeonyi avatar Apr 29 '21 02:04 jihyeonyi

@druzhkov-paul, does OTE support RLE masks?

zhiltsov-max avatar Apr 29 '21 10:04 zhiltsov-max

AFAIK, it has a limited support of RLE masks, which may be incomplete when masks as they are represented in annotation are not converted to binary masks at a pre-processing stage. This is exactly the case with model's config referenced above: see here.

druzhkov-paul avatar Apr 29 '21 12:04 druzhkov-paul

Thank you @druzhkov-paul As I understand, it could be solved if I use or implement the correct annotation loader. Is it correct?

jihyeonyi avatar Apr 29 '21 12:04 jihyeonyi

Correct. I'd say, the easiest thing to try is to set poly2mask=True in the config file. If this does not resolve the issue, then changes in the code of pre-processing pipeline are required.

Maybe @DmitriySidnev, who's developed the aforementioned model is more knowledgeable about possible solutions or workarounds.

druzhkov-paul avatar Apr 29 '21 12:04 druzhkov-paul