XUtils

ncnn

A high-performance neural network inference computing framework optimized for mobile platforms. [BSD]


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 [](https://github.com/Tencent/ncnn/releases/latest/download/ncnn-20240410-full-source.zip)
- [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 [](https://github.com/Tencent/ncnn/releases/latest/download/ncnn-20240410-android-vulkan.zip) [](https://github.com/Tencent/ncnn/releases/latest/download/ncnn-20240410-android.zip) [](https://github.com/Tencent/ncnn/actions?query=workflow%3Aandroid)
Android shared [](https://github.com/Tencent/ncnn/releases/latest/download/ncnn-20240410-android-vulkan-shared.zip) [](https://github.com/Tencent/ncnn/releases/latest/download/ncnn-20240410-android-shared.zip)
- [Build for HarmonyOS with cross-compiling](https://github.com/Tencent/ncnn/wiki/how-to-build#build-for-harmonyos-with-cross-compiling)
HarmonyOS [](https://github.com/Tencent/ncnn/actions?query=workflow%3Aharmonyos)
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 [](https://github.com/Tencent/ncnn/releases/latest/download/ncnn-20240410-ios-vulkan.zip) [](https://github.com/Tencent/ncnn/releases/latest/download/ncnn-20240410-ios.zip) [](https://github.com/Tencent/ncnn/actions?query=workflow%3Aios)
iOS-Simulator [](https://github.com/Tencent/ncnn/releases/latest/download/ncnn-20240410-ios-simulator-vulkan.zip) [](https://github.com/Tencent/ncnn/releases/latest/download/ncnn-20240410-ios-simulator.zip)
- [Build for macOS](https://github.com/Tencent/ncnn/wiki/how-to-build#build-for-macos)
macOS [](https://github.com/Tencent/ncnn/releases/latest/download/ncnn-20240410-macos-vulkan.zip) [](https://github.com/Tencent/ncnn/releases/latest/download/ncnn-20240410-macos.zip) [](https://github.com/Tencent/ncnn/actions?query=workflow%3Amacos)
Mac-Catalyst [](https://github.com/Tencent/ncnn/releases/latest/download/ncnn-20240410-mac-catalyst-vulkan.zip) [](https://github.com/Tencent/ncnn/releases/latest/download/ncnn-20240410-mac-catalyst.zip) [](https://github.com/Tencent/ncnn/actions?query=workflow%3Amac-catalyst)
watchOS [](https://github.com/Tencent/ncnn/releases/latest/download/ncnn-20240410-watchos.zip) [](https://github.com/Tencent/ncnn/actions?query=workflow%3Awatchos)
watchOS-Simulator [](https://github.com/Tencent/ncnn/releases/latest/download/ncnn-20240410-watchos-simulator.zip)
tvOS [](https://github.com/Tencent/ncnn/releases/latest/download/ncnn-20240410-tvos-vulkan.zip) [](https://github.com/Tencent/ncnn/releases/latest/download/ncnn-20240410-tvos.zip) [](https://github.com/Tencent/ncnn/actions?query=workflow%3Atvos)
tvOS-Simulator [](https://github.com/Tencent/ncnn/releases/latest/download/ncnn-20240410-tvos-simulator-vulkan.zip) [](https://github.com/Tencent/ncnn/releases/latest/download/ncnn-20240410-tvos-simulator.zip)
visionOS [](https://github.com/Tencent/ncnn/releases/latest/download/ncnn-20240410-visionos.zip) [](https://github.com/Tencent/ncnn/actions?query=workflow%3Avisionos)
visionOS-Simulator [](https://github.com/Tencent/ncnn/releases/latest/download/ncnn-20240410-visionos-simulator.zip)
Apple xcframework [](https://github.com/Tencent/ncnn/releases/latest/download/ncnn-20240410-apple-vulkan.zip) [](https://github.com/Tencent/ncnn/releases/latest/download/ncnn-20240410-apple.zip)
- [Build for Linux / NVIDIA Jetson / Raspberry Pi3, Pi4 / POWER](https://github.com/Tencent/ncnn/wiki/how-to-build#build-for-linux)
Ubuntu 20.04 [](https://github.com/Tencent/ncnn/releases/latest/download/ncnn-20240410-ubuntu-2004.zip) [](https://github.com/Tencent/ncnn/releases/latest/download/ncnn-20240410-ubuntu-2004-shared.zip) [](https://github.com/Tencent/ncnn/actions?query=workflow%3Alinux-x64-gpu-gcc)
Ubuntu 22.04 [](https://github.com/Tencent/ncnn/releases/latest/download/ncnn-20240410-ubuntu-2204.zip) [](https://github.com/Tencent/ncnn/releases/latest/download/ncnn-20240410-ubuntu-2204-shared.zip)
windows - [Build for Windows x64 using VS2017](https://github.com/Tencent/ncnn/wiki/how-to-build#build-for-windows-x64-using-visual-studio-community-2017)
VS2015 [](https://github.com/Tencent/ncnn/releases/latest/download/ncnn-20240410-windows-vs2015.zip) [](https://github.com/Tencent/ncnn/releases/latest/download/ncnn-20240410-windows-vs2015-shared.zip) [](https://github.com/Tencent/ncnn/actions?query=workflow%3Awindows)
VS2017 [](https://github.com/Tencent/ncnn/releases/latest/download/ncnn-20240410-windows-vs2017.zip) [](https://github.com/Tencent/ncnn/releases/latest/download/ncnn-20240410-windows-vs2017-shared.zip)
VS2019 [](https://github.com/Tencent/ncnn/releases/latest/download/ncnn-20240410-windows-vs2019.zip) [](https://github.com/Tencent/ncnn/releases/latest/download/ncnn-20240410-windows-vs2019-shared.zip)
VS2022 [](https://github.com/Tencent/ncnn/releases/latest/download/ncnn-20240410-windows-vs2022.zip) [](https://github.com/Tencent/ncnn/releases/latest/download/ncnn-20240410-windows-vs2022-shared.zip)
- [Build for WebAssembly](https://github.com/Tencent/ncnn/wiki/how-to-build#build-for-webassembly)
WebAssembly [](https://github.com/Tencent/ncnn/releases/latest/download/ncnn-20240410-webassembly.zip) [](https://github.com/Tencent/ncnn/actions?query=workflow%3Aweb-assembly)
- [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) [](https://github.com/Tencent/ncnn/actions?query=workflow%3Alinux-arm-cpu-gcc)
Linux (aarch64) [](https://github.com/Tencent/ncnn/actions?query=workflow%3Alinux-aarch64-cpu-gcc)
Linux (mips) [](https://github.com/Tencent/ncnn/actions?query=workflow%3Alinux-mips-cpu-gcc)
Linux (mips64) [](https://github.com/Tencent/ncnn/actions?query=workflow%3Alinux-mips64-cpu-gcc)
Linux (ppc64) [](https://github.com/Tencent/ncnn/actions?query=workflow%3Alinux-ppc64-cpu-gcc)
Linux (riscv64) [](https://github.com/Tencent/ncnn/actions?query=workflow%3Alinux-riscv64-cpu-gcc)
Linux (loongarch64) [](https://github.com/Tencent/ncnn/actions?query=workflow%3Alinux-loongarch64-cpu-gcc)

支持大部分常用的 CNN 网络


HowTo

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


功能概述

  • 支持卷积神经网络,支持多输入和多分支结构,可计算部分分支
  • 无任何第三方库依赖,不依赖 BLAS/NNPACK 等计算框架
  • 纯 C++ 实现,跨平台,支持 Android / iOS 等
  • ARM Neon 汇编级良心优化,计算速度极快
  • 精细的内存管理和数据结构设计,内存占用极低
  • 支持多核并行计算加速,ARM big.LITTLE CPU 调度优化
  • 支持基于全新低消耗的 Vulkan API GPU 加速
  • 可扩展的模型设计,支持 8bit 量化 和半精度浮点存储,可导入 caffe/pytorch/mxnet/onnx/darknet/keras/tensorflow(mlir) 模型
  • 支持直接内存零拷贝引用加载网络模型
  • 可注册自定义层实现并扩展
  • 恩,很强就是了,不怕被塞卷 QvQ


Articles

  • coming soon...