Browse by type

TNN: A high-performance, lightweight neural network inference framework open sourced by Tencent Youtu Lab. It also has many outstanding advantages such as cross-platform, high performance, model compression, and code tailoring. The TNN framework further strengthens the support and performance optimization of mobile devices on the basis of the original Rapidnet and ncnn frameworks. At the same time, it refers to the high performance and good scalability characteristics of the industry's mainstream open source frameworks, and expands the support for X86 and NV GPUs. On the mobile phone, TNN has been used by many applications such as mobile QQ, weishi, and Pitu. As a basic acceleration framework for Tencent Cloud AI, TNN has provided acceleration support for the implementation of many businesses. Everyone is welcome to participate in the collaborative construction to promote the further improvement of the TNN reasoning framework.
Face Detection(blazeface) | Object Detection(yolov5s) | Face Alignment
(from Tencent Youtu Lab) | Hair Segmentation
(from Tencent Guangying Lab)
:-------------------------: | :------: | :------: | :------:
model link: tnn |
model link: tnn
Pose Estimation
(from Tencent Guangliu) | Pose Estimation
(blazepose) | Chinese OCR | Reading Comprehension
:--------------------------: | :------: | :------: | :------:
model link: tnn |
Chinese OCR demo is the TNN implementation of chineseocr_lite project. It is lightweight and supports tilted, rotated and vertical text recognition.
The support for each demo is shown in the following table. You can click the ✅ and find the entrance code for each demo.
demo | ARM | OpenCL | Metal | NPU | X86 | CUDA
:---------------------------------------------------------------------------------------: | :------: | :------: | :------: | :------: | :------: | :------:
Face Detection | ✅ | ✅ | ✅ | ✅ | |
Object Detection | ✅ | ✅ | ✅ | ✅ | |
Face Alignment | ✅ | ✅ | ✅ | ✅ | |
Hair Segmentation | ✅ | ✅ | ✅ | ✅ | |
[Pose Estimation
(from Tencent Guangliu)](https://github.com/Tencent/TNN/blob/master/examples/base/skeleton_detector.cc) | ✅ | ✅ | ✅ | ✅ | | Pose Estimation(blazepose) | ✅ | ✅ | ✅ | ✅ | | | Chinese OCR | ✅ | ✅ | ✅ | | | Reading Comprehension | | | | | ✅ | ✅
It is very simple to use TNN. If you have a trained model, the model can be deployed on the target platform through three steps. 1. Convert the trained model into a TNN model. We provide a wealth of tools to help you complete this step, whether you are using Tensorflow, Pytorch, or Caffe, you can easily complete the conversion. Detailed hands-on tutorials can be found here How to Create a TNN Model.
When you have finished converting the model, the second step is to compile the TNN engine of the target platform. You can choose among different acceleration solutions such as ARM/OpenCL/Metal/NPU/X86/CUDA according to the hardware support. For these platforms, TNN provides convenient one-click scripts to compile. For detailed steps, please refer to How to Compile TNN.
The final step is to use the compiled TNN engine for inference. You can make program calls to TNN inside your application. We provide a rich and detailed demo as a reference to help you complete.
At present, TNN has been launched in various major businesses, and its following characteristics have been widely praised.
Computation optimization
Low precision computation acceleration
Memory optimization
The performance of mainstream models on TNN: benchmark data
TNN architecture diagram:

TNN referenced the following projects: