]> Gitweb @ Texas Instruments - Open Source Git Repositories - git.TI.com/gitweb - jacinto-ai/caffe-jacinto.git/blob - src/caffe/util/io.hpp
90617be1e67823d8096a3aedd4e1ac52e247df5d
[jacinto-ai/caffe-jacinto.git] / src / caffe / util / io.hpp
1 // Copyright Yangqing Jia 2013
3 #ifndef CAFFE_UTIL_IO_H_
4 #define CAFFE_UTIL_IO_H_
6 #include <google/protobuf/message.h>
8 #include <string>
10 #include "caffe/proto/caffe.pb.h"
12 using std::string;
14 namespace caffe {
16 void ReadImageToProto(const string& filename, BlobProto* proto);
17 void WriteProtoToImage(const string& filename, const BlobProto& proto);
19 void ReadProtoFromTextFile(const char* filename,
20     ::google::protobuf::Message* proto);
21 inline void ReadProtoFromTextFile(const string& filename,
22     ::google::protobuf::Message* proto) {
23   ReadProtoFromTextFile(filename.c_str(), proto);
24 }
26 }  // namespace caffe
28 #endif   // CAFFE_UTIL_IO_H_