mseg-dataset / mseg-semantic

An Official Repo of CVPR '20 "MSeg: A Composite Dataset for Multi-Domain Segmentation"
MIT License
460 stars 78 forks source link

Transform the labels to the labels on Cityscapes #32

Closed csBob123 closed 3 years ago

csBob123 commented 3 years ago

Hi, Thank you for your wonderful work. Could I know how to map the predicted label iD to the ID on cityscapes? Do you have any code/dictionary to achieve this?

Thank you for your help.

johnwlambert commented 3 years ago

Hi, thanks for your interest in our work.

There are two Cityscape taxonomies (cityscapes-19 and cityscapes-34), although cityscapes-19 is more commonly used for evaluation. The classes in these taxonomies are enumerated in mseg-api here and here

We have released both unified models (trained on many datasets, list available here) and models trained on single datasets, listed here.

If you use a unified model for testing, our code maps class scores from the unified taxonomy to cityscapes classes. We discuss this in a section of our paper (page 6, top-right under Using the MSeg taxonomy on a held-out dataset). The mapping is available in MSeg_master.tsv, if you compare the universal and wilddash-19 columns (wilddash-19 shares the same classes with cityscapes-19)

If instead you used a model specifically trained on cityscapes, e.g. cityscapes-19-1m, which we call an "oracle model" since it is trained and tested on different splits of the same dataset, then the output classes are already immediately in the desired taxonomy.

Our inference code that dumps model results in any particular taxonomy is available here: https://github.com/mseg-dataset/mseg-semantic/blob/master/mseg_semantic/scripts/eval_models.sh

johnwlambert commented 3 years ago

@csBob123 I'm going to go ahead and close this since I haven't heard back from you and I believe I answered your questions. If not, please feel free to re-open.