Skip to content
This repository has been archived by the owner on Nov 17, 2023. It is now read-only.

Commit

Permalink
Add scale back for now
Browse files Browse the repository at this point in the history
  • Loading branch information
tqchen committed Sep 25, 2015
1 parent d73cce0 commit cc2ab5a
Showing 1 changed file with 6 additions and 6 deletions.
12 changes: 6 additions & 6 deletions src/io/iter_normalize.h
Original file line number Diff line number Diff line change
Expand Up @@ -178,23 +178,23 @@ class ImageNormalizeIter : public IIterator<DataInst> {
data[1] -= param_.mean_g;
data[2] -= param_.mean_r;
if ((param_.rand_mirror && coin_flip(rnd_)) || param_.mirror) {
outimg_ = mirror(data * contrast + illumination);
outimg_ = mirror(data * contrast + illumination) * param_.scale;
} else {
outimg_ = data * contrast + illumination;
outimg_ = (data * contrast + illumination) * param_.scale;
}
} else if (!meanfile_ready_ || param_.mean_img.length() == 0) {
// do not substract anything
if ((param_.rand_mirror && coin_flip(rnd_)) || param_.mirror) {
outimg_ = mirror(data);
outimg_ = mirror(data) * param_.scale;
} else {
outimg_ = F<mshadow::op::identity>(data);
outimg_ = F<mshadow::op::identity>(data) * param_.scale;
}
} else {
CHECK(meanfile_ready_);
if ((param_.rand_mirror && coin_flip(rnd_)) || param_.mirror) {
outimg_ = mirror((data - meanimg_) * contrast + illumination);
outimg_ = mirror((data - meanimg_) * contrast + illumination) * param_.scale;
} else {
outimg_ = (data - meanimg_) * contrast + illumination;
outimg_ = ((data - meanimg_) * contrast + illumination) * param_.scale;
}
}
}
Expand Down

0 comments on commit cc2ab5a

Please sign in to comment.