HRNet / HRNet-Semantic-Segmentation

The OCR approach is rephrased as Segmentation Transformer: https://arxiv.org/abs/1909.11065. This is an official implementation of semantic segmentation for HRNet. https://arxiv.org/abs/1908.07919
Other
3.09k stars 682 forks source link

RGB images for pertained model vs BGR images for Semantic segmentation #268

Closed abhiagwl4262 closed 1 year ago

abhiagwl4262 commented 1 year ago

For Imagenet training This repo - https://github.com/HRNet/HRNet-Image-Classification was used in which data was loaded with torchvision.datasets.ImageFolder which uses PIL to load the image which loads image in RGB mode.

While in this repo for segmentation, the data is being load using cv2, see this https://github.com/HRNet/HRNet-Semantic-Segmentation/blob/0bbb2880446ddff2d78f8dd7e8c4c610151d5a51/lib/datasets/cocostuff.py#L93-L96 cv2 loads image in BGR format and Image loading of cv2 is slower than PIL as well.

abhiagwl4262 commented 1 year ago

My bad ...wrong observation. In this repo, the image is being read in BGR but again getting back converted to RGB in image_transform function. Its good to read with PIL if eventually training is going to happen on RGB images.