wkentaro / labelme

Image Polygonal Annotation with Python (polygon, rectangle, circle, line, point and image-level flag annotation).
https://labelme.io
Other
13.54k stars 3.41k forks source link

[BUG] Pascal Voc conversion - white outlining #728

Closed crouchjt closed 3 years ago

crouchjt commented 4 years ago

Describe the bug The pascal voc conversion for image segmentation doesn't use the white outlining that the pascal voc dataset uses.

To Reproduce Steps to reproduce the behavior:

  1. follow example here: https://github.com/wkentaro/labelme/tree/master/examples/instance_segmentation

Expected behavior An output that matches the pascal voc data set. Here is an example from the data set itself: 2007_000129

However, the output doesn't have the same white outlining: image

Desktop (please complete the following information):

Additional context Everything else about instance segmentation seems good!

wkentaro commented 4 years ago

Probably we could add this. White outlining is ignore label where you don't penalize the segmentation in semantic segmentation. But in COCO, they don't have this kind of trick, do you think it's really necessary for instance segmentation as well?

crouchjt commented 4 years ago

https://github.com/wkentaro/labelme/tree/master/examples/instance_segmentation has a section called "Convert to VOC-format Dataset". If you truly want to support that case then I believe it is necessary to match with the rest of the VOC dataset.

wkentaro commented 4 years ago

I added VOC conversion since I needed, not wanted. And border ignore label was not necessary for me. I don't really mind if it doesn't exactly match to the original VOC dataset.

crouchjt commented 4 years ago

Ah, so here's where I'm at:

I'm trying to extend a deeplab model that's originally been trained on the Pascal dataset with 20 classes. I'm seeing if I can add more classes into it so I used your tool to markup a new class and added it into the dataset. I noticed the difference between what this tool produced and the actual dataset and assumed it would be a problem when I had the model train over my new images. Should i be able to train on these images without the ignore border label? I'm thinking the answer is no because one of the steps removes all color from the image and saves it as a "SegementationClassRaw" as shown here: 2007_000129

My understanding is still a little weak of all this so I'm not sure exactly how this image is used in training.

plter commented 3 years ago

I created a simple tool for generating png with borders https://github.com/plter/labelme2voc and it works in my project.

annish07 commented 8 months ago

@wkentaro All because there is no white-lining from the output of script "labelme2voc.py" , When we use remove_gt_colormap.py from Tensorflow to remove background, it generates whole black image and model assumes that whole image is background.

Can you please let me know how can we modify labelme2voc.py script in order to have whitelines in border as output.

@plter Your suggestions would also help.