mapnn is designed to combine the strengths of different high-performance neutral network, such as ncnn, MNN or Tengine. With this framework, one can easily test the performance of each kernel from different inference frameworks. Of cause, this framework provide a simple method that map some operator(defined by training) to kernel(defined by inference). So that user given the ability to choose the best kernel for inference task throught the map.
- caffe: alexnet, googlenet inceptionv3/v4 mobilenetv1/v2, resnet, vgg16
- onnx : alexnet, googlenet inceptionv1/v2 mobilenetv2, resnet, vgg16, shufflenet1.1, yolov2
System | armv7 | armv8 | x86 | amd64 |
---|---|---|---|---|
Ubuntu(GCC) | — | — | — | |
Ubuntu(Clang) | — | — | — | |
Linux | — | — | ||
Windows(MSVC) | — | — | ||
Android | ||||
MacOS(Clang) | — | — | — |
- Build for Linux-x86-64
- Build for Linux-armv7l
- Build for Linux-armv7hl
- Build for android-v7a
- Build for android-v8a
According to the step 4, Compiling and install this library with your toolchain. And copy(if need) the layer_test to your platform. Then run ther layer_test to get perf.txt.
./layer_test conv -h
# Usage: layer_test conv -k 3 -s 3 -c 1 -g 2
# Option:
# -k kernel INT
# -s stride INT
# -c cycle INT
# -g gap INT
# -o output INT
# -h this help
The following show some kernels benchmark(up picture) and corresponding accuracy(down picture).
- raspebery pi3B+ (right for conv3x3s1, left for conv3x3s2)
- SDM855 arm32 (right for conv3x3s1, left for conv3x3s2)
- SDM855 arm64 (right for conv3x3s1, left for conv3x3s2)
- intel 10700k x86-64 (right for conv3x3s1, left for conv3x3s2)
node: This benchmark not means benchmark of different CNN frameworks.
int ret;
mapnn::Net* net = new mapnn::Net(); // new object
ret = net->load("model_path.onnx"); // load model
//ret = net->load("model_path.proto", "model_path.caffemodel");
ret = net->prepare(3, 224, 224); // prepare net
ret = net->inference(float_data, 3, 224, 224); // inference
Tensor& output = net->getTensor("output_name");
delete net;
- Add new operation from other training frameworks.
- Add new kernel from other inference frameworks.
- Improve frameworks and do good pull Request.
- Fix and Report the issue on the Github issues page.
- Star or fork this project.
notice A: if you contribute a good code, please append(or apply for new code) the follow boilerplate notice to your code: Copyright [yyyy] [name of copyright owner]
notice B: mapnn include some third party libraries as following: