isht7 / pytorch-deeplab-resnet

DeepLab resnet v2 model in pytorch
MIT License
602 stars 116 forks source link

Label Conversion, Training and inference #9

Closed MyVanitar closed 7 years ago

MyVanitar commented 7 years ago

Hello,

1) The original VOC PNG labels are in RGB format, but it seems that we have to convert them to the single pallet 1D PNGs (0, 1, 2, ... 255). May I ask you what tool have you used to make this conversion?

2) in the training parameters you mentioned: --LISTpath=<str> Input image number list file [default: data/list/train_aug.txt] should this contain training images names or training labels names or both?

3) is there any code to make some visual inference?

isht7 commented 7 years ago
  1. you can do so using in python using a dictionary to create a mapping between each RGB color and a label. A similar, but opposite thing has been done in this file using the function named decode_labels. This function converts single pallet 1D PNGs (0, 1, 2, ... 255) to RGB. You must train on all 10582 images. The full train images are not available just at the VOC server, and must be augmented from here as written in the deeplab-resnet paper.
  2. It is assumed that a training image and it's corresponding ground truth have the same file name, but are present in different folders. (In VOC both have the same name by default, but the file extensions are different.)
  3. There is a flag in the evaluation code to visualize each output, and compare with gt image and input image. Run evalpyt2.py -h to see info about each flag.