All Projects → Tencent → Tnn

Tencent / Tnn

Licence: other
TNN: developed by Tencent Youtu Lab and Guangying Lab, a uniform deep learning inference framework for mobile、desktop and server. TNN is distinguished by several outstanding features, including its cross-platform capability, high performance, model compression and code pruning. Based on ncnn and Rapidnet, TNN further strengthens the support and …

Programming Languages

C++
36643 projects - #6 most used programming language
Objective-C++
1391 projects
python
139335 projects - #7 most used programming language
c
50402 projects - #5 most used programming language
assembly
5116 projects
Cuda
1817 projects

Projects that are alternatives of or similar to Tnn

InferenceHelper
C++ Helper Class for Deep Learning Inference Frameworks: TensorFlow Lite, TensorRT, OpenCV, OpenVINO, ncnn, MNN, SNPE, Arm NN, NNabla, ONNX Runtime, LibTorch, TensorFlow
Stars: ✭ 142 (-95.64%)
Mutual labels:  inference, tensorrt, mnn, ncnn
Ultra Light Fast Generic Face Detector 1mb
💎1MB lightweight face detection model (1MB轻量级人脸检测模型)
Stars: ✭ 6,182 (+89.81%)
Mutual labels:  inference, face-detection, mnn, ncnn
Nanodet
⚡Super fast and lightweight anchor-free object detection model. 🔥Only 980 KB(int8) / 1.8MB (fp16) and run 97FPS on cellphone🔥
Stars: ✭ 3,640 (+11.76%)
Mutual labels:  mnn, ncnn, openvino
gaze-estimation-with-laser-sparking
Deep learning based gaze estimation demo with a fun feature :-)
Stars: ✭ 32 (-99.02%)
Mutual labels:  inference, face-detection, openvino
lite.ai.toolkit
🛠 A lite C++ toolkit of awesome AI models with ONNXRuntime, NCNN, MNN and TNN. YOLOX, YOLOP, MODNet, YOLOR, NanoDet, YOLOX, SCRFD, YOLOX . MNN, NCNN, TNN, ONNXRuntime, CPU/GPU.
Stars: ✭ 1,354 (-58.43%)
Mutual labels:  face-detection, mnn, ncnn
deepvac
PyTorch Project Specification.
Stars: ✭ 507 (-84.43%)
Mutual labels:  tensorrt, coreml, ncnn
FAST-Pathology
⚡ Open-source software for deep learning-based digital pathology
Stars: ✭ 54 (-98.34%)
Mutual labels:  inference, tensorrt, openvino
YOLOv5-Lite
🍅🍅🍅YOLOv5-Lite: lighter, faster and easier to deploy. Evolved from yolov5 and the size of model is only 930+kb (int8) and 1.7M (fp16). It can reach 10+ FPS on the Raspberry Pi 4B when the input size is 320×320~
Stars: ✭ 1,230 (-62.24%)
Mutual labels:  tensorrt, mnn, ncnn
YOLOX
YOLOX is a high-performance anchor-free YOLO, exceeding yolov3~v5 with MegEngine, ONNX, TensorRT, ncnn, and OpenVINO supported. Documentation: https://yolox.readthedocs.io/
Stars: ✭ 6,570 (+101.72%)
Mutual labels:  tensorrt, ncnn, openvino
Mobilenet Yolo
MobileNetV2-YoloV3-Nano: 0.5BFlops 3MB HUAWEI P40: 6ms/img, YoloFace-500k:0.1Bflops 420KB🔥🔥🔥
Stars: ✭ 1,566 (-51.92%)
Mutual labels:  face-detection, mnn, ncnn
Jetson Inference
Hello AI World guide to deploying deep-learning inference networks and deep vision primitives with TensorRT and NVIDIA Jetson.
Stars: ✭ 5,191 (+59.38%)
Mutual labels:  inference, tensorrt
Awesome Ml Demos With Ios
The challenge projects for Inferencing machine learning models on iOS
Stars: ✭ 741 (-77.25%)
Mutual labels:  inference, coreml
Build Ocr
Build an OCR for iOS apps
Stars: ✭ 17 (-99.48%)
Mutual labels:  ocr, coreml
Chineseocr lite
超轻量级中文ocr,支持竖排文字识别, 支持ncnn、mnn、tnn推理 ( dbnet(1.8M) + crnn(2.5M) + anglenet(378KB)) 总模型仅4.7M
Stars: ✭ 8,295 (+154.68%)
Mutual labels:  ocr, ncnn
object-flaw-detector-python
Detect various irregularities of a product as it moves along a conveyor belt.
Stars: ✭ 17 (-99.48%)
Mutual labels:  inference, openvino
Idmatch
Match faces on id cards with OCR capabilities.
Stars: ✭ 52 (-98.4%)
Mutual labels:  ocr, face-detection
Opencv Mtcnn
An implementation of MTCNN Face detector using OpenCV's DNN module
Stars: ✭ 59 (-98.19%)
Mutual labels:  inference, face-detection
Coremlvisionscanner
CoreML Vision Text Data & Animal Detector iOS App
Stars: ✭ 49 (-98.5%)
Mutual labels:  ocr, coreml
Ai Reading Materials
Some of the ML and DL related reading materials, research papers that I've read
Stars: ✭ 79 (-97.57%)
Mutual labels:  ocr, face-detection
Ncnn
ncnn is a high-performance neural network inference framework optimized for the mobile platform
Stars: ✭ 13,376 (+310.68%)
Mutual labels:  inference, ncnn

