1 // This file is part of OpenCV project.
2 // It is subject to the license terms in the LICENSE file found in the top-level directory
3 // of this distribution and at http://opencv.org/license.html.
5 // Copyright (C) 2020, Intel Corporation, all rights reserved.
6 // Third party copyrights are property of their respective owners.
8 #ifndef __OPENCV_DNN_ONNX_SIMPLIFIER_HPP__
9 #define __OPENCV_DNN_ONNX_SIMPLIFIER_HPP__
11 #include "../precomp.hpp"
13 #if defined(__GNUC__) && __GNUC__ >= 5
14 #pragma GCC diagnostic push
15 #pragma GCC diagnostic ignored "-Wsuggest-override"
17 #include "opencv-onnx.pb.h"
18 #if defined(__GNUC__) && __GNUC__ >= 5
19 #pragma GCC diagnostic pop
22 namespace cv { namespace dnn {
23 CV__DNN_INLINE_NS_BEGIN
25 void simplifySubgraphs(opencv_onnx::GraphProto& net);
27 template<typename T1, typename T2>
28 void convertInt64ToInt32(const T1& src, T2& dst, int size)
30 for (int i = 0; i < size; i++)
32 dst[i] = saturate_cast<int32_t>(src[i]);
36 Mat getMatFromTensor(opencv_onnx::TensorProto& tensor_proto);
39 }} // namespace dnn, namespace cv
41 #endif // __OPENCV_DNN_ONNX_SIMPLIFIER_HPP__