mmsegmentation icon indicating copy to clipboard operation
mmsegmentation copied to clipboard

RGB2Gray transform function is incomplete

Open NVigne-cloud opened this issue 2 years ago • 1 comments

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).

NVigne-cloud avatar Jun 01 '23 14:06 NVigne-cloud

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

CastleDream avatar Jan 16 '24 09:01 CastleDream