samples: add C++11 override to virtual methods

This commit is contained in:
Sayed Adel 2018-05-03 20:12:24 +00:00
parent 9fa01a7b70
commit e00a58a05f

View File

@ -16,18 +16,18 @@ public:
virtual bool getMemoryShapes(const std::vector<std::vector<int> > &inputs, virtual bool getMemoryShapes(const std::vector<std::vector<int> > &inputs,
const int requiredOutputs, const int requiredOutputs,
std::vector<std::vector<int> > &outputs, std::vector<std::vector<int> > &outputs,
std::vector<std::vector<int> > &internals) const; std::vector<std::vector<int> > &internals) const CV_OVERRIDE;
//! [MyLayer::getMemoryShapes] //! [MyLayer::getMemoryShapes]
//! [MyLayer::forward] //! [MyLayer::forward]
virtual void forward(std::vector<cv::Mat*> &inputs, std::vector<cv::Mat> &outputs, std::vector<cv::Mat> &internals); virtual void forward(std::vector<cv::Mat*> &inputs, std::vector<cv::Mat> &outputs, std::vector<cv::Mat> &internals) CV_OVERRIDE;
//! [MyLayer::forward] //! [MyLayer::forward]
//! [MyLayer::finalize] //! [MyLayer::finalize]
virtual void finalize(const std::vector<cv::Mat*> &inputs, std::vector<cv::Mat> &outputs); virtual void finalize(const std::vector<cv::Mat*> &inputs, std::vector<cv::Mat> &outputs) CV_OVERRIDE;
//! [MyLayer::finalize] //! [MyLayer::finalize]
virtual void forward(cv::InputArrayOfArrays inputs, cv::OutputArrayOfArrays outputs, cv::OutputArrayOfArrays internals); virtual void forward(cv::InputArrayOfArrays inputs, cv::OutputArrayOfArrays outputs, cv::OutputArrayOfArrays internals) CV_OVERRIDE;
}; };
//! [A custom layer interface] //! [A custom layer interface]
@ -49,7 +49,7 @@ public:
virtual bool getMemoryShapes(const std::vector<std::vector<int> > &inputs, virtual bool getMemoryShapes(const std::vector<std::vector<int> > &inputs,
const int requiredOutputs, const int requiredOutputs,
std::vector<std::vector<int> > &outputs, std::vector<std::vector<int> > &outputs,
std::vector<std::vector<int> > &internals) const std::vector<std::vector<int> > &internals) const CV_OVERRIDE
{ {
CV_UNUSED(requiredOutputs); CV_UNUSED(internals); CV_UNUSED(requiredOutputs); CV_UNUSED(internals);
std::vector<int> outShape(4); std::vector<int> outShape(4);
@ -62,7 +62,7 @@ public:
} }
// Implementation of this custom layer is based on https://github.com/cdmh/deeplab-public/blob/master/src/caffe/layers/interp_layer.cpp // Implementation of this custom layer is based on https://github.com/cdmh/deeplab-public/blob/master/src/caffe/layers/interp_layer.cpp
virtual void forward(std::vector<cv::Mat*> &inputs, std::vector<cv::Mat> &outputs, std::vector<cv::Mat> &internals) virtual void forward(std::vector<cv::Mat*> &inputs, std::vector<cv::Mat> &outputs, std::vector<cv::Mat> &internals) CV_OVERRIDE
{ {
CV_UNUSED(internals); CV_UNUSED(internals);
cv::Mat& inp = *inputs[0]; cv::Mat& inp = *inputs[0];
@ -105,7 +105,7 @@ public:
} }
} }
virtual void forward(cv::InputArrayOfArrays, cv::OutputArrayOfArrays, cv::OutputArrayOfArrays) {} virtual void forward(cv::InputArrayOfArrays, cv::OutputArrayOfArrays, cv::OutputArrayOfArrays) CV_OVERRIDE {}
private: private:
int outWidth, outHeight; int outWidth, outHeight;
@ -132,7 +132,7 @@ public:
virtual bool getMemoryShapes(const std::vector<std::vector<int> > &inputs, virtual bool getMemoryShapes(const std::vector<std::vector<int> > &inputs,
const int requiredOutputs, const int requiredOutputs,
std::vector<std::vector<int> > &outputs, std::vector<std::vector<int> > &outputs,
std::vector<std::vector<int> > &internals) const std::vector<std::vector<int> > &internals) const CV_OVERRIDE
{ {
CV_UNUSED(requiredOutputs); CV_UNUSED(internals); CV_UNUSED(requiredOutputs); CV_UNUSED(internals);
std::vector<int> outShape(4); std::vector<int> outShape(4);
@ -146,7 +146,7 @@ public:
// This implementation is based on a reference implementation from // This implementation is based on a reference implementation from
// https://github.com/tensorflow/tensorflow/blob/master/tensorflow/contrib/lite/kernels/internal/reference/reference_ops.h // https://github.com/tensorflow/tensorflow/blob/master/tensorflow/contrib/lite/kernels/internal/reference/reference_ops.h
virtual void forward(std::vector<cv::Mat*> &inputs, std::vector<cv::Mat> &outputs, std::vector<cv::Mat> &internals) virtual void forward(std::vector<cv::Mat*> &inputs, std::vector<cv::Mat> &outputs, std::vector<cv::Mat> &internals) CV_OVERRIDE
{ {
CV_UNUSED(internals); CV_UNUSED(internals);
cv::Mat& inp = *inputs[0]; cv::Mat& inp = *inputs[0];
@ -187,7 +187,7 @@ public:
} }
} }
virtual void forward(cv::InputArrayOfArrays, cv::OutputArrayOfArrays, cv::OutputArrayOfArrays) {} virtual void forward(cv::InputArrayOfArrays, cv::OutputArrayOfArrays, cv::OutputArrayOfArrays) CV_OVERRIDE {}
private: private:
static inline int offset(const cv::MatSize& size, int c, int x, int y, int b) static inline int offset(const cv::MatSize& size, int c, int x, int y, int b)