NCNN

ncnn

License Download Total Count codecov Language grade: C/C++

ncnn is a high-performance neural network inference computing framework optimized for mobile platforms. ncnn is deeply considerate about deployment and uses on mobile phones from the beginning of design. ncnn does not have third party dependencies. It is cross-platform, and runs faster than all known open source frameworks on mobile phone cpu. Developers can easily deploy deep learning algorithm models to the mobile platform by using efficient ncnn implementation, create intelligent APPs, and bring the artificial intelligence to your fingertips. ncnn is currently being used in many Tencent applications, such as QQ, Qzone, WeChat, Pitu and so on.

ncnn 是一个为手机端极致优化的高性能神经网络前向计算框架。 ncnn 从设计之初深刻考虑手机端的部署和使用。 无第三方依赖,跨平台,手机端 cpu 的速度快于目前所有已知的开源框架。 基于 ncnn,开发者能够将深度学习算法轻松移植到手机端高效执行, 开发出人工智能 APP,将 AI 带到你的指尖。 ncnn 目前已在腾讯多款应用中使用,如:QQ,Qzone,微信,天天 P 图等。


技术交流 QQ 群:637093648 (超多大佬) 答案:卷卷卷卷卷 (已满)

Pocky QQ 群(MLIR YES!): 677104663(超多大佬) 答案:multi-level intermediate representation

Telegram Group https://t.me/ncnnyes

Discord Channel https://discord.gg/YRsxgmF


Current building status matrix

System CPU (32bit) CPU (64bit) GPU (32bit) GPU (64bit)
Linux (GCC) Build Status Build Status — Build Status
Linux (Clang) Build Status Build Status — Build Status
Linux (ARM) Build Status Build Status — —
Linux (MIPS) Build Status Build Status — —
Linux (RISC-V) — Build Status — —
Linux (LoongArch) — Build Status — —
Windows Build Status Build Status — Build Status
Windows (ARM) Build Status Build Status — —
macOS — Build Status — Build Status
macOS (ARM) — Build Status — Build Status
Android Build Status Build Status Build Status Build Status
Android-x86 Build Status Build Status Build Status Build Status
iOS Build Status Build Status — Build Status
iOS Simulator Build Status Build Status — Build Status
WebAssembly Build Status — — —
RISC-V GCC/Newlib Build Status Build Status — —

Support most commonly used CNN network

支持大部分常用的 CNN 网络


HowTo

how to build ncnn library on Linux / Windows / macOS / Raspberry Pi3, Pi4 / POWER / Android / NVIDIA Jetson / iOS / WebAssembly / AllWinner D1 / Loongson 2K1000

download prebuild binary package for android and ios

use ncnn with alexnet with detailed steps, recommended for beginners :)

ncnn 组件使用指北 alexnet 附带详细步骤,新人强烈推荐 :)

use netron for ncnn model visualization

out-of-the-box web model conversion

ncnn low-level operation api

ncnn param and model file spec

ncnn operation param weight table

how to implement custom layer step by step


FAQ

ncnn throw error

ncnn produce wrong result

ncnn vulkan


Features

功能概述


supported platform matrix

Windows Linux Android macOS iOS
intel-cpu ✔️ ✔️ ❔ ✔️ /
intel-gpu ✔️ ✔️ ❔ ❔ /
amd-cpu ✔️ ✔️ ❔ ✔️ /
amd-gpu ✔️ ✔️ ❔ ❔ /
nvidia-gpu ✔️ ✔️ ❔ ❔ /
qcom-cpu ❔ ✔️ ✅ / /
qcom-gpu ❔ ✔️ ✔️ / /
arm-cpu ❔ ❔ ✅ / /
arm-gpu ❔ ❔ ✔️ / /
apple-cpu / / / ✔️ ✅
apple-gpu / / / ✔️ ✔️
ibm-cpu / ✔️ / / /

Project examples

<img src="https://github.com/nihui/ncnn-assets/raw/master/20181217/ncnn-2.jpg" height ="230"/><img src="https://github.com/nihui/ncnn-assets/raw/master/20181217/4.jpg" height ="230"/><img src="https://github.com/nihui/ncnn-assets/raw/master/20181217/ncnn-33.jpg" height ="230"/><img src="https://github.com/nihui/ncnn-assets/raw/master/20181217/ncnn-m.png" height ="230"/><img src="https://github.com/nihui/ncnn-android-yolov5/raw/master/screenshot.jpg" height ="230"/><img src="https://github.com/nihui/ncnn-android-scrfd/raw/master/screenshot.jpg" height ="230"/><br>


License

BSD 3 Clause