**Tengine Lite** is developed by **OPEN AI LAB**. This project implements the**fast** and **efficient** deployment of deep learning neural network models on embedded devices. In order to achieve cross-platform deployment in many **AIoT** applications, this project is based on the original Tengine project using **C language** for reconstruction, and deep frame tailoring for the characteristics of limited embedded device resources. Also, it adopts a completely separated front-end/back-end design, which makes it possible to be transplanted and deployed onto CPU, GPU, NPU and other heterogeneous computing units rapidly, conveniently. At the same time, it is compatible with the original API and model format `tmfile` of **Tengine**, which reduces the cost of evaluation and migration.
**Tengine Lite** is developed by **[OPEN AI LAB](http://www.openailab.com)**. This project meet the demand of**fast** and **efficient** deployment of deep learning neural network models on embedded devices. In order to achieve cross-platform deployment in many **AIoT** applications, this project is based on the original Tengine project using **C language** for reconstruction, and deep frame tailoring for the characteristics of limited embedded device resources. Also, it adopts a completely separated front-end/back-end design, which makes it possible to be transplanted and deployed onto CPU, GPU, NPU and other heterogeneous computing units rapidly, conveniently. At the same time, it is compatible with the original API and model format `tmfile` of **Tengine**, which reduces the cost of evaluation and migration.
...
@@ -25,6 +25,7 @@ The core code of Tengine Lite consists of 4 modules:
...
@@ -25,6 +25,7 @@ The core code of Tengine Lite consists of 4 modules:
## Architecture
## Architecture
![Tengine Lite 架构](doc/architecture.png)
![Tengine Lite 架构](doc/architecture.png)
...
@@ -40,7 +41,7 @@ The core code of Tengine Lite consists of 4 modules:
...
@@ -40,7 +41,7 @@ The core code of Tengine Lite consists of 4 modules:
### Model Zoo
### Model Zoo
-[Tengine model zoo](https://pan.baidu.com/s/1Ar9334MPeIV1eq4pM1eI-Q) Model zoo samples are compatible with the original Tengine (password: hhgc).
-[Tengine model zoo](https://pan.baidu.com/s/1Ar9334MPeIV1eq4pM1eI-Q) Model zoo samples are compatible with the original Tengine (password: _hhgc_).
### Model Convert tool
### Model Convert tool
...
@@ -50,7 +51,7 @@ The core code of Tengine Lite consists of 4 modules:
...
@@ -50,7 +51,7 @@ The core code of Tengine Lite consists of 4 modules:
### Speed assessment
### Speed assessment
-[Benchmark](benchmark/) Basic network speed assessment tool, any pull request is welcomed.
-[Benchmark](benchmark/) Basic network speed assessment tool, any pull request is welcomed.
## Roadmap
## Roadmap
...
@@ -69,7 +70,7 @@ Tengine Lite got ideas and developed based on these projects:
...
@@ -69,7 +70,7 @@ Tengine Lite got ideas and developed based on these projects:
Tengine Lite is compatible with original Tengine's C API. Here we demonstrate how to run MobileNet v1 via tm_classification example code, providing image classification functionality. This would help you get involve with Tengine Lite C API. We use the popular tiger cat image for test.
Model files can be found here: [Tengine model zoo](https://pan.baidu.com/s/1Ar9334MPeIV1eq4pM1eI-Q), which are compatible with original Tengine example models(password:_hhgc_)。
### Reference Code
[tm_classification.c](tm_classification.c)
### Compilation
build.sh compiles example folders demo programs on default. Take x86 platform as example, the compilation generated demos are stored in `./build/install/bin/` folder.
```bash
bug1989@DESKTOP-SGN0H2A:/mnt/d/ubuntu/gitlab/build-linux$ tree install
install
├── bin
│ ├── cpp_tm_classification
│ ├── cpp_tm_mobilenet_ssd
│ ├── tm_benchmark
│ ├── tm_classification
│ ├── tm_classification_fp16
│ ├── tm_classification_uint8
│ ├── tm_classification_vulkan
│ ├── tm_crnn
│ ├── tm_landmark
│ ├── tm_landmark_uint8
│ ├── tm_mobilefacenet
│ ├── tm_mobilenet_ssd
│ ├── tm_mobilenet_ssd_acl
│ ├── tm_mobilenet_ssd_uint8
│ ├── tm_openpose
│ ├── tm_retinaface
│ ├── tm_yolact
│ ├── tm_yolov3_tiny
│ ├── tm_yolov3_uint8
│ ├── tm_yolov4
│ └── tm_yolov4_tiny
├── include
│ └── tengine_c_api.h
└── lib
└── libtengine-lite.so
```
### Running Result
Put testing images and models under root folder of Tengine-Lite project, and run it:
Repeat 1 times, thread 1, avg time 15350.25 ms, max_time 15350.25 ms, min_time 15350.25 ms
--------------------------------------
KeyPoints Coordinate:
0:[292.174, 55.6522]
1:[306.087, 125.217]
2:[250.435, 139.13]
3:[236.522, 222.609]
4:[222.609, 306.087]
5:[361.739, 125.217]
6:[403.478, 208.696]
7:[417.391, 292.174]
8:[264.348, 306.087]
9:[264.348, 431.304]
10:[264.348, 570.435]
11:[347.826, 306.087]
12:[375.652, 431.304]
13:[333.913, 542.609]
14:[278.261, 41.7391]
15:[306.087, 41.7391]
16:[264.348, 55.6522]
17:[320, 55.6522]
```
![](https://s1.ax1x.com/2020/09/01/dvJ2x1.jpg)
![](https://s1.ax1x.com/2020/09/01/dvJxZ8.jpg)
The result of human pose estimation will be saved as images, whose names are: `Output-Keypionts.jpg` and `Output-Skeleton.jpg`.
## Chinese character recognition task - [tm_crnn.cpp](tm_crnn.cpp)
Folder structure: create `model` directory under project root directory, and download corresponding model and testing image files from [Tengine model zoo](https://pan.baidu.com/s/1Ar9334MPeIV1eq4pM1eI-Q)(password:_hhgc_) there. Specifically, `crnn_lite_dense.tmfile` as model file, `o2_resize.jpg` as testing image, `keys.txt` as font file. Then we execute: