Skip to main content

ncnn is a high-performance neural network inference framework optimized for the mobile platform

Project description

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
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 / 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

  • 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 / / / ✔️ ✔️

Project examples



License

BSD 3 Clause

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

No source distribution files available for this release.See tutorial on generating distribution archives.

Built Distributions

If you're not sure about the file name format, learn more about wheel file names.

ncnn-1.0.2022.11.28-pp39-pypy39_pp73-macosx_10_9_x86_64.whl (3.3 MB view details)

Uploaded PyPymacOS 10.9+ x86-64

ncnn-1.0.2022.11.28-pp38-pypy38_pp73-macosx_10_9_x86_64.whl (3.3 MB view details)

Uploaded PyPymacOS 10.9+ x86-64

ncnn-1.0.2022.11.28-pp37-pypy37_pp73-macosx_10_9_x86_64.whl (3.3 MB view details)

Uploaded PyPymacOS 10.9+ x86-64

ncnn-1.0.2022.11.28-cp311-cp311-macosx_11_0_arm64.whl (3.3 MB view details)

Uploaded CPython 3.11macOS 11.0+ ARM64

ncnn-1.0.2022.11.28-cp311-cp311-macosx_10_9_x86_64.whl (3.3 MB view details)

Uploaded CPython 3.11macOS 10.9+ x86-64

ncnn-1.0.2022.11.28-cp311-cp311-macosx_10_9_universal2.whl (3.3 MB view details)

Uploaded CPython 3.11macOS 10.9+ universal2 (ARM64, x86-64)

