--- /dev/null
+#ifndef NNCC_CAFFE_IMPORTER_H
+#define NNCC_CAFFE_IMPORTER_H
+
+#include <string>
+#include <memory>
+
+#include "caffe/proto/caffe.pb.h"
+
+#include "nn_importer.h"
+
+namespace nncc
+{
+namespace contrib
+{
+namespace frontend
+{
+namespace caffe
+{
+
+using namespace ::caffe;
+
+class CaffeImporter : public common::NNImporter
+{
+public:
+ explicit CaffeImporter(std::string filename) : modelFilename(std::move(filename)) {};
+
+ bool import() override;
+ void* createIR() override;
+ void dump() override;
+
+private:
+ std::string modelFilename;
+ std::unique_ptr<NetParameter> net;
+};
+
+} // namespace caffe
+} // namespace frontend
+} // namespace contrib
+} // namespace nncc
+
+#endif // NNCC_CAFFE_IMPORTER_H
--- /dev/null
+#include <fstream>
+#include <sstream>
+
+#include "caffe_walker.h"
+#include "caffe_model_visitor.h"
+#include "caffe_dump_visitor.h"
+#include "caffe_importer.h"
+#include "proto_reader.h"
+
+namespace nncc
+{
+namespace contrib
+{
+namespace frontend
+{
+namespace caffe
+{
+
+bool CaffeImporter::import()
+{
+ GOOGLE_PROTOBUF_VERIFY_VERSION;
+
+ net.reset(new NetParameter());
+
+ // import success flag is returned
+ return util::readProtoFromBinaryFile(modelFilename.c_str(), net.get());
+}
+
+void* CaffeImporter::createIR()
+{
+ ModelVisitor irCreator;
+ ModelWalker caffeWalker(&irCreator);
+
+ caffeWalker.walkNetParameter(*net);
+
+ return irCreator.getGraph();
+}
+
+void CaffeImporter::dump()
+{
+ DumpVisitor dumper;
+ ModelWalker caffeWalker(&dumper);
+
+ caffeWalker.walkNetParameter(*net);
+}
+
+} // namespace caffe
+} // namespace frontend
+} // namespace contrib
+} // namespace nncc