Path: blob/master/modules/dnn/src/tensorflow/tf_io.hpp
16339 views
// This file is part of OpenCV project.1// It is subject to the license terms in the LICENSE file found in the top-level directory2// of this distribution and at http://opencv.org/license.html.34// Copyright (C) 2016, Intel Corporation, all rights reserved.5// Third party copyrights are property of their respective owners.67/*8Declaration of various functions which are related to Tensorflow models reading.9*/1011#ifndef __OPENCV_DNN_TF_IO_HPP__12#define __OPENCV_DNN_TF_IO_HPP__13#ifdef HAVE_PROTOBUF1415#if defined(__GNUC__) && __GNUC__ >= 516#pragma GCC diagnostic push17#pragma GCC diagnostic ignored "-Wsuggest-override"18#endif19#include "graph.pb.h"2021#include <google/protobuf/message.h>22#include <google/protobuf/text_format.h>23#include <google/protobuf/io/zero_copy_stream_impl.h>24#if defined(__GNUC__) && __GNUC__ >= 525#pragma GCC diagnostic pop26#endif2728namespace tensorflow { using namespace opencv_tensorflow; }2930namespace cv {31namespace dnn {3233// Read parameters from a file into a GraphDef proto message.34void ReadTFNetParamsFromBinaryFileOrDie(const char* param_file,35tensorflow::GraphDef* param);3637void ReadTFNetParamsFromTextFileOrDie(const char* param_file,38tensorflow::GraphDef* param);3940// Read parameters from a memory buffer into a GraphDef proto message.41void ReadTFNetParamsFromBinaryBufferOrDie(const char* data, size_t len,42tensorflow::GraphDef* param);4344void ReadTFNetParamsFromTextBufferOrDie(const char* data, size_t len,45tensorflow::GraphDef* param);4647}48}4950#endif51#endif525354