ncnn-1.0.2022.11.28-cp310-cp310-macosx_11_0_arm64.whl (3.3 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

ncnn-1.0.2022.11.28-cp310-cp310-macosx_10_9_x86_64.whl (3.3 MB view details)

Uploaded CPython 3.10macOS 10.9+ x86-64

ncnn-1.0.2022.11.28-cp310-cp310-macosx_10_9_universal2.whl (3.3 MB view details)

Uploaded CPython 3.10macOS 10.9+ universal2 (ARM64, x86-64)

ncnn-1.0.2022.11.28-cp39-cp39-macosx_11_0_arm64.whl (3.3 MB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

ncnn-1.0.2022.11.28-cp39-cp39-macosx_10_9_x86_64.whl (3.3 MB view details)

Uploaded CPython 3.9macOS 10.9+ x86-64

ncnn-1.0.2022.11.28-cp39-cp39-macosx_10_9_universal2.whl (3.3 MB view details)

Uploaded CPython 3.9macOS 10.9+ universal2 (ARM64, x86-64)

ncnn-1.0.2022.11.28-cp38-cp38-macosx_11_0_arm64.whl (3.3 MB view details)

Uploaded CPython 3.8macOS 11.0+ ARM64

ncnn-1.0.2022.11.28-cp38-cp38-macosx_10_9_x86_64.whl (3.3 MB view details)

Uploaded CPython 3.8macOS 10.9+ x86-64

ncnn-1.0.2022.11.28-cp38-cp38-macosx_10_9_universal2.whl (3.3 MB view details)

Uploaded CPython 3.8macOS 10.9+ universal2 (ARM64, x86-64)

ncnn-1.0.2022.11.28-cp37-cp37m-macosx_10_9_x86_64.whl (3.3 MB view details)

Uploaded CPython 3.7mmacOS 10.9+ x86-64

ncnn-1.0.2022.11.28-cp36-cp36m-macosx_10_9_x86_64.whl (3.3 MB view details)

Uploaded CPython 3.6mmacOS 10.9+ x86-64

File details

Details for the file ncnn-1.0.2022.11.28-pp39-pypy39_pp73-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for ncnn-1.0.2022.11.28-pp39-pypy39_pp73-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 ca19dc8ebea4122e423d4f6df52798621c0ee6d6a1506ccc83d3f21ceebb22cb
MD5 e1995e648b2b00dce77a32730a7dacf6
BLAKE2b-256 ea5b2c141ab292a6d480fc84091ccc33326b21400aa984a4f3b7005e5a5728a9

See more details on using hashes here.

File details

Details for the file ncnn-1.0.2022.11.28-pp38-pypy38_pp73-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for ncnn-1.0.2022.11.28-pp38-pypy38_pp73-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 88f1cb36b245b7e5b0122dcfc39b11f878d17a683e5e9a6348ac69f18ea323bc
MD5 8243eb7442cf1f42452fb4e55663b337
BLAKE2b-256 8aea03ff5a8b14d1e76b2537e4a1b36a53029517cb7f04fca903473486a70b87

See more details on using hashes here.

File details

Details for the file ncnn-1.0.2022.11.28-pp37-pypy37_pp73-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for ncnn-1.0.2022.11.28-pp37-pypy37_pp73-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 cec1637a442e9bb495a1b9251613c44e79d418a7b13f25499b9101d171eb1c68
MD5 49084f62b9f04a7e51a1dc4f14ec449a
BLAKE2b-256 391ad1fb2e3446926b73d8dd8c782e8be3e594669ad1e522a872a2d3c7d2bf33

See more details on using hashes here.

File details

Details for the file ncnn-1.0.2022.11.28-cp311-cp311-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ncnn-1.0.2022.11.28-cp311-cp311-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 bb19127ba7218db31f6d197ab22265aceceb50c60b9de3aec43cfa3c46759188
MD5 1e3efcb5f1bb7280635188d3cad61460
BLAKE2b-256 8481001e2fba420b8c67fa6676b99fa870d5e5dcdb53e10ede2e127cea39a52a

See more details on using hashes here.

File details

Details for the file ncnn-1.0.2022.11.28-cp311-cp311-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for ncnn-1.0.2022.11.28-cp311-cp311-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 3b61bca8dd1782ae06d3b03f66407c199ab1a3d7b3184a132e50080e01852f28
MD5 47395a5c1a395f2e5bef27820f07bceb
BLAKE2b-256 0e6d80b3885221eda0da4a2cf9171b328d13476eebac3b4862cf416dd661c7dc

See more details on using hashes here.

File details

Details for the file ncnn-1.0.2022.11.28-cp311-cp311-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for ncnn-1.0.2022.11.28-cp311-cp311-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 10c4312b6941f2cc9a494907da63cdaee9b21a534c1e62fea3c0fe8c391e31db
MD5 d3918ecd109406afc3b1d7efa78896b7
BLAKE2b-256 b737de289e37941a6b5f576b35c7f16cc0ef0540ac502939cbe1d44934d8a3c7

See more details on using hashes here.

File details

Details for the file ncnn-1.0.2022.11.28-cp310-cp310-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ncnn-1.0.2022.11.28-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 713d03347907a12b40bb4f93c8ba0f279d7f6fbab07629200f3269b902d2c720
MD5 202d222f7b5f083466acd631ae9ec12a
BLAKE2b-256 b254fc13b8163b51bc3a0a7a2fc92fbe93663058b0c0b5aa64f6daf051a92c2c

See more details on using hashes here.

File details

Details for the file ncnn-1.0.2022.11.28-cp310-cp310-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for ncnn-1.0.2022.11.28-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 df8d1af4d4e6b24024c13836bcf1511aaa02fda10deb4a202be05c86db622eb6
MD5 78b1772c792272fac0494de2f0b357a1
BLAKE2b-256 9b2b65902608e1ebf74e233c80a8cf54e2112c68f57d7bba36185693f3d93a60

See more details on using hashes here.

File details

Details for the file ncnn-1.0.2022.11.28-cp310-cp310-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for ncnn-1.0.2022.11.28-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 216a9ebf023fe6e61673029f2cdc0aaf4a7b27554ff16254fb95f8ff43796b2a
MD5 128fc31583f1e36b3a8490da1b974511
BLAKE2b-256 6e39b3ac7be0f6f4f5933675942a0108cbc073541bdf6208a667e6a45a8797e1

See more details on using hashes here.

File details

Details for the file ncnn-1.0.2022.11.28-cp39-cp39-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ncnn-1.0.2022.11.28-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 2a60b1177888e7987c865ebb9c43a729a4ece84eaa64ed6c91474d5622af092e
MD5 af3c656515dd9faf8d8f018eb3b4edfa
BLAKE2b-256 39d7a923d060927f9cd8679c09c68201635ea8ddaf942e0055dc2fbaa0f819a2

See more details on using hashes here.

File details

Details for the file ncnn-1.0.2022.11.28-cp39-cp39-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for ncnn-1.0.2022.11.28-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 0cdb7db12182099641f74b3cd50aaf0080c7ce18ca22bb5ca01ee29cef1ee793
MD5 6f140832826b085e1c2484347eddb737
BLAKE2b-256 55ffc4ba2ef7e745922c682a9dc471969c4ecec863f8784b636b9a7d2ff3882d

See more details on using hashes here.

File details

Details for the file ncnn-1.0.2022.11.28-cp39-cp39-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for ncnn-1.0.2022.11.28-cp39-cp39-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 ec61054ed643db9f8465308e602d8f34ff264357b7e3f02669ed1eb039123824
MD5 54e9290974a2355483190fc6ce283258
BLAKE2b-256 792ec2174344225b2890976fabfe242f0af82be91e94f64d1adbd84b1f1bdcc7

See more details on using hashes here.

File details

Details for the file ncnn-1.0.2022.11.28-cp38-cp38-macosx_11_0_arm64.whl.

File metadata

File hashes

Hashes for ncnn-1.0.2022.11.28-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 cd15829941c2649c25f78df468fd8d9b23972563d2cc454da2a907ec19c3f98e
MD5 b9a3cae468b5fa6b22a04f9e60952f72
BLAKE2b-256 5314315cfced7d1e9a7f1c1ac82372ad61cf81d263a97b5566d15a1eaf45472d

See more details on using hashes here.

File details

Details for the file ncnn-1.0.2022.11.28-cp38-cp38-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for ncnn-1.0.2022.11.28-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 05ddd48927caceb8c2fb7713c519ae065425cf206fc8eb2c4c0c23920708d753
MD5 9cb91cdd55bc9656401724d430bab215
BLAKE2b-256 55d855830937085b306387511651cc148cae327c30bf1c6661ddd86e5d16b9a0

See more details on using hashes here.

File details

Details for the file ncnn-1.0.2022.11.28-cp38-cp38-macosx_10_9_universal2.whl.

File metadata

File hashes

Hashes for ncnn-1.0.2022.11.28-cp38-cp38-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 46819cd19555341b269ba8676adb5d744f13bf7d737d88ce80dcf6e597e828e6
MD5 69c8fbe020200d19d44e49840ed8ab4b
BLAKE2b-256 67e30b579399b43d5996e3db6a077cc08e186e69910b1114f1a5f902ae4d6079

See more details on using hashes here.

File details

Details for the file ncnn-1.0.2022.11.28-cp37-cp37m-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for ncnn-1.0.2022.11.28-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 e4e5300e6522f2b9090252184ea2431d65f495412170f7c13116c36ec24ed177
MD5 0e66ceed77e844568b6ce742c1c51c1c
BLAKE2b-256 d190ce21cbf9a1da4b7f964b07e243b08a0f493e7b51e6286cc8171f0bd74986

See more details on using hashes here.

File details

Details for the file ncnn-1.0.2022.11.28-cp36-cp36m-macosx_10_9_x86_64.whl.

File metadata

File hashes

Hashes for ncnn-1.0.2022.11.28-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 64643968dc376b2a2187801aeb6f9420c786d6df894d6528ee91ab311083148b
MD5 eb6bac3bf2f43a4c03673733cb120d6b
BLAKE2b-256 a293e6bef9159ec0a12838f7a683171e6e73ec522a7afa5a309c17284d4bb652

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page