Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
Tetragramm
GitHub Repository: Tetragramm/opencv
Path: blob/master/modules/dnn/src/tensorflow/tf_io.hpp
16339 views
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.
4
5
// Copyright (C) 2016, Intel Corporation, all rights reserved.
6
// Third party copyrights are property of their respective owners.
7
8
/*
9
Declaration of various functions which are related to Tensorflow models reading.
10
*/
11
12
#ifndef __OPENCV_DNN_TF_IO_HPP__
13
#define __OPENCV_DNN_TF_IO_HPP__
14
#ifdef HAVE_PROTOBUF
15
16
#if defined(__GNUC__) && __GNUC__ >= 5
17
#pragma GCC diagnostic push
18
#pragma GCC diagnostic ignored "-Wsuggest-override"
19
#endif
20
#include "graph.pb.h"
21
22
#include <google/protobuf/message.h>
23
#include <google/protobuf/text_format.h>
24
#include <google/protobuf/io/zero_copy_stream_impl.h>
25
#if defined(__GNUC__) && __GNUC__ >= 5
26
#pragma GCC diagnostic pop
27
#endif
28
29
namespace tensorflow { using namespace opencv_tensorflow; }
30
31
namespace cv {
32
namespace dnn {
33
34
// Read parameters from a file into a GraphDef proto message.
35
void ReadTFNetParamsFromBinaryFileOrDie(const char* param_file,
36
tensorflow::GraphDef* param);
37
38
void ReadTFNetParamsFromTextFileOrDie(const char* param_file,
39
tensorflow::GraphDef* param);
40
41
// Read parameters from a memory buffer into a GraphDef proto message.
42
void ReadTFNetParamsFromBinaryBufferOrDie(const char* data, size_t len,
43
tensorflow::GraphDef* param);
44
45
void ReadTFNetParamsFromTextBufferOrDie(const char* data, size_t len,
46
tensorflow::GraphDef* param);
47
48
}
49
}
50
51
#endif
52
#endif
53
54