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

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

Uploaded PyPymacOS 10.9+ x86-64

ncnn-1.0.2022.7.29-pp38-pypy38_pp73-macosx_10_9_x86_64.whl (3.0 MB view details)

Uploaded PyPymacOS 10.9+ x86-64

ncnn-1.0.2022.7.29-pp37-pypy37_pp73-macosx_10_9_x86_64.whl (3.0 MB view details)

Uploaded PyPymacOS 10.9+ x86-64

ncnn-1.0.2022.7.29-cp310-cp310-macosx_11_0_arm64.whl (3.0 MB view details)

Uploaded CPython 3.10macOS 11.0+ ARM64

ncnn-1.0.2022.7.29-cp310-cp310-macosx_10_9_x86_64.whl (3.0 MB view details)

Uploaded CPython 3.10macOS 10.9+ x86-64

ncnn-1.0.2022.7.29-cp310-cp310-macosx_10_9_universal2.whl (3.0 MB view details)

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

ncnn-1.0.2022.7.29-cp39-cp39-macosx_11_0_arm64.whl (3.0 MB view details)

Uploaded CPython 3.9macOS 11.0+ ARM64

ncnn-1.0.2022.7.29-cp39-cp39-macosx_10_9_x86_64.whl (3.0 MB view details)

Uploaded CPython 3.9macOS 10.9+ x86-64

ncnn-1.0.2022.7.29-cp39-cp39-macosx_10_9_universal2.whl (3.0 MB view details)

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

ncnn-1.0.2022.7.29-cp38-cp38-macosx_11_0_arm64.whl (3.0 MB view details)

Uploaded CPython 3.8macOS 11.0+ ARM64

ncnn-1.0.2022.7.29-cp38-cp38-macosx_10_9_x86_64.whl (3.0 MB view details)

Uploaded CPython 3.8macOS 10.9+ x86-64

ncnn-1.0.2022.7.29-cp38-cp38-macosx_10_9_universal2.whl (3.0 MB view details)

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

ncnn-1.0.2022.7.29-cp37-cp37m-macosx_10_9_x86_64.whl (3.0 MB view details)

Uploaded CPython 3.7mmacOS 10.9+ x86-64

ncnn-1.0.2022.7.29-cp36-cp36m-macosx_10_9_x86_64.whl (3.0 MB view details)

Uploaded CPython 3.6mmacOS 10.9+ x86-64

File details

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

File metadata

File hashes

