ONE - On-device Neural Engine
Loading...
Searching...
No Matches
caffe2circle.cpp File Reference
#include <caffe_importer.h>
#include <mir2loco.h>
#include <exo/CircleExporter.h>
#include <cstdlib>
#include <iostream>

Go to the source code of this file.

Functions

int main (int argc, char *argv[])
 

Function Documentation

◆ main()

int main ( int  argc,
char *  argv[] 
)

Definition at line 24 of file caffe2circle.cpp.

25{
26 if (argc != 3)
27 {
28 std::cerr << "Usage: caffe2circle <path/to/caffe/model> <path/to/circle/model>\n";
29 return EXIT_FAILURE;
30 }
31
32 const char *caffe_path = argv[1];
33 const char *circle_path = argv[2];
34
35 std::unique_ptr<mir::Graph> mir_graph = mir_caffe::importModelFromBinaryFile(caffe_path);
36 std::unique_ptr<loco::Graph> loco_graph = mir2loco::Transformer().transform(mir_graph.get());
37 exo::CircleExporter(loco_graph.get()).dumpToFile(circle_path);
38 return EXIT_SUCCESS;
39}
void dumpToFile(const char *path) const
write to a file
std::unique_ptr< loco::Graph > transform(mir::Graph *mir_graph)
Definition mir2loco.cpp:710
std::unique_ptr< mir::Graph > importModelFromBinaryFile(const std::string &filename)

References exo::CircleExporter::dumpToFile(), mir_caffe::importModelFromBinaryFile(), and mir2loco::Transformer::transform().