ncnn
24,043
Stars
4,550
Forks
566
Watchers
1,317
Open Issues
NOASSERTION
许可证
C++
语言
2017-06-30
创建时间
2026-11-11
最近更新
项目能做什么
专为移动端优化的高性能神经网络推理框架。
来源:基于仓库元数据
· 内容以仓库实际 README 为准
使用说明 查看原始 README 原仓库文档
中文使用说明暂未生成。下面保留原仓库 README 摘录,命令与配置均以原文为准。
原始 README 摘录(英文原文,节选前 3000 字符)

# ncnn
[](LICENSE.txt)
[](https://github.com/Tencent/ncnn/releases)
[](https://codecov.io/gh/Tencent/ncnn)
ncnn is a high-performance neural network inference framework optimized for mobile, embedded, and desktop deployment.
It has no third-party runtime dependencies, runs across CPU and Vulkan GPU backends, and provides tools such as pnnx for converting PyTorch and ONNX models to ncnn.
Developers can deploy deep learning models efficiently on phones, PCs, browsers, and edge devices.
ncnn is currently being used in many Tencent applications, such as QQ, Qzone, WeChat, Pitu, and so on.
ncnn 是一个面向移动端、嵌入式和桌面端部署优化的高性能神经网络推理框架。
ncnn 无第三方运行时依赖,支持 CPU 和 Vulkan GPU 后端,并提供 pnnx 等工具将 PyTorch 和 ONNX 模型转换为 ncnn 模型。
基于 ncnn,开发者可以将深度学习模型高效部署到手机、PC、浏览器和边缘设备上。
ncnn 目前已在腾讯多款应用中使用,如:QQ,Qzone,微信,天天 P 图等。
---
## Quick Start
The recommended beginner path is PyTorch -> pnnx -> ncnn.
<table>
<tr>
<td width="50%" valign="top">
**Install pnnx in a PyTorch environment**
```shell
pip3 install pnnx
```
**Export a PyTorch model to ncnn**
```python
import torch
import torch.nn as nn
import pnnx
class Model(nn.Module):
def __init__(self):
super().__init__()
self.conv = nn.Conv2d(3, 8, 1)
self.relu = nn.ReLU()
self.fc = nn.Linear(8, 4)
def forward(self, x):
x = self.conv(x)
x = self.relu(x)
x = x.mean((2, 3))
return self.fc(x)
model = Model().eval()
x = torch.rand(1, 3, 224, 224)
pnnx.export(model, "model.pt", (x,))
```
This generates `model.ncnn.param` and `model.ncnn.bin`.
</td>
<td width="50%" valign="top">
**Run with ncnn C++ API**
```cpp
#include "net.h"
ncnn::Net net;
net.load_param("model.ncnn.param");
net.load_model("model.ncnn.bin");
ncnn::Mat in(224, 224, 3);
auto ex = net.create_extractor();
ex.input("in0", in);
ncnn::Mat out;
ex.extract("out0", out);
```
**Or use Python**
```python
import numpy as np
import ncnn
net = ncnn.Net()
net.load_param("model.ncnn.param")
net.load_model("model.ncnn.bin")
x = np.zeros((3, 224, 224), np.float32)
mat = ncnn.Mat(x)
ex = net.create_extractor()
ex.input("in0", mat)
ret, out = ex.extract("out0")
print(np.array(out).shape)
```
</td>
</tr>
</table>
See [pnnx](tools/pnnx), [use ncnn with PyTorch or ONNX](https://github.com/Tencent/ncnn/wiki/use-ncnn-with-pytorch-or-onnx), [Python API](python), and [examples](examples) for complete workflows.
---
## Community
<table>
<tr>
<td>
<b>技术交流 QQ 群</b><br />
637093648 (超多大佬)<br />
答案:卷卷卷卷卷(已满)
</td>
<td rowspan=3>
<b>Telegram Group</b>
<https://t.me/ncnnyes>
</td>
<td rowspan=3>
<b>Discord Channel</b>
<https://discord.gg/YR
阅读完整原文
项目深度分析 规则生成(AI 未配置)
综合评分 44.2 分。该项目在“个人可实施性”维度得 0.0 分,“付费可能性”维度得 20.0 分,差异化空间 100.0 分(评分依据见评分卡)。
面向细分需求的二次开发产品
| 产品构想 | 基于 ncnn 的核心能力,聚焦一个更窄的场景(如某平台、某行业)做差异化。 |
| 目标用户 | 该细分场景用户 |
| 难度/周期 | 中 · 2~6 周 |
| 收费模式 | 买断制 / 订阅制 / 广告 |
| 竞争风险 | 细分需求规模需验证 |
| 依据 | AI 推测:基于项目主题标签的判断 |
以上为规则引擎基于仓库公开数据生成的参考结论,包含推测成分,不构成投资或创业承诺;配置 AI 后可获得更深入的分析。
报告会保存到 个人中心
竞品与相似项目 GitHub Search 真实检索
相似项目数据正在完善中,暂不展示(避免误导)
项目优势与风险
| 技术成熟度 | 创建于 2017-06-30,近 30 天仍在推送,发布过 50 个 Release |
| 社区活跃 | Star 24,043 / Fork 4,550 / Issue 1,317(数据支持,可自行核实) |
| 许可证 | NOASSERTION |
| 主要风险 | 上游项目方向可能变化;同赛道竞争者较多(见竞品表);热度与需求不完全等价 |
安装与使用
此项目未提供 Docker 镜像,安装步骤以原仓库 README 为准(涉及依赖安装与环境配置,对新手门槛较高)。