dbolya / yolact

A simple, fully convolutional model for real-time instance segmentation.
MIT License
5k stars 1.33k forks source link

How to fix strange overlapping, disjointed masks predicted? #555

Open davodogster opened 3 years ago

davodogster commented 3 years ago

How can I fix this strange thing the model is doing, overlapping DISJOINTED predictions shown in red. EDIT: After reading the paper again I see that this is a common problem with Yolact - discussed in the 'Leakage' section of the paper.

image

I'm training with RLE, iscrowd = 0 because iscrowd = 1 doesn't train.

Regards, Sam

areebsyed commented 3 years ago

I think you have to do a post processing like doing something like detecting the contours of masks and then putting a condition that the two masks dont overlap! I want to do it too but will do it later. Let me know if you find some code solution

davodogster commented 3 years ago

Hi @areebsyed Haven't found a code solution yet sorry. Have you?

amaanda commented 3 years ago

Are using --no_crop = True?

https://github.com/dbolya/yolact/blob/1d3f7bb94f48dff6324b22483161374c35567306/eval.py#L96

areebsyed commented 3 years ago

Hi @areebsyed Haven't found a code solution yet sorry. Have you?

@davodogster no :/

mmiisskk commented 3 years ago

I would like to ask: How big is your dataset and how long it takes, to get this results?

I usually train 12 hours and get just one detection in whole photo where is many same things as in yours. But you get really nice result. Thanks.

davodogster commented 3 years ago

Are using --no_crop = True?

https://github.com/dbolya/yolact/blob/1d3f7bb94f48dff6324b22483161374c35567306/eval.py#L96

No I never knew about that! what does it do ?

davodogster commented 3 years ago

@mmiisskk Hi Misky, How many classes do you have and how big (how may pixel width) are the objects after they are resized?

YOLACT pretrained with data augmentation img_size 1000 (default settings I think) is very powerful. I just trained this on 40 images, val on 8. That is a testing image.

mmiisskk commented 3 years ago

@davodogster Hi, thanks for reply. My train dataset has 26 images and val dataset 10 images. Size of these images is 880x700 px. (objects size is 78x82 px) After resize to 550x550 px for training/val set, objects size is 47x66 px.

amaanda commented 3 years ago

@davodogster it cutts off the parts of the masks that are not within the bounding box. Default is False, maybe you can test setting it True

parser.add_argument('--no_crop', default=False, dest='crop', action='store_false',
                        help='Do not crop output masks with the predicted bounding box.')
davodogster commented 3 years ago

@amaanda when I run eval.py with that flag --no_crop=True it says --no_crop: ignored explicit argument 'True'.

EDIT - it works when you just run it with --no_crop

PrajwalCogniac commented 3 weeks ago

Hey @davodogster @mmiisskk Did you find any solution to this problem ?