Hashes for ncnn-1.0.2022.7.29-pp39-pypy39_pp73-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 a76469e974bfb8fde3a1dd703a067d75dcc8551f6cc9e5913557e0ded2c78f6c
MD5 e748ed75e0a85ea60408e449c4b61c6a
BLAKE2b-256 b431351317925dbe3b8224724a69e0bd2e79a1cbc19041fef6abe84491af2450

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ncnn-1.0.2022.7.29-pp38-pypy38_pp73-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 962d0db10c753d5ed9362957ad6c6e72ce724feae8fed1916aae77a12cf4d72a
MD5 3f0aa2a7793db57ca771fa2f3b8a997f
BLAKE2b-256 38409443e5584d3adebe20f26ade0174f93223c5ba22dfd6bf0bdb966c820bd0

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ncnn-1.0.2022.7.29-pp37-pypy37_pp73-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 5a9bb24b6d4fc2dc362b6f95dff11426da6726164f97cdf2b5040657851edc91
MD5 83b1ee2c19bfdf62173bff3074dd74ad
BLAKE2b-256 f782bcc0a88bdcbf786a3ec9082d2328facd565137c9f9ec3c4d77d780b76aeb

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ncnn-1.0.2022.7.29-cp310-cp310-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 9fb5adff566bc0b732a8c4f8a19bfc2371c5c2a42364b40aad9c276e534dd593
MD5 15e672f18625e7f6cf95ac32e2ca38be
BLAKE2b-256 e1e9f5f360bb9887b2abeef82fdbac1541b5263d268216e90760b047cdc3740f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ncnn-1.0.2022.7.29-cp310-cp310-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 0775a1d3f8696b14f691cb4e1066b08a17fe2ec5b15ba65296584b244277c928
MD5 502e6f5e1d86815dac0940b2af068807
BLAKE2b-256 943c9efd234ad2403e3fcbe8a18452aad74183c9a8af640febb7605b77505db9

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ncnn-1.0.2022.7.29-cp310-cp310-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 88e3b024b0fdd990622fea9f9d557720eaa850d4488ff93eaebaac5a7ec47da2
MD5 9aa50b2083066a2f22fcdabd5394965f
BLAKE2b-256 deffff23a5d4c9121a6f6602a029def220368afdf85aee7a41720c6c1c9a6511

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ncnn-1.0.2022.7.29-cp39-cp39-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 c18082b0ae484d3bfd75b021c6eccadbd7d097394dcf8e9ce5930dc0c1f84363
MD5 e53c99256f4e94cee5bf39871d1c3b37
BLAKE2b-256 b9e70c13999bbbb584f67dbce1ebf0bf3ae9f86f65dc08140af2299feae6ef3f

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ncnn-1.0.2022.7.29-cp39-cp39-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 cdf9f01d33a9a5ad21cfe0f4c68c513c6345372de2928d23e1f07b9986a7c305
MD5 796dd1f27fc3d259c845070e96cfa051
BLAKE2b-256 4b184ad57a966459701c9ab956d49845416643bb45be153126ec3ff9724e7c4d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ncnn-1.0.2022.7.29-cp39-cp39-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 48656486a568ebbb7e83aaa6cccc4631290fb0fe7828a67673440573a9edeac0
MD5 5fab7cb9eef1e1cac72a60c15b074f9a
BLAKE2b-256 76e8a9959ce7b4c40806240148aa6cf657ecbdfc1d1c342ae70ba0faa5b2901d

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ncnn-1.0.2022.7.29-cp38-cp38-macosx_11_0_arm64.whl
Algorithm Hash digest
SHA256 31eabbc5aead3c71011be7a40be04fe0066d4704f147ed09068c289694247d5a
MD5 18e2985b36dcf8418335807ec3273a4c
BLAKE2b-256 56eb3175b700b498b400e05f3dabdd35fa2d2c56cf4618e3e769d1ee9048268a

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ncnn-1.0.2022.7.29-cp38-cp38-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 2c63fcfa134c33cd4e42c6a7aff4b71946945937d796dfa9fb8ddf0303d6fafc
MD5 c3b96df9c5a581bc2ac46caf77f6ba88
BLAKE2b-256 67ccdf6bfd3ae58f07ba5cf5d75b09b5f99037ac0851fd6dcf334922d76fc881

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ncnn-1.0.2022.7.29-cp38-cp38-macosx_10_9_universal2.whl
Algorithm Hash digest
SHA256 0d88f16044c96ae94caa4ee2a1c4d4d41ff605c100813696fdea51ebd5426cb5
MD5 1eee116a6c1a281046386b93ee6f51a5
BLAKE2b-256 5e0164b08aa2b27051d72c58d4b0d038b23e9a6247c5e4b40b53bc7078e51b33

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ncnn-1.0.2022.7.29-cp37-cp37m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 6757f435047ddd1333a45a15304e51118420a5489ac6b8d9c72c8460013ecb94
MD5 2b52fd77b34e013cc2e10e261834f668
BLAKE2b-256 fcfa2c9c0207ed3628e8ad1505ded5bd848263ac40ca62b0093011a621b72a33

See more details on using hashes here.

File details

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

File metadata

File hashes

Hashes for ncnn-1.0.2022.7.29-cp36-cp36m-macosx_10_9_x86_64.whl
Algorithm Hash digest
SHA256 9eb35a9fbe7e2bbfaef6abf801a728f039713d7e3ba6f3b69c29c8878cdc4bf0
MD5 69d0dcb49e48233cfc6af73850e7a54f
BLAKE2b-256 8a7d1d9cdd9bf0aca3f379ccc7a0b83648f9aceff00d666f0b9fdc3e6874d46e

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