Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

force_encoded_color flag and warning against mixed color-gray encoded DBs #1910

Merged
merged 1 commit into from
Feb 20, 2015

Conversation

philkr
Copy link
Contributor

@philkr philkr commented Feb 19, 2015

This PR fixes issue #1901, where older encoded DBs are not compatible with PR #1878. It adds a force_encoded_color flag to data_param, to force mixed encoded DBs to be read properly (as all color DBs).
It also warns users against the use of mixed color-gray DBs.

else
cv_img = DecodeDatumToCVMatNative(datum);
if (cv_img.channels() != this->transformed_data_.channels())
LOG(WARNING) << "You dataset contains encoded images with mixed "
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

s/you/your/

otherwise, this looks good to me

@shelhamer
Copy link
Member

@philkr thanks for working on the fix. Please remember to squash and rebase for a clean merge.

…g if images of different channel dimensions are encoded together
shelhamer added a commit to shelhamer/caffe that referenced this pull request Feb 20, 2015
  add force_encoded_color flag to the data layer and warn about
  mixed encoding
@shelhamer
Copy link
Member

@philkr this still wasn't a clean merge, so please rebase to the latest dev next time (remember your clone might be out of date). For the sake of this being done with I did the merge manually in 9114424. Thanks.

@shelhamer shelhamer merged commit a2f7f47 into BVLC:dev Feb 20, 2015
@philkr philkr deleted the encoded branch February 20, 2015 17:43
@yanii
Copy link

yanii commented Mar 7, 2015

Just started trying to use encoded dbs again, and after re-creating a new encoded database with the latest caffe-dev (which I see is now deprecated) the problem persists - so this doesn't seem to be a problem restricted to older databases.. even newly created DBs need the flag to force it.

Would advise testing this on a dataset with mixed image encodings - I'm using the original imagenet images (without them being re-encoded) and finding this.

@philkr
Copy link
Contributor Author

philkr commented Mar 7, 2015

You are right. I was trying to be a bit too smart about it in src/caffe/util/io.cpp:120. #2071 should take care if this.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants