PSPNet icon indicating copy to clipboard operation
PSPNet copied to clipboard

how to get greyscale annotation images?

Open PennTao opened this issue 8 years ago • 4 comments

The original ADE20K dataset does not provide greyscale annotation image, while the PSPNet needs greyscale annotation images for evaluation, is there are script that can convert original images o greyscale?

Or should I just add rgb2gray in eval_acc to turn all color imAnno into geryscale ?

btw, if I don't apply rgb2gray to imAnno, I will get matrix dimension mismatch error while doing IoU

PennTao avatar Jan 23 '18 06:01 PennTao

I met the same problem. This may be helpful: http://groups.csail.mit.edu/vision/datasets/ADE20K/ You can download and run the tool to get the annotation images, which are index number for the colormap within png: http://groups.csail.mit.edu/vision/datasets/ADE20K/code.zip

imjiangjun avatar Apr 28 '18 01:04 imjiangjun

rgb2grey won't work because eval_acc does not need a grey image per se; it needs an indexed image, where an index corresponds to a class ID.

qizhuli avatar Apr 28 '18 13:04 qizhuli

PALETTE or Colormap doesn't match with the mask (annotation) while converting the 'RGB mask' to a single channel class ID. Has anyone encountered the same problem?
I tried multiple approaches to convert to a single-channel Class ID mask.

  1. np.all(np.equal(RGB_mask, colormap[i]))
  2. cv2.inRange(RGB_mask, colormap[i], colormap[i])

navinranjan7 avatar Jan 05 '23 21:01 navinranjan7

http://data.csail.mit.edu/places/ADEchallenge/ADEChallengeData2016.zip Can download the ADEChallengeData2016 dataset with annotations for 150 classes. https://cv.gluon.ai/build/examples_datasets/ade20k.html

navinranjan7 avatar Jan 05 '23 22:01 navinranjan7