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

1 ubuntu 20 04 #2

Merged
merged 9 commits into from
Jun 25, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Makefile.mkldnn
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ ifneq (,$(findstring ccache,$(CC)))
MKLDNN_CC := $(lastword $(CC))
endif

MKLDNN_GITHUB := https://github.com/01org/mkl-dnn.git
MKLDNN_GITHUB := https://github.com/oneapi-src/oneDNN.git
# Enable MKLDNN intel compiler static build
ifneq (,$(findstring icpc,$(MKLDNN_CXX)))
ifeq ($(ICC_STATIC_BUILD), 1)
Expand Down
2 changes: 1 addition & 1 deletion cmake/Dependencies.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -279,7 +279,7 @@ endif()
if(APPLE OR WIN32)
set(LIBDIR lib)
else()
set(LIBDIR lib64)
set(LIBDIR lib)
endif()

# ---[ MKLDNN
Expand Down
2 changes: 1 addition & 1 deletion cmake/MKLDNN.cmake
Original file line number Diff line number Diff line change
Expand Up @@ -33,7 +33,7 @@ function(Download_MKLDNN)
CMAKE_GENERATOR ${MKLDNN_CMAKE_GENERATOR}
CMAKE_ARGS -DCMAKE_BUILD_TYPE=${CMAKE_BUILD_TYPE} -DCMAKE_INSTALL_PREFIX=${MKLDNN_INSTALL_DIR} -DMKLROOT=${MKL_ROOT_DIR} -DCMAKE_SHARED_LINKER_FLAGS=${CMAKE_SHARED_LINKER_FLAGS}
#--Download step
GIT_REPOSITORY https://github.com/intel/mkl-dnn.git
GIT_REPOSITORY https://github.com/oneapi-src/oneDNN.git
GIT_TAG ${MKLDNN_COMMIT}
#--Build step
BINARY_DIR ${MKLDNN_BUILD_DIR}
Expand Down
2 changes: 1 addition & 1 deletion mkldnn.commit
Original file line number Diff line number Diff line change
@@ -1 +1 @@
9a865c2b935e611f4ea451a26bebe45ec5ef4160
027de7603662a569366e15132ac80298902b96b8
2 changes: 1 addition & 1 deletion src/caffe/layer_factory.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -732,7 +732,7 @@ shared_ptr<Layer<Dtype> > GetPythonLayer(const LayerParameter& param) {
bp::object module = bp::import(param.python_param().module().c_str());
bp::object layer = module.attr(param.python_param().layer().c_str())(param);
return bp::extract<shared_ptr<PythonLayer<Dtype> > >(layer)();
} catch (bp::error_already_set) {
} catch (bp::error_already_set&) {
PyErr_Print();
throw;
}
Expand Down
4 changes: 2 additions & 2 deletions src/caffe/layers/image_data_layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -119,7 +119,7 @@ void ImageDataLayer<Dtype>::DataLayerSetUp(const vector<Blob<Dtype>*>& bottom,
CHECK(cv_img.data) << "Could not load " << lines_[lines_id_].first;

if (this->layer_param_.transform_param().bgr2rgb()) {
cv::cvtColor(cv_img, cv_img, CV_BGR2RGB);
cv::cvtColor(cv_img, cv_img, cv::COLOR_BGR2RGB);
}

// Use data_transformer to infer the expected blob shape from a cv_image.
Expand Down Expand Up @@ -179,7 +179,7 @@ void ImageDataLayer<Dtype>::load_batch(Batch<Dtype>* batch) {
CHECK(cv_img.data) << "Could not load " << lines_[lines_id_].first;

if (this->layer_param_.transform_param().bgr2rgb()) {
cv::cvtColor(cv_img, cv_img, CV_BGR2RGB);
cv::cvtColor(cv_img, cv_img, cv::COLOR_BGR2RGB);
}

// Use data_transformer to infer the expected blob shape from a cv_img.
Expand Down
5 changes: 5 additions & 0 deletions src/caffe/layers/video_data_layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -50,6 +50,11 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include "caffe/layers/video_data_layer.hpp"
#include "caffe/util/benchmark.hpp"

#if (CV_MAJOR_VERSION >= 4)
#define CV_CAP_PROP_FRAME_COUNT cv::CAP_PROP_FRAME_COUNT
#define CV_CAP_PROP_POS_FRAMES cv::CAP_PROP_POS_FRAMES
#endif

namespace caffe {

template <typename Dtype>
Expand Down
2 changes: 1 addition & 1 deletion src/caffe/layers/window_data_layer.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -327,7 +327,7 @@ void WindowDataLayer<Dtype>::load_batch(Batch<Dtype>* batch) {
image_database_cache_[window[WindowDataLayer<Dtype>::IMAGE_INDEX]];
cv_img = DecodeDatumToCVMat(image_cached.second, true);
} else {
cv_img = cv::imread(image.first, CV_LOAD_IMAGE_COLOR);
cv_img = cv::imread(image.first, cv::IMREAD_COLOR);
if (!cv_img.data) {
LOG(ERROR) << "Could not open or find file " << image.first;
return;
Expand Down
6 changes: 6 additions & 0 deletions src/caffe/util/bbox_util.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -52,6 +52,12 @@ OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
#include <immintrin.h>
#include "omp.h"
#endif

#if (CV_MAJOR_VERSION >= 4)
#define CV_FILLED cv::FILLED
#define CV_FOURCC cv::VideoWriter::fourcc
#endif

namespace caffe {

bool SortBBoxAscend(const NormalizedBBox& bbox1, const NormalizedBBox& bbox2) {
Expand Down
34 changes: 17 additions & 17 deletions src/caffe/util/im_transforms.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -280,12 +280,12 @@ void CenterObjectAndFillBg(const cv::Mat& in_img, const bool fill_bg,
cv::Mat mask, crop_mask;
if (in_img.channels() > 1) {
cv::Mat in_img_gray;
cv::cvtColor(in_img, in_img_gray, CV_BGR2GRAY);
cv::cvtColor(in_img, in_img_gray, cv::COLOR_BGR2GRAY);
cv::threshold(in_img_gray, mask, 0, 255,
CV_THRESH_BINARY_INV | CV_THRESH_OTSU);
cv::THRESH_BINARY_INV | cv::THRESH_OTSU);
} else {
cv::threshold(in_img, mask, 0, 255,
CV_THRESH_BINARY_INV | CV_THRESH_OTSU);
cv::THRESH_BINARY_INV | cv::THRESH_OTSU);
}
cv::Rect crop_rect = CropMask(mask, mask.at<uchar>(0, 0), 2);

Expand Down Expand Up @@ -463,8 +463,8 @@ cv::Mat ApplyNoise(const cv::Mat& in_img, const NoiseParameter& param) {

if (param.decolorize()) {
cv::Mat grayscale_img;
cv::cvtColor(in_img, grayscale_img, CV_BGR2GRAY);
cv::cvtColor(grayscale_img, out_img, CV_GRAY2BGR);
cv::cvtColor(in_img, grayscale_img, cv::COLOR_BGR2GRAY);
cv::cvtColor(grayscale_img, out_img, cv::COLOR_GRAY2BGR);
} else {
out_img = in_img;
}
Expand All @@ -476,7 +476,7 @@ cv::Mat ApplyNoise(const cv::Mat& in_img, const NoiseParameter& param) {
if (param.hist_eq()) {
if (out_img.channels() > 1) {
cv::Mat ycrcb_image;
cv::cvtColor(out_img, ycrcb_image, CV_BGR2YCrCb);
cv::cvtColor(out_img, ycrcb_image, cv::COLOR_BGR2YCrCb);
// Extract the L channel
vector<cv::Mat> ycrcb_planes(3);
cv::split(ycrcb_image, ycrcb_planes);
Expand All @@ -486,7 +486,7 @@ cv::Mat ApplyNoise(const cv::Mat& in_img, const NoiseParameter& param) {
ycrcb_planes[0] = dst;
cv::merge(ycrcb_planes, ycrcb_image);
// convert back to RGB
cv::cvtColor(ycrcb_image, out_img, CV_YCrCb2BGR);
cv::cvtColor(ycrcb_image, out_img, cv::COLOR_YCrCb2BGR);
} else {
cv::Mat temp_img;
cv::equalizeHist(out_img, temp_img);
Expand All @@ -499,7 +499,7 @@ cv::Mat ApplyNoise(const cv::Mat& in_img, const NoiseParameter& param) {
clahe->setClipLimit(4);
if (out_img.channels() > 1) {
cv::Mat ycrcb_image;
cv::cvtColor(out_img, ycrcb_image, CV_BGR2YCrCb);
cv::cvtColor(out_img, ycrcb_image, cv::COLOR_BGR2YCrCb);
// Extract the L channel
vector<cv::Mat> ycrcb_planes(3);
cv::split(ycrcb_image, ycrcb_planes);
Expand All @@ -509,7 +509,7 @@ cv::Mat ApplyNoise(const cv::Mat& in_img, const NoiseParameter& param) {
ycrcb_planes[0] = dst;
cv::merge(ycrcb_planes, ycrcb_image);
// convert back to RGB
cv::cvtColor(ycrcb_image, out_img, CV_YCrCb2BGR);
cv::cvtColor(ycrcb_image, out_img, cv::COLOR_YCrCb2BGR);
} else {
cv::Ptr<cv::CLAHE> clahe = cv::createCLAHE();
clahe->setClipLimit(4);
Expand All @@ -522,10 +522,10 @@ cv::Mat ApplyNoise(const cv::Mat& in_img, const NoiseParameter& param) {
if (param.jpeg() > 0) {
vector<uchar> buf;
vector<int> params;
params.push_back(CV_IMWRITE_JPEG_QUALITY);
params.push_back(cv::IMWRITE_JPEG_QUALITY);
params.push_back(param.jpeg());
cv::imencode(".jpg", out_img, buf, params);
out_img = cv::imdecode(buf, CV_LOAD_IMAGE_COLOR);
out_img = cv::imdecode(buf, cv::IMREAD_COLOR);
}

if (param.erode()) {
Expand Down Expand Up @@ -573,14 +573,14 @@ cv::Mat ApplyNoise(const cv::Mat& in_img, const NoiseParameter& param) {

if (param.convert_to_hsv()) {
cv::Mat hsv_image;
cv::cvtColor(out_img, hsv_image, CV_BGR2HSV);
cv::cvtColor(out_img, hsv_image, cv::COLOR_BGR2HSV);
out_img = hsv_image;
}
if (param.convert_to_lab()) {
cv::Mat lab_image;
out_img.convertTo(lab_image, CV_32F);
lab_image *= 1.0 / 255;
cv::cvtColor(lab_image, out_img, CV_BGR2Lab);
cv::cvtColor(lab_image, out_img, cv::COLOR_BGR2Lab);
}
return out_img;
}
Expand Down Expand Up @@ -651,7 +651,7 @@ void AdjustSaturation(const cv::Mat& in_img, const float delta,
cv::Mat* out_img) {
if (fabs(delta - 1.f) != 1e-3) {
// Convert to HSV colorspae.
cv::cvtColor(in_img, *out_img, CV_BGR2HSV);
cv::cvtColor(in_img, *out_img, cv::COLOR_BGR2HSV);

// Split the image to 3 channels.
vector<cv::Mat> channels;
Expand All @@ -662,7 +662,7 @@ void AdjustSaturation(const cv::Mat& in_img, const float delta,
cv::merge(channels, *out_img);

// Back to BGR colorspace.
cvtColor(*out_img, *out_img, CV_HSV2BGR);
cvtColor(*out_img, *out_img, cv::COLOR_HSV2BGR);
} else {
*out_img = in_img;
}
Expand All @@ -685,7 +685,7 @@ void RandomHue(const cv::Mat& in_img, cv::Mat* out_img,
void AdjustHue(const cv::Mat& in_img, const float delta, cv::Mat* out_img) {
if (fabs(delta) > 0) {
// Convert to HSV colorspae.
cv::cvtColor(in_img, *out_img, CV_BGR2HSV);
cv::cvtColor(in_img, *out_img, cv::COLOR_BGR2HSV);

// Split the image to 3 channels.
vector<cv::Mat> channels;
Expand All @@ -696,7 +696,7 @@ void AdjustHue(const cv::Mat& in_img, const float delta, cv::Mat* out_img) {
cv::merge(channels, *out_img);

// Back to BGR colorspace.
cvtColor(*out_img, *out_img, CV_HSV2BGR);
cvtColor(*out_img, *out_img, cv::COLOR_HSV2BGR);
} else {
*out_img = in_img;
}
Expand Down
12 changes: 6 additions & 6 deletions src/caffe/util/io.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -145,8 +145,8 @@ void WriteProtoToBinaryFile(const Message& proto, const char* filename) {
cv::Mat ReadImageToCVMat(const string& filename,
const int height, const int width, const bool is_color) {
cv::Mat cv_img;
int cv_read_flag = (is_color ? CV_LOAD_IMAGE_COLOR :
CV_LOAD_IMAGE_GRAYSCALE);
int cv_read_flag = (is_color ? cv::IMREAD_COLOR :
cv::IMREAD_GRAYSCALE);
cv::Mat cv_img_origin = cv::imread(filename, cv_read_flag);
if (!cv_img_origin.data) {
LOG(ERROR) << "Could not open or find file " << filename;
Expand All @@ -164,8 +164,8 @@ cv::Mat ReadImageToCVMat(const string& filename,
const int height, const int width, const bool is_color,
const int min_height, const int min_width) {
cv::Mat cv_img;
int cv_read_flag = (is_color ? CV_LOAD_IMAGE_COLOR :
CV_LOAD_IMAGE_GRAYSCALE);
int cv_read_flag = (is_color ? cv::IMREAD_COLOR :
cv::IMREAD_GRAYSCALE);
cv::Mat cv_img_origin = cv::imread(filename, cv_read_flag);
if (!cv_img_origin.data) {
LOG(ERROR) << "Could not open or find file " << filename;
Expand Down Expand Up @@ -763,8 +763,8 @@ cv::Mat DecodeDatumToCVMat(const Datum& datum, bool is_color) {
CHECK(datum.encoded()) << "Datum not encoded";
const string& data = datum.data();
std::vector<char> vec_data(data.c_str(), data.c_str() + data.size());
int cv_read_flag = (is_color ? CV_LOAD_IMAGE_COLOR :
CV_LOAD_IMAGE_GRAYSCALE);
int cv_read_flag = (is_color ? cv::IMREAD_COLOR :
cv::IMREAD_GRAYSCALE);
cv_img = cv::imdecode(vec_data, cv_read_flag);
if (!cv_img.data) {
LOG(ERROR) << "Could not decode datum ";
Expand Down
20 changes: 0 additions & 20 deletions src/gmock/include/gmock/gmock-actions.h
Original file line number Diff line number Diff line change
Expand Up @@ -373,13 +373,9 @@ class PolymorphicAction {

private:
Impl impl_;

GTEST_DISALLOW_ASSIGN_(MonomorphicImpl);
};

Impl impl_;

GTEST_DISALLOW_ASSIGN_(PolymorphicAction);
};

// Creates an Action from its implementation and returns it. The
Expand Down Expand Up @@ -567,13 +563,9 @@ class ReturnRefAction {

private:
T& ref_;

GTEST_DISALLOW_ASSIGN_(Impl);
};

T& ref_;

GTEST_DISALLOW_ASSIGN_(ReturnRefAction);
};

// Implements the polymorphic ReturnRefOfCopy(x) action, which can be
Expand Down Expand Up @@ -616,13 +608,9 @@ class ReturnRefOfCopyAction {

private:
T value_;

GTEST_DISALLOW_ASSIGN_(Impl);
};

const T value_;

GTEST_DISALLOW_ASSIGN_(ReturnRefOfCopyAction);
};

// Implements the polymorphic DoDefault() action.
Expand All @@ -649,8 +637,6 @@ class AssignAction {
private:
T1* const ptr_;
const T2 value_;

GTEST_DISALLOW_ASSIGN_(AssignAction);
};

#if !GTEST_OS_WINDOWS_MOBILE
Expand All @@ -672,8 +658,6 @@ class SetErrnoAndReturnAction {
private:
const int errno_;
const T result_;

GTEST_DISALLOW_ASSIGN_(SetErrnoAndReturnAction);
};

#endif // !GTEST_OS_WINDOWS_MOBILE
Expand Down Expand Up @@ -812,13 +796,9 @@ class IgnoreResultAction {
OriginalFunction;

const Action<OriginalFunction> action_;

GTEST_DISALLOW_ASSIGN_(Impl);
};

const A action_;

GTEST_DISALLOW_ASSIGN_(IgnoreResultAction);
};

// A ReferenceWrapper<T> object represents a reference to type T,
Expand Down
4 changes: 0 additions & 4 deletions src/gmock/include/gmock/gmock-generated-actions.h
Original file line number Diff line number Diff line change
Expand Up @@ -1407,16 +1407,12 @@ DoAll(Action1 a1, Action2 a2, Action3 a3, Action4 a4, Action5 a5, Action6 a6,
arg5_type arg5, arg6_type arg6, arg7_type arg7, arg8_type arg8, \
arg9_type arg9) const;\
GMOCK_INTERNAL_DEFN_##value_params\
private:\
GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
};\
template <typename F> operator ::testing::Action<F>() const {\
return ::testing::Action<F>(\
new gmock_Impl<F>(GMOCK_INTERNAL_LIST_##value_params));\
}\
GMOCK_INTERNAL_DEFN_##value_params\
private:\
GTEST_DISALLOW_ASSIGN_(GMOCK_ACTION_CLASS_(name, value_params));\
};\
template <GMOCK_INTERNAL_DECL_##template_params\
GMOCK_INTERNAL_DECL_TYPE_##value_params>\
Expand Down
4 changes: 0 additions & 4 deletions src/gmock/include/gmock/gmock-generated-actions.h.pump
Original file line number Diff line number Diff line change
Expand Up @@ -631,16 +631,12 @@ $range k 0..n-1
return_type gmock_PerformImpl(const args_type& args[[]]
$for k [[, arg$k[[]]_type arg$k]]) const;\
GMOCK_INTERNAL_DEFN_##value_params\
private:\
GTEST_DISALLOW_ASSIGN_(gmock_Impl);\
};\
template <typename F> operator ::testing::Action<F>() const {\
return ::testing::Action<F>(\
new gmock_Impl<F>(GMOCK_INTERNAL_LIST_##value_params));\
}\
GMOCK_INTERNAL_DEFN_##value_params\
private:\
GTEST_DISALLOW_ASSIGN_(GMOCK_ACTION_CLASS_(name, value_params));\
};\
template <GMOCK_INTERNAL_DECL_##template_params\
GMOCK_INTERNAL_DECL_TYPE_##value_params>\
Expand Down
Loading