GeorgeSeif / Semantic-Segmentation-Suite

Semantic Segmentation Suite in TensorFlow. Implement, train, and test new Semantic Segmentation models easily!
2.51k stars 878 forks source link

Ignoring classes in the class_dict.csv #172

Closed k22jung closed 5 years ago

k22jung commented 5 years ago

Describe the problem

Describe the problem clearly here. Be sure to convey here why it's a bug or a feature request.

I am trying to train on the mapillary dataset. There are a total of 67 classes each with their respective color. However, I am only interested in training on 3/67 classes out of the bunch. How should I go about pre-processing the labels and/or handling multiple unlabelled classes in the CSV? There are multiple colored labels in the data I will not need for training, so I wasn't sure how the program would process the class_dict.csv.

MarcSchotman commented 5 years ago

Maybe there is a better solution but you could simply do this: Convert all pixels of classes in which your not interested in [0,0,0] and make this the void/background class. So you would end up with 4 classes in the dataset and in the class_dict.csv.

I didn't see any straightforward implementation of ignoring classes or something like this.

k22jung commented 5 years ago

Thank you for the input, what you mentioned worked for me. I wrote a Numpy script to take each label and replace the colors associated with unnecessary classes to be black and any other classes to be left alone. This is the CSV class dict I used that had only the classes I wanted:


name | r | g | b
Void | 0 | 0 | 0
road-marking-crosswalk | 200 | 128 | 128
road-marking-general | 63 | 234 | 86
Road | 128 | 64 | 128

I will now close this issue.