rgeirhos / texture-vs-shape

Pre-trained models, data, code & materials from the paper "ImageNet-trained CNNs are biased towards texture; increasing shape bias improves accuracy and robustness" (ICLR 2019 Oral)
https://openreview.net/forum?id=Bygh9j09KX
Other
785 stars 101 forks source link

Preprocessing images before feeding to ResNet #15

Closed NagabhushanSN95 closed 4 years ago

NagabhushanSN95 commented 4 years ago

Do we need to preprocess the images before feeding them to Model A (ResNet trained on Stylized ImageNet)?

In tensorflow.Keras, there is a preprocess_input() function which subtracts ImageNet mean and does other preprocessing steps. Are any of those required for your model?

Also, should the images be fed in RGB format or BGR?

I think it would be plenty helpful if you can include code to obtain features or predictions. That would answer many minor questions like this :)

rgeirhos commented 4 years ago

Input preprocessing is specified in the README. You can use the PyTorch ImageNet training script as a reference for obtaining predictions, which is exactly what I use.

I have added the input format (RGB not BGR) to the README (commit 303eab9).