Commit f10fd646 authored by Alexander Alekhin's avatar Alexander Alekhin

dnn: update "guard" inline namespace

- differ from 3.4 branch
parent 09837928
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
namespace cv { namespace cv {
namespace dnn { namespace dnn {
CV__DNN_EXPERIMENTAL_NS_BEGIN CV__DNN_INLINE_NS_BEGIN
//! @addtogroup dnn //! @addtogroup dnn
//! @{ //! @{
...@@ -617,7 +617,7 @@ CV__DNN_EXPERIMENTAL_NS_BEGIN ...@@ -617,7 +617,7 @@ CV__DNN_EXPERIMENTAL_NS_BEGIN
//! @} //! @}
//! @} //! @}
CV__DNN_EXPERIMENTAL_NS_END CV__DNN_INLINE_NS_END
} }
} }
#endif #endif
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
namespace cv { namespace cv {
namespace dnn { namespace dnn {
CV__DNN_EXPERIMENTAL_NS_BEGIN CV__DNN_INLINE_NS_BEGIN
//! @addtogroup dnn //! @addtogroup dnn
//! @{ //! @{
...@@ -149,7 +149,7 @@ public: ...@@ -149,7 +149,7 @@ public:
}; };
//! @} //! @}
CV__DNN_EXPERIMENTAL_NS_END CV__DNN_INLINE_NS_END
} }
} }
......
...@@ -45,20 +45,13 @@ ...@@ -45,20 +45,13 @@
#include <vector> #include <vector>
#include <opencv2/core.hpp> #include <opencv2/core.hpp>
#if !defined CV_DOXYGEN && !defined CV_DNN_DONT_ADD_EXPERIMENTAL_NS #include "../dnn/version.hpp"
#define CV__DNN_EXPERIMENTAL_NS_BEGIN namespace experimental_dnn_34_v7 {
#define CV__DNN_EXPERIMENTAL_NS_END }
namespace cv { namespace dnn { namespace experimental_dnn_34_v7 { } using namespace experimental_dnn_34_v7; }}
#else
#define CV__DNN_EXPERIMENTAL_NS_BEGIN
#define CV__DNN_EXPERIMENTAL_NS_END
#endif
#include <opencv2/dnn/dict.hpp> #include <opencv2/dnn/dict.hpp>
namespace cv { namespace cv {
namespace dnn { namespace dnn {
CV__DNN_EXPERIMENTAL_NS_BEGIN CV__DNN_INLINE_NS_BEGIN
//! @addtogroup dnn //! @addtogroup dnn
//! @{ //! @{
...@@ -906,7 +899,7 @@ CV__DNN_EXPERIMENTAL_NS_BEGIN ...@@ -906,7 +899,7 @@ CV__DNN_EXPERIMENTAL_NS_BEGIN
const float eta = 1.f, const int top_k = 0); const float eta = 1.f, const int top_k = 0);
//! @} //! @}
CV__DNN_EXPERIMENTAL_NS_END CV__DNN_INLINE_NS_END
} }
} }
......
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
namespace cv { namespace cv {
namespace dnn { namespace dnn {
CV__DNN_EXPERIMENTAL_NS_BEGIN CV__DNN_INLINE_NS_BEGIN
template<typename TypeIter> template<typename TypeIter>
DictValue DictValue::arrayInt(TypeIter begin, int size) DictValue DictValue::arrayInt(TypeIter begin, int size)
...@@ -379,7 +379,7 @@ inline std::map<String, DictValue>::const_iterator Dict::end() const ...@@ -379,7 +379,7 @@ inline std::map<String, DictValue>::const_iterator Dict::end() const
return dict.end(); return dict.end();
} }
CV__DNN_EXPERIMENTAL_NS_END CV__DNN_INLINE_NS_END
} }
} }
......
...@@ -9,7 +9,7 @@ ...@@ -9,7 +9,7 @@
namespace cv { namespace cv {
namespace dnn { namespace dnn {
CV__DNN_EXPERIMENTAL_NS_BEGIN CV__DNN_INLINE_NS_BEGIN
/** @brief Registers layer constructor in runtime. /** @brief Registers layer constructor in runtime.
* @param type string, containing type name of the layer. * @param type string, containing type name of the layer.
...@@ -72,7 +72,7 @@ public: ...@@ -72,7 +72,7 @@ public:
}; };
} // namespace } // namespace
CV__DNN_EXPERIMENTAL_NS_END CV__DNN_INLINE_NS_END
}} // namespace }} // namespace
#endif #endif
...@@ -45,7 +45,7 @@ ...@@ -45,7 +45,7 @@
namespace cv { namespace cv {
namespace dnn { namespace dnn {
CV__DNN_EXPERIMENTAL_NS_BEGIN CV__DNN_INLINE_NS_BEGIN
//! @addtogroup dnn //! @addtogroup dnn
//! @{ //! @{
//! //!
...@@ -79,7 +79,7 @@ private: ...@@ -79,7 +79,7 @@ private:
//! @} //! @}
//! @} //! @}
CV__DNN_EXPERIMENTAL_NS_END CV__DNN_INLINE_NS_END
} }
} }
#endif #endif
...@@ -50,7 +50,7 @@ ...@@ -50,7 +50,7 @@
namespace cv { namespace cv {
namespace dnn { namespace dnn {
CV__DNN_EXPERIMENTAL_NS_BEGIN CV__DNN_INLINE_NS_BEGIN
//Slicing //Slicing
...@@ -213,7 +213,7 @@ inline Range clamp(const Range& r, int axisSize) ...@@ -213,7 +213,7 @@ inline Range clamp(const Range& r, int axisSize)
return clamped; return clamped;
} }
CV__DNN_EXPERIMENTAL_NS_END CV__DNN_INLINE_NS_END
} }
} }
#endif #endif
// This file is part of OpenCV project.
// It is subject to the license terms in the LICENSE file found in the top-level directory
// of this distribution and at http://opencv.org/license.html.
#ifndef OPENCV_DNN_VERSION_HPP
#define OPENCV_DNN_VERSION_HPP
/// Use with major OpenCV version only.
#define OPENCV_DNN_API_VERSION 20180903
#if !defined CV_DOXYGEN && !defined CV_DNN_DONT_ADD_INLINE_NS
#define CV__DNN_INLINE_NS __CV_CAT(dnn4_v, OPENCV_DNN_API_VERSION)
#define CV__DNN_INLINE_NS_BEGIN namespace CV__DNN_INLINE_NS {
#define CV__DNN_INLINE_NS_END }
namespace cv { namespace dnn { namespace CV__DNN_INLINE_NS { } using namespace CV__DNN_INLINE_NS; }}
#else
#define CV__DNN_INLINE_NS_BEGIN
#define CV__DNN_INLINE_NS_END
#endif
#endif // OPENCV_DNN_VERSION_HPP
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
namespace cv { namespace cv {
namespace dnn { namespace dnn {
CV__DNN_EXPERIMENTAL_NS_BEGIN CV__DNN_INLINE_NS_BEGIN
#ifdef HAVE_PROTOBUF #ifdef HAVE_PROTOBUF
using ::google::protobuf::RepeatedField; using ::google::protobuf::RepeatedField;
...@@ -464,5 +464,5 @@ Net readNetFromCaffe(const std::vector<uchar>& bufferProto, const std::vector<uc ...@@ -464,5 +464,5 @@ Net readNetFromCaffe(const std::vector<uchar>& bufferProto, const std::vector<uc
#endif //HAVE_PROTOBUF #endif //HAVE_PROTOBUF
CV__DNN_EXPERIMENTAL_NS_END CV__DNN_INLINE_NS_END
}} // namespace }} // namespace
...@@ -13,7 +13,7 @@ ...@@ -13,7 +13,7 @@
#endif #endif
namespace cv { namespace dnn { namespace cv { namespace dnn {
CV__DNN_EXPERIMENTAL_NS_BEGIN CV__DNN_INLINE_NS_BEGIN
#ifdef HAVE_PROTOBUF #ifdef HAVE_PROTOBUF
...@@ -76,5 +76,5 @@ void shrinkCaffeModel(const String& src, const String& dst, const std::vector<St ...@@ -76,5 +76,5 @@ void shrinkCaffeModel(const String& src, const String& dst, const std::vector<St
#endif // HAVE_PROTOBUF #endif // HAVE_PROTOBUF
CV__DNN_EXPERIMENTAL_NS_END CV__DNN_INLINE_NS_END
}} // namespace }} // namespace
...@@ -54,7 +54,7 @@ ...@@ -54,7 +54,7 @@
namespace cv { namespace cv {
namespace dnn { namespace dnn {
CV__DNN_EXPERIMENTAL_NS_BEGIN CV__DNN_INLINE_NS_BEGIN
namespace namespace
{ {
...@@ -251,5 +251,5 @@ Net readNetFromDarknet(const std::vector<uchar>& bufferCfg, const std::vector<uc ...@@ -251,5 +251,5 @@ Net readNetFromDarknet(const std::vector<uchar>& bufferCfg, const std::vector<uc
bufferModelPtr, bufferModel.size()); bufferModelPtr, bufferModel.size());
} }
CV__DNN_EXPERIMENTAL_NS_END CV__DNN_INLINE_NS_END
}} // namespace }} // namespace
...@@ -57,7 +57,7 @@ ...@@ -57,7 +57,7 @@
namespace cv { namespace cv {
namespace dnn { namespace dnn {
CV__DNN_EXPERIMENTAL_NS_BEGIN CV__DNN_INLINE_NS_BEGIN
// this option is useful to run valgrind memory errors detection // this option is useful to run valgrind memory errors detection
static bool DNN_DISABLE_MEMORY_OPTIMIZATIONS = utils::getConfigurationParameterBool("OPENCV_DNN_DISABLE_MEMORY_OPTIMIZATIONS", false); static bool DNN_DISABLE_MEMORY_OPTIMIZATIONS = utils::getConfigurationParameterBool("OPENCV_DNN_DISABLE_MEMORY_OPTIMIZATIONS", false);
...@@ -3465,5 +3465,5 @@ Net readNetFromModelOptimizer(const String &xml, const String &bin) ...@@ -3465,5 +3465,5 @@ Net readNetFromModelOptimizer(const String &xml, const String &bin)
return Net::readFromModelOptimizer(xml, bin); return Net::readFromModelOptimizer(xml, bin);
} }
CV__DNN_EXPERIMENTAL_NS_END CV__DNN_INLINE_NS_END
}} // namespace }} // namespace
...@@ -46,7 +46,7 @@ ...@@ -46,7 +46,7 @@
namespace cv { namespace cv {
namespace dnn { namespace dnn {
CV__DNN_EXPERIMENTAL_NS_BEGIN CV__DNN_INLINE_NS_BEGIN
static Mutex* __initialization_mutex = NULL; static Mutex* __initialization_mutex = NULL;
Mutex& getInitializationMutex() Mutex& getInitializationMutex()
...@@ -132,5 +132,5 @@ void initializeLayerFactory() ...@@ -132,5 +132,5 @@ void initializeLayerFactory()
CV_DNN_REGISTER_LAYER_CLASS(LSTM, LSTMLayer); CV_DNN_REGISTER_LAYER_CLASS(LSTM, LSTMLayer);
} }
CV__DNN_EXPERIMENTAL_NS_END CV__DNN_INLINE_NS_END
}} // namespace }} // namespace
...@@ -10,11 +10,8 @@ ...@@ -10,11 +10,8 @@
#include <opencv2/imgproc.hpp> #include <opencv2/imgproc.hpp>
namespace cv namespace cv { namespace dnn {
{ CV__DNN_INLINE_NS_BEGIN
namespace dnn
{
CV__DNN_EXPERIMENTAL_NS_BEGIN
static inline float rectOverlap(const Rect& a, const Rect& b) static inline float rectOverlap(const Rect& a, const Rect& b)
{ {
...@@ -51,6 +48,6 @@ void NMSBoxes(const std::vector<RotatedRect>& bboxes, const std::vector<float>& ...@@ -51,6 +48,6 @@ void NMSBoxes(const std::vector<RotatedRect>& bboxes, const std::vector<float>&
NMSFast_(bboxes, scores, score_threshold, nms_threshold, eta, top_k, indices, rotatedRectIOU); NMSFast_(bboxes, scores, score_threshold, nms_threshold, eta, top_k, indices, rotatedRectIOU);
} }
CV__DNN_EXPERIMENTAL_NS_END CV__DNN_INLINE_NS_END
}// dnn }// dnn
}// cv }// cv
...@@ -63,9 +63,9 @@ ...@@ -63,9 +63,9 @@
namespace cv { namespace dnn { namespace cv { namespace dnn {
CV__DNN_EXPERIMENTAL_NS_BEGIN CV__DNN_INLINE_NS_BEGIN
#define IS_DNN_OPENCL_TARGET(id) (id == DNN_TARGET_OPENCL || id == DNN_TARGET_OPENCL_FP16) #define IS_DNN_OPENCL_TARGET(id) (id == DNN_TARGET_OPENCL || id == DNN_TARGET_OPENCL_FP16)
Mutex& getInitializationMutex(); Mutex& getInitializationMutex();
void initializeLayerFactory(); void initializeLayerFactory();
CV__DNN_EXPERIMENTAL_NS_END CV__DNN_INLINE_NS_END
}} // namespace }} // namespace
...@@ -12,7 +12,7 @@ ...@@ -12,7 +12,7 @@
#include "tf_graph_simplifier.hpp" #include "tf_graph_simplifier.hpp"
namespace cv { namespace dnn { namespace cv { namespace dnn {
CV__DNN_EXPERIMENTAL_NS_BEGIN CV__DNN_INLINE_NS_BEGIN
using ::google::protobuf::RepeatedField; using ::google::protobuf::RepeatedField;
using ::google::protobuf::MapPair; using ::google::protobuf::MapPair;
...@@ -782,7 +782,7 @@ void releaseTensor(tensorflow::TensorProto* tensor) ...@@ -782,7 +782,7 @@ void releaseTensor(tensorflow::TensorProto* tensor)
} }
} }
CV__DNN_EXPERIMENTAL_NS_END CV__DNN_INLINE_NS_END
}} // namespace dnn, namespace cv }} // namespace dnn, namespace cv
#endif // HAVE_PROTOBUF #endif // HAVE_PROTOBUF
...@@ -15,7 +15,7 @@ ...@@ -15,7 +15,7 @@
#include "tf_io.hpp" #include "tf_io.hpp"
namespace cv { namespace dnn { namespace cv { namespace dnn {
CV__DNN_EXPERIMENTAL_NS_BEGIN CV__DNN_INLINE_NS_BEGIN
void RemoveIdentityOps(tensorflow::GraphDef& net); void RemoveIdentityOps(tensorflow::GraphDef& net);
...@@ -25,7 +25,7 @@ Mat getTensorContent(const tensorflow::TensorProto &tensor); ...@@ -25,7 +25,7 @@ Mat getTensorContent(const tensorflow::TensorProto &tensor);
void releaseTensor(tensorflow::TensorProto* tensor); void releaseTensor(tensorflow::TensorProto* tensor);
CV__DNN_EXPERIMENTAL_NS_END CV__DNN_INLINE_NS_END
}} // namespace dnn, namespace cv }} // namespace dnn, namespace cv
#endif // HAVE_PROTOBUF #endif // HAVE_PROTOBUF
......
...@@ -24,7 +24,7 @@ Implementation of Tensorflow models parser ...@@ -24,7 +24,7 @@ Implementation of Tensorflow models parser
namespace cv { namespace cv {
namespace dnn { namespace dnn {
CV__DNN_EXPERIMENTAL_NS_BEGIN CV__DNN_INLINE_NS_BEGIN
#if HAVE_PROTOBUF #if HAVE_PROTOBUF
...@@ -1950,5 +1950,5 @@ Net readNetFromTensorflow(const std::vector<uchar>& bufferModel, const std::vect ...@@ -1950,5 +1950,5 @@ Net readNetFromTensorflow(const std::vector<uchar>& bufferModel, const std::vect
bufferConfigPtr, bufferConfig.size()); bufferConfigPtr, bufferConfig.size());
} }
CV__DNN_EXPERIMENTAL_NS_END CV__DNN_INLINE_NS_END
}} // namespace }} // namespace
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
namespace cv { namespace cv {
namespace dnn { namespace dnn {
CV__DNN_EXPERIMENTAL_NS_BEGIN CV__DNN_INLINE_NS_BEGIN
using namespace TH; using namespace TH;
...@@ -1240,5 +1240,5 @@ Net readNetFromTorch(const String &model, bool isBinary) ...@@ -1240,5 +1240,5 @@ Net readNetFromTorch(const String &model, bool isBinary)
return net; return net;
} }
CV__DNN_EXPERIMENTAL_NS_END CV__DNN_INLINE_NS_END
}} // namespace }} // namespace
...@@ -51,7 +51,7 @@ ...@@ -51,7 +51,7 @@
namespace cv { namespace cv {
namespace dnn { namespace dnn {
CV__DNN_EXPERIMENTAL_NS_BEGIN CV__DNN_INLINE_NS_BEGIN
static inline void PrintTo(const cv::dnn::Backend& v, std::ostream* os) static inline void PrintTo(const cv::dnn::Backend& v, std::ostream* os)
{ {
...@@ -75,7 +75,7 @@ static inline void PrintTo(const cv::dnn::Target& v, std::ostream* os) ...@@ -75,7 +75,7 @@ static inline void PrintTo(const cv::dnn::Target& v, std::ostream* os)
*os << "DNN_TARGET_UNKNOWN(" << v << ")"; *os << "DNN_TARGET_UNKNOWN(" << v << ")";
} }
CV__DNN_EXPERIMENTAL_NS_END CV__DNN_INLINE_NS_END
}} // namespace }} // namespace
namespace opencv_test { namespace opencv_test {
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment