NVIDIA / caffe

Caffe: a fast open framework for deep learning.
http://caffe.berkeleyvision.org/
Other
672 stars 263 forks source link

color_mode bug in Decode() function in io.cpp #529

Closed soyebn closed 6 years ago

soyebn commented 6 years ago

Looks like color_mode is ignore in the flow when Turbo JPEG decoder is used. Observed while training coco dataset which contains gray images. See below, https://github.com/NVIDIA/caffe/blob/caffe-0.17/src/caffe/util/io.cpp#L152 Inserting the following lines fixes the issue. if(cv_img->channels()<3 && color_mode>0) { cv::cvtColor(cv_img, cv_img, cv::COLOR_GRAY2BGR); }

drnikolaev commented 6 years ago

@soyebn Good catch, thank you. Fixed in https://github.com/drnikolaev/caffe/tree/caffe-0.17