Skip to content
This repository was archived by the owner on Aug 5, 2022. It is now read-only.

Commit ca7d58f

Browse files
ftian1Gerrit Code Review
authored andcommitted
Merge "fix build failure caused by use_opencv flag being off" into master_clean
2 parents 425ca6f + 2cbb0b5 commit ca7d58f

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

src/caffe/data_transformer.cpp

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,7 @@ void DataTransformer<Dtype>::Transform(const Datum& datum,
7676
CHECK(datum.encoded()) << "For box data, datum must be encoded";
7777
CHECK(!(param_.force_color() && param_.force_gray()))
7878
<< "cannot set both force_color and force_gray";
79+
#ifdef USE_OPENCV
7980
cv::Mat cv_img;
8081
if (param_.force_color() || param_.force_gray()) {
8182
// If force_color then decode in color otherwise decode in gray.
@@ -150,6 +151,9 @@ void DataTransformer<Dtype>::Transform(const Datum& datum,
150151
cv::resize(cv_rand_img, cv_rand_img, cv::Size(img_width, img_height));
151152
// Transform the cv::image into blob.
152153
Transform(cv_rand_img, transformed_blob);
154+
#else
155+
LOG(FATAL) << "Image transformer requires OpenCV; compile with USE_OPENCV.";
156+
#endif
153157
return;
154158
}
155159

0 commit comments

Comments
 (0)