Skip to main content

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

Project description

ncnn

License download 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群(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 / / / ✔️ ✔️

Example project


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.4.19-pp39-pypy39_pp73-macosx_10_9_x86_64.whl (2.7 MB view details)

Uploaded PyPymacOS 10.9+ x86-64

ncnn-1.0.2022.4.19-pp38-pypy38_pp73-macosx_10_9_x86_64.whl (2.7 MB view details)

Uploaded PyPymacOS 10.9+ x86-64

ncnn-1.0.2022.4.19-pp37-pypy37_pp73-macosx_10_9_x86_64.whl (2.7 MB view details)

Uploaded PyPymacOS 10.9+ x86-64

ncnn-1.0.2022.4.19-cp310-cp310-macosx_11_0_arm64.whl (2.7 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

ncnn-1.0.2022.4.19-cp310-cp310-macosx_10_9_x86_64.whl (2.7 MB view details)

Uploaded CPython 3.10macOS 10.9+ x86-64

ncnn-1.0.2022.4.19-cp310-cp310-macosx_10_9_universal2.whl (2.7 MB view details)

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

ncnn-1.0.2022.4.19-cp39-cp39-macosx_11_0_arm64.whl (2.7 MB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

ncnn-1.0.2022.4.19-cp39-cp39-macosx_10_9_x86_64.whl (2.7 MB view details)

Uploaded CPython 3.9macOS 10.9+ x86-64

ncnn-1.0.2022.4.19-cp39-cp39-macosx_10_9_universal2.whl (2.7 MB view details)

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

ncnn-1.0.2022.4.19-cp38-cp38-macosx_11_0_arm64.whl (2.7 MB view details)

Uploaded CPython 3.8macOS 11.0+ ARM64

ncnn-1.0.2022.4.19-cp38-cp38-macosx_10_9_x86_64.whl (2.7 MB view details)

Uploaded CPython 3.8macOS 10.9+ x86-64

ncnn-1.0.2022.4.19-cp38-cp38-macosx_10_9_universal2.whl (2.7 MB view details)

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

ncnn-1.0.2022.4.19-cp37-cp37m-macosx_10_9_x86_64.whl (2.7 MB view details)

Uploaded CPython 3.7mmacOS 10.9+ x86-64

ncnn-1.0.2022.4.19-cp36-cp36m-macosx_10_9_x86_64.whl (2.7 MB view details)

Uploaded CPython 3.6mmacOS 10.9+ x86-64

File details

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

File metadata

File hashes

Hashes for ncnn-1.0.2022.4.19-pp39-pypy39_pp73-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 be7d144be59fed7faacbc6b76d8af6c16b9b39eec3734e1e895b49dc79593b33
MD5 42888eafce591c3d14470e8a610ca4b1
BLAKE2b-256 cd58b70935bed44e7938f3b2e64a0161d80e078209a71c9306f0ae035d676ec8

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ncnn-1.0.2022.4.19-pp38-pypy38_pp73-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 ed82dae2f7e0f0c77355ba339196b7f3b471b1258636fd85fa19b445957137f8
MD5 89cfaf82377884b67e2595e4b95964ea
BLAKE2b-256 1887366ae2828779015364bf877aae439f7cf917a0ee39938649dd8e82a122ea

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ncnn-1.0.2022.4.19-pp37-pypy37_pp73-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 5be21238db52aa1d7787ed6328df5db95e46258431d4451c4422879c82121c5e
MD5 0dd695f54244b6652e4e4373ba65f817
BLAKE2b-256 6d9bf5fbd3cf40a3adf78d02993fcc97f73cefe2a77e704ec1422fa3367204d9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ncnn-1.0.2022.4.19-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c8fe92ea5837833f51d960f24856b55b59ccf55c18272e54df341e97f5779a80
MD5 06259817ae690b5a85df09c4cd1b7ec6
BLAKE2b-256 d7fa051e7110819e5cc322a04615b0d2d58ce480e072bc753806fb644fd6f058

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ncnn-1.0.2022.4.19-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 a3e679171e30f649d7b8c31d98bc23ed863ded911854df82adbe83e73cc4cdba
MD5 3885c9868084af5a3df2378e998c894d
BLAKE2b-256 c7296eefbb9198122db2853cde17c70badd08c56f0afb293fde8e899b007fff1

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ncnn-1.0.2022.4.19-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 9353e54c5f8d64bdf3283dce9dd7d421fe3faaa8ab85629745f32e8b5c9f458f
MD5 d1d282aab5c35e6db9a7cdd98e1f6b28
BLAKE2b-256 e93776c14eb504f89a63bd92cc34e173dc57a136b58860915e49543b0e61b3d6

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ncnn-1.0.2022.4.19-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 12cbcc470046f3e5baa5af5a133dd8c6991fd84677766661cc3705411c6ffba6
MD5 843838d5a7087416b5d3597c3a28b913
BLAKE2b-256 c0d58fbe33f8f7690ad512be8c193ebf1091ef9539e5a5818a90165887916c3d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ncnn-1.0.2022.4.19-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 442d1ebd17831ffdab03cdf85be14705f995c045b4db42f68f035bfee0a96cc5
MD5 f292b682d2afc2244f5ba773956f3192
BLAKE2b-256 0f6a0627490c8ed476ceeff148475798696e931d2e315bedeaa6688f343100ca

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ncnn-1.0.2022.4.19-cp39-cp39-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 033ea1e781adad1983833d96a9e25bf97d976b42647ceefd331db7f4ebc6ceaf
MD5 88f72b2e85631d4b8ef96b4d057b1a60
BLAKE2b-256 ac7660b0db211da9bfb63a61cadb11ca73f7d19d80cabe1e963b698c5bef45f2

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ncnn-1.0.2022.4.19-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 ee3db3c463338adaf6b7d87813016ec39bb586e5a911b15d171c0c14f11b00de
MD5 954f8cc827053809b214788949dc4428
BLAKE2b-256 0ebee78243f3fd001e74a99a1cbef989ff548750cc22bfe85ba02868faab88e3

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ncnn-1.0.2022.4.19-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 cf4b73a09e88dd8dd1935399dcb925947fabd007afc32de57272a410e4b4351d
MD5 a3ce2f5b832f967e90e3bc31b01b10a7
BLAKE2b-256 8a19590d47a603579f003df80422582c642399a0f4e0f2c7bda11f910dfb1572

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ncnn-1.0.2022.4.19-cp38-cp38-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 f3bfcd166eb7a34e01894e9779a96c7b77e3f1a9aa230c097f4cc562bdf7e0db
MD5 3e06e22117f4ec1a2012eea2a0f40600
BLAKE2b-256 417426d96f679cdb0b2d0f52c14c9fed5dacb4e30cdcc6639a681497d83dffde

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ncnn-1.0.2022.4.19-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 3b34a9258f7f6323220f626cdac0077bbc9e44c30f477da352bbff4a64f3d53c
MD5 ffd19dd3c465c9cb55fb7a461f914863
BLAKE2b-256 5e41bd6aa26a35a823f4282e90fb4d7ddec00c078bf718015409160d5301a117

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ncnn-1.0.2022.4.19-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 40b092d71d874e2919753263b9640361f6bd839011cc3ef84a5d61f25fc918d0
MD5 769526d2d141a0c949b11780ae4506e8
BLAKE2b-256 cb22c4efbd8f3ad98568730c5f058d79896712666e70b8e75dd775c03972dde0

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