中文版本

Introduction

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.

Effect Example

Face Detection(blazeface) Object Detection(yolov5s) Face Alignment
(from Tencent Youtu Lab)
Hair Segmentation
(from Tencent Guangying Lab)
face_detection
model link: tflite tnn
yolov5
model link: onnx tnn
youtu_face_alignment
model link: tnn
hair_segmentation
model link: tnn
Pose Estimation
(from Tencent Guangliu)
Pose Estimation
(blazepose)
Chinese OCR Reading Comprehension
skeleton
model link: tnn
blazepose
model link: tflite tnn
chinese-ocr
model link: onnx tnn
bertsquad10
model link: onnx 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)
Pose Estimation(blazepose)
Chinese OCR
Reading Comprehension

Quick Start

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.

  2. 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.

  3. 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.

Technical Solutions

At present, TNN has been launched in various major businesses, and its following characteristics have been widely praised.

  • Computation optimization

    • The backend operators are primely optimized to make the best use of computing power in different architectures, regarding instruction issue, throughput, delay, cache bandwidth, cache delay, registers, etc..
    • The TNN performance on mainstream hardware platforms (CPU: ARMv7, ARMv8, X86, GPU: Mali, Adreno, Apple, NV GPU, NPU) has been greatly tuned and improved.
    • The convolution function is implemented by various algorithms such as Winograd, Tile-GEMM, Direct Conv, etc., to ensure efficiency under different parameters and sizes.
    • Op fusion: TNN can do offline analysis of network graph, fuse multiple simple operations and reduce overhead such as redundant memory access and kernel startup cost.
  • Low precision computation acceleration

    • TNN supports INT8/FP16 mode, reduces model size & memory consumption, and utilizes specific hardware low-precision instructions to accelerate calculations.
    • TNN supports INT8 WINOGRAD algorithm, (input 6bit), further reduces the model calculation complexity without sacrificing the accuracy.
    • TNN supports mixed-precision data in one model, speeding up the model's calculation speed while preserving its accuracy.
  • Memory optimization

    • Efficient "memory pool" implementation: Based on a full network DAG analysis, the implementation reuses memory between non-dependent nodes which reduces memory cost by 90%.
    • Cross-model memory reduces: This supports external real-time design for network memory so that multiple models can share mutual memory.
  • The performance of mainstream models on TNN: benchmark data

  • TNN architecture diagram:

  • TNN supports TensorFlow, Pytorch, MxNet, Caffe, and other training frameworks through ONNX, leveraging the continuous improvement of the ONNX open-source society. Currently, TNN supports 100+ ONNX operators, consisting of most of the mainstream CNN, NLP operators needed.

  • TNN runs on mainstream operating systems (Android, iOS, embedded Linux, Windows, Linux), and is compatible with ARM CPU,X86 GPU, NPU hardware platform.

  • TNN is constructed through Modular Design, which abstracts and isolates components such as model analysis, graph construction, graph optimization, low-level hardware adaptation, and high-performance kernel. It uses "Factory Mode" to register and build devices, that tries to minimize the cost of supporting more hardware and acceleration solutions.

  • The size of the mobile dynamic library is only around 400KB, and it provides basic image conversion operations, which are light-weight and convenient. TNN uses unified models and interfaces across platforms and can switch easily by configuring just one single parameter.

Learn About TNN Abilities

Manual

API Document

Contribute to TNN

Roadmap

Acknowledgement

TNN referenced the following projects:

License

FAQ

Join Us

  • Everyone is welcome to participate to build the best inference framework in the industry.

  • Technical Discussion QQ Group: 913940506 Answer: TNN

  • Scan the QR code to join the TNN discussion group:

Note that the project description data, including the texts, logos, images, and/or trademarks, for each open source project belongs to its rightful owner. If you wish to add or remove any projects, please contact us at [email protected].