You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

README.md 7.4 kB

8 years ago
8 years ago
7 years ago
7 years ago
8 years ago
7 years ago
8 years ago
7 years ago
7 years ago
7 years ago
7 years ago
8 years ago
7 years ago
8 years ago
8 years ago
8 years ago
8 years ago
7 years ago
8 years ago
7 years ago
8 years ago
7 years ago
8 years ago
7 years ago
8 years ago
7 years ago
8 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
7 years ago
8 years ago
8 years ago
123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141
  1. ![](https://raw.githubusercontent.com/Tencent/ncnn/master/images/256-ncnn.png)
  2. # ncnn
  3. [![License](https://img.shields.io/badge/license-BSD--3--Clause-blue.svg)](https://raw.githubusercontent.com/Tencent/ncnn/master/LICENSE.txt)
  4. [![Build Status](https://travis-ci.org/Tencent/ncnn.svg?branch=master)](https://travis-ci.org/Tencent/ncnn)
  5. [![Coverage Status](https://coveralls.io/repos/github/Tencent/ncnn/badge.svg?branch=master)](https://coveralls.io/github/Tencent/ncnn?branch=master)
  6. 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.
  7. ncnn 是一个为手机端极致优化的高性能神经网络前向计算框架。ncnn 从设计之初深刻考虑手机端的部署和使用。无第三方依赖,跨平台,手机端 cpu 的速度快于目前所有已知的开源框架。基于 ncnn,开发者能够将深度学习算法轻松移植到手机端高效执行,开发出人工智能 APP,将 AI 带到你的指尖。ncnn 目前已在腾讯多款应用中使用,如 QQ,Qzone,微信,天天P图等。
  8. ---
  9. ### Support most commonly used CNN network
  10. ### 支持大部分常用的 CNN 网络
  11. * Classical CNN: VGG AlexNet GoogleNet Inception ...
  12. * Practical CNN: ResNet DenseNet SENet FPN ...
  13. * Light-weight CNN: SqueezeNet MobileNetV1/V2 ShuffleNetV1/V2 MNasNet ...
  14. * Detection: MTCNN facedetection ...
  15. * Detection: VGG-SSD MobileNet-SSD SqueezeNet-SSD MobileNetV2-SSDLite ...
  16. * Detection: Faster-RCNN R-FCN ...
  17. * Detection: YOLOV2 YOLOV3 MobileNet-YOLOV3 ...
  18. * Segmentation: FCN PSPNet ...
  19. ---
  20. ### HowTo
  21. **[how to build ncnn library](https://github.com/Tencent/ncnn/wiki/how-to-build) on Linux / Windows / Raspberry Pi3 / Android / iOS**
  22. * [Build for Linux x86](https://github.com/Tencent/ncnn/wiki/how-to-build#build-for-linux-x86)
  23. * [Build for Windows x64 using VS2017](https://github.com/Tencent/ncnn/wiki/how-to-build#build-for-windows-x64-using-visual-studio-community-2017)
  24. * [Build for MacOSX](https://github.com/Tencent/ncnn/wiki/how-to-build#build-for-macosx)
  25. * [Build for Raspberry Pi 3](https://github.com/Tencent/ncnn/wiki/how-to-build#build-for-raspberry-pi-3)
  26. * [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)
  27. * [Build for Android](https://github.com/Tencent/ncnn/wiki/how-to-build#build-for-android)
  28. * [Build for iOS on MacOSX with xcode](https://github.com/Tencent/ncnn/wiki/how-to-build#build-for-ios-on-macosx-with-xcode)
  29. * [Build for iOS on Linux with cctools-port](https://github.com/Tencent/ncnn/wiki/how-to-build#build-for-ios-on-linux-with-cctools-port)
  30. * [Build for Hisilicon platform with cross-compiling](https://github.com/Tencent/ncnn/wiki/how-to-build#build-for-hisilicon-platform-with-cross-compiling)
  31. **[download prebuild binary package for android and ios](https://github.com/Tencent/ncnn/releases)**
  32. **[how to use ncnn with alexnet](https://github.com/Tencent/ncnn/wiki/how-to-use-ncnn-with-alexnet) with detailed steps, recommended for beginners :)**
  33. **[ncnn 组件使用指北 alexnet](https://github.com/Tencent/ncnn/wiki/ncnn-%E7%BB%84%E4%BB%B6%E4%BD%BF%E7%94%A8%E6%8C%87%E5%8C%97-alexnet) 附带详细步骤,新人强烈推荐 :)**
  34. [ncnn low-level operation api](https://github.com/Tencent/ncnn/wiki/low-level-operation-api)
  35. [ncnn param and model file spec](https://github.com/Tencent/ncnn/wiki/param-and-model-file-structure)
  36. [ncnn operation param weight table](https://github.com/Tencent/ncnn/wiki/operation-param-weight-table)
  37. [how to implement custom layer step by step](https://github.com/Tencent/ncnn/wiki/how-to-implement-custom-layer-step-by-step)
  38. ---
  39. ### FAQ
  40. **[ncnn throw error](https://github.com/Tencent/ncnn/wiki/FAQ-ncnn-throw-error)**
  41. **[ncnn produce wrong result](https://github.com/Tencent/ncnn/wiki/FAQ-ncnn-produce-wrong-result)**
  42. **[ncnn vulkan](https://github.com/Tencent/ncnn/wiki/FAQ-ncnn-vulkan)**
  43. ---
  44. ### Features
  45. * Supports convolutional neural networks, supports multiple input and multi-branch structure, can calculate part of the branch
  46. * No third-party library dependencies, does not rely on BLAS / NNPACK or any other computing framework
  47. * Pure C ++ implementation, cross-platform, supports android, ios and so on
  48. * ARM NEON assembly level of careful optimization, calculation speed is extremely high
  49. * Sophisticated memory management and data structure design, very low memory footprint
  50. * Supports multi-core parallel computing acceleration, ARM big.LITTLE cpu scheduling optimization
  51. * Supports GPU acceleration via the next-generation low-overhead vulkan api
  52. * The overall library size is less than 700K, and can be easily reduced to less than 300K
  53. * Extensible model design, supports 8bit quantization and half-precision floating point storage, can import caffe/pytorch/mxnet/onnx models
  54. * Support direct memory zero copy reference load network model
  55. * Can be registered with custom layer implementation and extended
  56. * Well, it is strong, not afraid of being stuffed with 卷 QvQ
  57. ### 功能概述
  58. * 支持卷积神经网络,支持多输入和多分支结构,可计算部分分支
  59. * 无任何第三方库依赖,不依赖 BLAS/NNPACK 等计算框架
  60. * 纯 C++ 实现,跨平台,支持 android ios 等
  61. * ARM NEON 汇编级良心优化,计算速度极快
  62. * 精细的内存管理和数据结构设计,内存占用极低
  63. * 支持多核并行计算加速,ARM big.LITTLE cpu 调度优化
  64. * 支持基于全新低消耗的 vulkan api GPU 加速
  65. * 整体库体积小于 700K,并可轻松精简到小于 300K
  66. * 可扩展的模型设计,支持 8bit 量化和半精度浮点存储,可导入 caffe/pytorch/mxnet/onnx 模型
  67. * 支持直接内存零拷贝引用加载网络模型
  68. * 可注册自定义层实现并扩展
  69. * 恩,很强就是了,不怕被塞卷 QvQ
  70. ---
  71. ### supported platform matrix
  72. * YY = known work and runs fast with good optimization
  73. * Y = known work, but speed may not be fast enough
  74. * ? = shall work, not confirmed
  75. * / = not applied
  76. | |Windows|Linux|Android|MacOS|iOS|
  77. |---|---|---|---|---|---|
  78. |intel-cpu|Y|Y|?|Y|/|
  79. |intel-gpu|Y|Y|?|?|/|
  80. |amd-cpu|Y|Y|?|Y|/|
  81. |amd-gpu|Y|Y|?|?|/|
  82. |nvidia-gpu|Y|Y|?|?|/|
  83. |qcom-cpu|?|Y|YY|/|/|
  84. |qcom-gpu|?|Y|Y|/|/|
  85. |arm-cpu|?|?|YY|/|/|
  86. |arm-gpu|?|?|Y|/|/|
  87. |apple-cpu|/|/|/|/|YY|
  88. |apple-gpu|/|/|/|/|Y|
  89. ---
  90. ### Example project
  91. * https://github.com/Tencent/ncnn/tree/master/examples/squeezencnn
  92. * https://github.com/chehongshu/ncnnforandroid_objectiondetection_Mobilenetssd
  93. * https://github.com/moli232777144/mtcnn_ncnn
  94. ![](https://github.com/nihui/ncnn-assets/raw/master/20181217/ncnn-2.jpg)
  95. ![](https://github.com/nihui/ncnn-assets/raw/master/20181217/ncnn-23.jpg)
  96. ![](https://github.com/nihui/ncnn-assets/raw/master/20181217/ncnn-m.png)
  97. ### 技术交流QQ群:637093648(已满qaq) 853969140 答案:卷卷卷卷卷
  98. ---
  99. ### License
  100. BSD 3 Clause