Open collinmccarthy opened 7 months ago
I spent some more time on this and determined this script to generate trainId images is not pixel-level accurate either, as described in #136. I instead wrote my own script to input the _instanceIds.png
images and directly create _instanceTrainIds.png
images using numpy and the label mappings in helpers/label.py.
I'll keep this brief. Based on the semantics of
json2labelImg.py
, thejson2instanceImg.py
has a typo which will lead to labeling "caravan" and "trailer" as instance classes instead of void, when using"trainIds"
encoding, for some images.In https://github.com/mcordts/cityscapesScripts/blob/master/cityscapesscripts/preparation/json2instanceImg.py#L141-L143:
should be as follows, were we use
labelTuple.trainId
instead ofid
when comparing to 255.If someone doesn't want to fix the code, one "solution" would be to just not use train IDs, but use original label IDs which don't have this issue, and then use the mapping in cityscapesscripts when loading in the data. Also I'm not entirely sure this matters if one is ignoring these classes when loading in the data. But depending on how the data is used, it could lead to issues.