DrSleep / tensorflow-deeplab-resnet

DeepLab-ResNet rebuilt in TensorFlow
MIT License
1.25k stars 429 forks source link

why is the ignore_label needed here #102

Closed zkk0911 closed 7 years ago

zkk0911 commented 7 years ago

Hello: I am new here,I have a stupid question , why is the ignore_label needed here ? In the code file ‘’image_reader.py’, it seems do nothing


label = label - ignore_label # Needs to be subtracted and later added due to 0 padding. label_crop = label_crop + ignore_label

DrSleep commented 7 years ago

you cited the answer yourself # Needs to be subtracted and later added due to 0 padding.

When you do crop, 0 padding can be added if the crop size is bigger than the image given. Without subtracting ignore_label beforehand, you won't be able to differentiate between zeros (background class) and zeros (padding).