mmsegmentation
mmsegmentation copied to clipboard
RGB2Gray transform function is incomplete
RGB2Gray actually takes weights=(0.299, 0.587, 0.114) as argument because these are the coefficients needed to convert an RGB image to a Grayscale one (https://en.wikipedia.org/wiki/Grayscale). However, the default process of the DataLoader is to load a BGR image. I have changed the source code on my machine to BGR2Gray with these weights=(0.114, 0.587, 0.299).
RGB2Gray actually takes weights=(0.299, 0.587, 0.114) as argument because these are the coefficients needed to convert an RGB image to a Grayscale one (https://en.wikipedia.org/wiki/Grayscale). However, the default process of the DataLoader is to load a BGR image. I have changed the source code on my machine to BGR2Gray with these weights=(0.114, 0.587, 0.299).
Actually, in SegDataPreProcessor, you will find bgr_to_rgb=True, so dataloader is to load a rgb image