ncnn
ncnn is a high-performance neural network inference framework optimized for the mobile platform
Science Score: 54.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
✓Committers with academic emails
5 of 334 committers (1.5%) from academic institutions -
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (11.4%) to scientific vocabulary
Keywords
Keywords from Contributors
Repository
ncnn is a high-performance neural network inference framework optimized for the mobile platform
Basic Info
Statistics
- Stars: 21,976
- Watchers: 570
- Forks: 4,313
- Open Issues: 1,146
- Releases: 46
Topics
Metadata Files
README.md

ncnn
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, creating intelligent APPs, and bringing 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 (超多大佬) 答案:卷卷卷卷卷(已满) |
Telegram Group
|
Discord Channel
|
|
Pocky QQ 群(MLIR YES!) 677104663 (超多大佬) 答案:multi-level intermediate representation |
||
|
他们都不知道 pnnx 有多好用群 818998520 (新群!) |
Download & Build status
https://github.com/Tencent/ncnn/releases/latest
|
**[how to build ncnn library](https://github.com/Tencent/ncnn/wiki/how-to-build) on Linux / Windows / macOS / Raspberry Pi3, Pi4 / POWER / Android / NVIDIA Jetson / iOS / WebAssembly / AllWinner D1 / Loongson 2K1000** | ||
| Source |
[ |
||
|
- [Build for Android](https://github.com/Tencent/ncnn/wiki/how-to-build#build-for-android) - [Build for Termux on Android](https://github.com/Tencent/ncnn/wiki/how-to-build#build-for-termux-on-android) | ||
| Android |
[ |
[ |
|
| Android shared |
[ |
||
|
|
- [Build for HarmonyOS with cross-compiling](https://github.com/Tencent/ncnn/wiki/how-to-build#build-for-harmonyos-with-cross-compiling) | ||
| HarmonyOS |
[ |
||
| HarmonyOS shared | |||
|
- [Build for iOS on macOS with xcode](https://github.com/Tencent/ncnn/wiki/how-to-build#build-for-ios-on-macos-with-xcode) | ||
| iOS |
[ |
[ |
|
| iOS-Simulator |
[ |
||
|
- [Build for macOS](https://github.com/Tencent/ncnn/wiki/how-to-build#build-for-macos) | ||
| macOS |
[ |
[ |
|
| Mac-Catalyst |
[ |
[ |
|
| watchOS |
[ |
[ |
|
| watchOS-Simulator |
[ |
||
| tvOS |
[ |
[ |
|
| tvOS-Simulator |
[ |
||
| visionOS |
[ |
[ |
|
| visionOS-Simulator |
[ |
||
| Apple xcframework |
[ |
||
|
- [Build for Linux / NVIDIA Jetson / Raspberry Pi3, Pi4 / POWER](https://github.com/Tencent/ncnn/wiki/how-to-build#build-for-linux) | ||
| Ubuntu 22.04 |
[ |
[ |
|
| Ubuntu 24.04 |
[ |
||
|
- [Build for Windows x64 using VS2017](https://github.com/Tencent/ncnn/wiki/how-to-build#build-for-windows-x64-using-visual-studio-community-2017) - [Build for Windows x64 using MinGW-w64](https://github.com/Tencent/ncnn/wiki/how-to-build#build-for-windows-x64-using-mingw-w64) | ||
| VS2015 |
[ |
[ |
|
| VS2017 |
[ |
||
| VS2019 |
[ |
||
| VS2022 |
[ |
||
|
- [Build for WebAssembly](https://github.com/Tencent/ncnn/wiki/how-to-build#build-for-webassembly) | ||
| WebAssembly |
[ |
[ |
|
|
|
- [Build for ARM Cortex-A family with cross-compiling](https://github.com/Tencent/ncnn/wiki/how-to-build#build-for-arm-cortex-a-family-with-cross-compiling) - [Build for Hisilicon platform with cross-compiling](https://github.com/Tencent/ncnn/wiki/how-to-build#build-for-hisilicon-platform-with-cross-compiling) - [Build for AllWinner D1](https://github.com/Tencent/ncnn/wiki/how-to-build#build-for-allwinner-d1) - [Build for Loongson 2K1000](https://github.com/Tencent/ncnn/wiki/how-to-build#build-for-loongson-2k1000) - [Build for QNX](https://github.com/Tencent/ncnn/wiki/how-to-build#build-for-qnx) | ||
| Linux (arm) |
[ |
||
| Linux (aarch64) |
[ |
||
| Linux (mips) |
[ |
||
| Linux (mips64) |
[ |
||
| Linux (ppc64) |
[ |
||
| Linux (riscv64) |
[ |
||
| Linux (loongarch64) |
[ |
||
Support most commonly used CNN network
支持大部分常用的 CNN 网络
- Classical CNN: VGG AlexNet GoogleNet Inception ...
- Practical CNN: ResNet DenseNet SENet FPN ...
- Light-weight CNN: SqueezeNet MobileNetV1 MobileNetV2/V3 ShuffleNetV1 ShuffleNetV2 MNasNet ...
- Face Detection: MTCNN RetinaFace scrfd ...
- Detection: VGG-SSD MobileNet-SSD SqueezeNet-SSD MobileNetV2-SSDLite MobileNetV3-SSDLite ...
- Detection: Faster-RCNN R-FCN ...
- Detection: YOLOv2 YOLOv3 MobileNet-YOLOv3 YOLOv4 YOLOv5 YOLOv7 YOLOX YOLOv8 ...
- Detection: NanoDet
- Segmentation: FCN PSPNet UNet YOLACT ...
- Pose Estimation: SimplePose ...
HowTo
use ncnn with alexnet with detailed steps, recommended for beginners :)
ncnn 组件使用指北 alexnet 附带详细步骤,新人强烈推荐 :)
use netron for ncnn model visualization
ncnn param and model file spec
ncnn operation param weight table
how to implement custom layer step by step
FAQ
ncnn deepwiki LLM Answering Questions ;)
Features
- Supports convolutional neural networks, supports multiple input and multi-branch structure, can calculate part of the branch
- No third-party library dependencies, does not rely on BLAS / NNPACK or any other computing framework
- Pure C++ implementation, cross-platform, supports Android, iOS and so on
- ARM NEON assembly level of careful optimization, calculation speed is extremely high
- Sophisticated memory management and data structure design, very low memory footprint
- Supports multi-core parallel computing acceleration, ARM big.LITTLE CPU scheduling optimization
- Supports GPU acceleration via the next-generation low-overhead Vulkan API
- Extensible model design, supports 8bit quantization and half-precision floating point storage, can import caffe/pytorch/mxnet/onnx/darknet/keras/tensorflow(mlir) models
- Support direct memory zero copy reference load network model
- Can be registered with custom layer implementation and extended
- Well, it is strong, not afraid of being stuffed with 卷 QvQ
功能概述
- 支持卷积神经网络,支持多输入和多分支结构,可计算部分分支
- 无任何第三方库依赖,不依赖 BLAS/NNPACK 等计算框架
- 纯 C++ 实现,跨平台,支持 Android / iOS 等
- ARM Neon 汇编级良心优化,计算速度极快
- 精细的内存管理和数据结构设计,内存占用极低
- 支持多核并行计算加速,ARM big.LITTLE CPU 调度优化
- 支持基于全新低消耗的 Vulkan API GPU 加速
- 可扩展的模型设计,支持 8bit 量化 和半精度浮点存储,可导入 caffe/pytorch/mxnet/onnx/darknet/keras/tensorflow(mlir) 模型
- 支持直接内存零拷贝引用加载网络模型
- 可注册自定义层实现并扩展
- 恩,很强就是了,不怕被塞卷 QvQ
supported platform matrix
- ✅ = known work and runs fast with good optimization
- ✔️ = known work, but speed may not be fast enough
- ❔ = shall work, not confirmed
- / = not applied
| | 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
- https://github.com/nihui/ncnn-android-squeezenet
- https://github.com/nihui/ncnn-android-styletransfer
- https://github.com/nihui/ncnn-android-mobilenetssd
- https://github.com/moli232777144/mtcnn_ncnn
- https://github.com/nihui/ncnn-android-yolov5
- https://github.com/xiang-wuu/ncnn-android-yolov7
- https://github.com/nihui/ncnn-android-scrfd 🤩
- https://github.com/shaoshengsong/qt_android_ncnn_lib_encrypt_example






https://github.com/mizu-bai/ncnn-fortran Call ncnn from Fortran
https://github.com/k2-fsa/sherpa Use ncnn for real-time speech recognition (i.e., speech-to-text); also support embedded devices and provide mobile Apps (e.g., Android App)
License
Owner
- Name: Tencent
- Login: Tencent
- Kind: organization
- Location: Shenzhen, China
- Website: https://opensource.tencent.com
- Repositories: 177
- Profile: https://github.com/Tencent
Citation (CITATION.cff)
cff-version: 1.2.0
title: ncnn
message: >-
If you use this software, please cite it using the
metadata from this file.
type: software
authors:
- family-names: "Ni"
given-names: "Hui"
- name: "The ncnn contributors"
abstract: >-
ncnn is a high-performance neural network inference
computing framework optimized for mobile platforms.
date-released: 2017-06-30
keywords:
- "neural network"
- "artificial intelligence"
- "deep learning"
- android
- ios
- windows
- linux
- macos
- pnnx
- simd
- vulkan
- riscv
- x86
- arm
- mips
- loongarch
license: BSD-3-Clause
repository-code: "https://github.com/Tencent/ncnn"
Committers
Last synced: 9 months ago
Top Committers
| Name | Commits | |
|---|---|---|
| nihuini | n****i@t****m | 2,413 |
| Zhuo Zhang | i****o@f****m | 71 |
| dependabot[bot] | 4****] | 67 |
| BUG1989 | 2****8@q****m | 41 |
| tpoisonooo | k****n@a****m | 35 |
| Evgeny Proydakov | e****v@g****m | 32 |
| zhiliu6 | z****6@g****m | 30 |
| ncnnnnn | 6****n | 28 |
| Cai Shanli | c****5@g****m | 25 |
| kalcohol | 3****0@q****m | 16 |
| Tijmen Verhulsdonck | T****n | 16 |
| 張小凡 | 2****b | 15 |
| Kenji Mouri | M****o@O****m | 14 |
| Yoh | 5****2@q****m | 13 |
| teng | 1****g | 13 |
| Xavier Hsinyuan | me@l****m | 11 |
| JeremyRand | 2****d | 9 |
| Leo | l****o@n****n | 9 |
| Howave | m****g@g****m | 9 |
| Guoxia Wang | m****u@g****m | 8 |
| Lry89757 | 7****7 | 8 |
| daquexian | d****6@g****m | 8 |
| FeiGeChuanShu | 7****8@q****m | 8 |
| Zhiqiang Wang | z****g@o****m | 7 |
| Gemfield | g****d@c****n | 7 |
| Sungmann Cho | s****o@n****m | 7 |
| WuJinxuan | 2****8@q****m | 6 |
| Zhang Geng | 3****0@q****m | 6 |
| ShuangLiu1992 | S****2 | 6 |
| Hyungsuk Yoon | y****r@g****m | 6 |
| and 304 more... | ||
Committer Domains (Top 20 + Academic)
Issues and Pull Requests
Last synced: 6 months ago
All Time
- Total issues: 964
- Total pull requests: 965
- Average time to close issues: 11 months
- Average time to close pull requests: 20 days
- Total issue authors: 672
- Total pull request authors: 153
- Average comments per issue: 2.65
- Average comments per pull request: 1.55
- Merged pull requests: 697
- Bot issues: 0
- Bot pull requests: 55
Past Year
- Issues: 244
- Pull requests: 474
- Average time to close issues: about 1 month
- Average time to close pull requests: 6 days
- Issue authors: 158
- Pull request authors: 47
- Average comments per issue: 1.3
- Average comments per pull request: 1.32
- Merged pull requests: 319
- Bot issues: 0
- Bot pull requests: 27
Top Authors
Issue Authors
- nihui (50)
- Baiyuetribe (19)
- 408550969 (9)
- xalteropsx (8)
- Stevenanthony21b (8)
- csukuangfj (8)
- zengjie617789 (7)
- xiaozhi003 (6)
- HuPengsheet (6)
- Mactarvish (6)
- zhang0557kui (5)
- wuhongsheng (5)
- ljdang (5)
- qiu-pinggaizi (4)
- whyb (4)
Pull Request Authors
- nihui (645)
- dependabot[bot] (72)
- Baiyuetribe (22)
- whyb (21)
- Shironana817 (20)
- zchrissirhcz (15)
- quink-black (15)
- futz12 (15)
- Qi-qi0317 (12)
- AtomAlpaca (12)
- MollySophia (12)
- brightening-eyes (10)
- w8501 (9)
- chainsx (9)
- tpoisonooo (9)
Top Labels
Issue Labels
Pull Request Labels
Packages
- Total packages: 3
-
Total downloads:
- pypi 96,326 last-month
- homebrew 228 last-month
- Total docker downloads: 36,844
-
Total dependent packages: 1
(may contain duplicates) -
Total dependent repositories: 1
(may contain duplicates) - Total versions: 74
- Total maintainers: 2
pypi.org: ncnn
ncnn is a high-performance neural network inference framework optimized for the mobile platform
- Homepage: https://github.com/Tencent/ncnn
- Documentation: https://ncnn.readthedocs.io/
- License: BSD-3
-
Latest release: 1.0.20250503
published 10 months ago
Rankings
Maintainers (1)
formulae.brew.sh: ncnn
High-performance neural network inference framework
- Homepage: https://github.com/Tencent/ncnn
- License: BSD-3-Clause
-
Latest release: 20250503
published 10 months ago
Rankings
pypi.org: pnnx
pnnx is an open standard for PyTorch model interoperability.
- Homepage: https://github.com/Tencent/ncnn/tree/master/tools/pnnx
- Documentation: https://pnnx.readthedocs.io/
- License: BSD-3
-
Latest release: 0.0.4
published over 2 years ago
Rankings
Dependencies
- actions/checkout v4 composite
- actions/checkout v4 composite
- actions/checkout v4 composite
- actions/checkout v4 composite
- actions/checkout v4 composite
- actions/checkout v4 composite
- actions/checkout v4 composite
- actions/checkout v4 composite
- actions/cache v3 composite
- actions/checkout v4 composite
- stefanzweifel/git-auto-commit-action v4 composite
- actions/checkout v4 composite
- github/codeql-action/analyze v2 composite
- github/codeql-action/autobuild v2 composite
- github/codeql-action/init v2 composite
- actions/checkout v4 composite
- actions/checkout v4 composite
- actions/cache v3 composite
- actions/checkout v4 composite
- actions/cache v3 composite
- actions/checkout v4 composite
- actions/cache v3 composite
- actions/checkout v4 composite
- actions/cache v3 composite
- actions/checkout v4 composite
- actions/cache v3 composite
- actions/checkout v4 composite
- actions/cache v3 composite
- actions/checkout v4 composite
- actions/checkout v4 composite
- actions/cache v3 composite
- actions/checkout v4 composite
- actions/cache v3 composite
- actions/checkout v4 composite
- actions/cache v3 composite
- actions/checkout v4 composite
- actions/cache v3 composite
- actions/checkout v4 composite
- actions/checkout v4 composite
- actions/checkout v4 composite
- actions/setup-python v4 composite
- actions/checkout v4 composite
- actions/checkout v4 composite
- jirutka/setup-alpine v1 composite
- actions/checkout v4 composite
- actions/checkout v4 composite
- petarpetrovt/setup-sde v2 composite
- actions/checkout v4 composite
- actions/cache v3 composite
- actions/checkout v4 composite
- actions/setup-python v4 composite
- actions/cache v3 composite
- actions/checkout v4 composite
- actions/cache v3 composite
- actions/checkout v4 composite
- actions/checkout v4 composite
- actions/checkout v4 composite
- actions/cache v3 composite
- actions/checkout v4 composite
- actions/cache v3 composite
- actions/checkout v4 composite
- actions/cache v3 composite
- actions/checkout v4 composite
- actions/cache v3 composite
- actions/checkout v4 composite
- actions/cache v3 composite
- actions/checkout v4 composite
- actions/cache v3 composite
- actions/checkout v4 composite
- actions/cache v3 composite
- actions/checkout v4 composite
- actions/setup-python v4 composite
- actions/cache v3 composite
- actions/checkout v4 composite
- actions/cache v3 composite
- actions/checkout v4 composite
- actions/checkout v4 composite
- actions/download-artifact v3 composite
- actions/setup-python v4 composite
- actions/upload-artifact v3 composite
- docker/setup-qemu-action v3 composite
- pypa/cibuildwheel v2.15.0 composite
- pypa/gh-action-pypi-publish release/v1 composite
- actions/cache v3 composite
- actions/checkout v4 composite
- actions/download-artifact v3 composite
- actions/upload-artifact v3 composite
- softprops/action-gh-release v1 composite
- actions/checkout v4 composite
- actions/checkout v4 composite
- codecov/codecov-action v3 composite
- petarpetrovt/setup-sde v2 composite
- actions/checkout v4 composite
- actions/checkout v4 composite
- actions/checkout v4 composite
- actions/checkout v4 composite
- actions/setup-python v4 composite
- actions/cache v3 composite
- actions/checkout v4 composite
- actions/cache v3 composite
- actions/checkout v4 composite
- actions/checkout v4 composite
- numpy *
- opencv-python *
- portalocker *
- requests *
- tqdm *
