imatge-upc / detection-2016-nipsws

Hierarchical Object Detection with Deep Reinforcement Learning
http://imatge-upc.github.io/detection-2016-nipsws/
MIT License
423 stars 129 forks source link

something about the order of the color channels #11

Closed klvn930815 closed 7 years ago

klvn930815 commented 7 years ago

Hello, all. I found that the code used the pretrained VGG16 model from https://gist.github.com/baraldilorenzo/07d7802847aaad0a35d3,and because of using opencv, the input was loaded in BGR order. But I found that in keras.preprocessing, the image was load in RGB order , https://github.com/fchollet/keras/blob/master/keras/preprocessing/image.py#L300 was there something wrong? And my environment is Keras 1.2.1 ,Theano 0.8.2 , Tensorflow 0.12.1 , using Tensorflow backend.

Thanks!

miriambellver commented 7 years ago

Hi!

Thank you for your comment, you are completely right, I will change it on the code and upload it again! Sorry for the inconveniences,

Míriam

klvn930815 commented 7 years ago

Thanks for your quick reply! And I have another question. Since the pretrained VGG16 model was trained with BGR images, so I need to convert the training images into BGR order before using the pretrained VGG16 model in my own task, is it right? Thanks.

miriambellver commented 7 years ago

Yes! The order should be BGR, and the mean of Imagenet database for each channel should be subtracted.

klvn930815 commented 7 years ago

OK, Thank you very much!