TillBeemelmanns / cityscapes-to-coco-conversion

Cityscapes to CoCo Format Conversion Tool for Mask-RCNN and Detectron
83 stars 14 forks source link

Warning: invalid contours #3

Closed JunsukLee closed 2 years ago

JunsukLee commented 2 years ago

This project works. But I'm curious what the following message means. Could you tell me, please? "Warning: invalid contours."

tarun005 commented 2 years ago

Same here. Did you figure out what this means? Does the json file have all the instances or are some skipped?

YangYangGirl commented 2 years ago

Same here. Did you figure out what this means? Does the json file have all the instances or are some skipped?

DishantMewada commented 2 years ago

If you check the main.py, you will find some contours are skipped if it is empty or if the size is very small.

for obj in objects[object_cls]:
    if obj['contours'] == []:
    print('Warning: empty contours.')
    continue  # skip non-instance categories
len_p = [len(p) for p in obj['contours']]
    if min(len_p) <= 4:
    print('Warning: invalid contours.')
    continue  # skip non-instance categories

so for classes like 'traffic light' or 'traffic sign' since len_p is very small it will be skipped. just comment out the last three lines in the code snippets and it will work.

TillBeemelmanns commented 2 years ago

Yes. This part filters out too small instances. Either change the threshold 4 to a lower number or comment out these lines. You will need to check manually if these small instances make sense for your use case.