YOLOX icon indicating copy to clipboard operation
YOLOX copied to clipboard

YOLOX input images are RGB or BGR?

Open nahidalam opened this issue 3 years ago • 2 comments

I am a bit confused whether YOLOX input images are RGB or BGR for training. Can you point me to the code? The TrainTransform class seems to indicate that the input images are converted to hsv which is a rearrangement of RGB?

Can you please clarify?

nahidalam avatar Aug 24 '22 14:08 nahidalam

@nahidalam Thank you for pointing out the bug in augment_hsv function. cv2 is used in YOLOX, and cv2.imread return an BGR image by default.

I think this bug might not affect the performance of YOLOX and I will try to rerun my experiments of YOLOX after fixing it.

FateScript avatar Aug 25 '22 03:08 FateScript

@FateScript so you are saying YOLOX is trained on BGR images? I was looking into OpenVino and they say that the original YOLOX expects RGB input. I guess they are wrong then.

nahidalam avatar Aug 25 '22 10:08 nahidalam

any update on this? for production it will be much better to run inference on rgb images. should i convert them to bgr?

korkland avatar Dec 09 '22 20:12 korkland

@korkland YOLOX requires BGR input image, and I also try RGB image, it doesn't effect the final performance too much. @nahidalam I double check the augment_hsv function, it's correct and bug free. OpenVino doc is mistaken if they said that origin YOLOX expects RBG image.

FateScript avatar Dec 16 '22 07:12 FateScript

Maybe we should add more docstring for our code related to data augmentation @Joker316701882 .

FateScript avatar Dec 16 '22 07:12 FateScript

Digging up this issue, because I noticed that for detecting objects that heavily correlated with colors (in my case brown cardboard boxes), switching channels order makes a huuge difference. Pointing this our for posterity 📦