ncnn
24,043
Stars
0
Forks
0
Watchers
0
Open Issues
未知
许可证
C++
语言
创建时间
最近更新
项目能做什么
专为移动端优化的高性能神经网络推理框架。
来源:基于仓库元数据
· 内容以仓库实际 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 真实检索
| 项目 | 中文简介 | Stars | 语言 |
|---|---|---|---|
| morluto/rea | 中文介绍暂未生成 Reverse engineer anything with agents, from app behavior dow |
450,793 | TypeScript |
| flutter/flutter | 中文介绍暂未生成 Flutter makes it easy and fast to build beautiful apps for m |
181,148 | Dart |
| Genymobile/scrcpy | 中文介绍暂未生成 Display and control your Android device |
154,541 | C |
| rustdesk/rustdesk | 中文介绍暂未生成 An open-source remote desktop application designed for self- |
128,972 | Rust |
| react/react-native | 中文介绍暂未生成 A framework for building native applications using React |
126,898 | C++ |
| Hack-with-Github/Awesome-Hacking | 中文介绍暂未生成 A collection of various awesome lists for hackers, pentester |
125,223 | - |
以上为通过 GitHub 官方 Search API 检索的相似项目,功能差异与优劣势需进一步人工确认,配置 AI 后可生成对比分析。
项目优势与风险
| 技术成熟度 | 创建于 ,最近推送 ,发布过 50 个 Release |
| 社区活跃 | Star 24,043 / Fork 0 / Issue 0(数据支持,可自行核实) |
| 许可证 | 未检测到(需人工确认) |
| 主要风险 | 上游项目方向可能变化;同赛道竞争者较多(见竞品表);热度与需求不完全等价 |
安装与使用
快速开始(以仓库 README 为准)
git clone https://github.com/Tencent/ncnn.git cd ncnn # 请阅读仓库 README 获取确切安装步骤(依赖、配置、启动命令)
术语说明:Docker=应用容器(把程序和依赖打包运行);API Key=调用外部服务的密钥;Git Clone=把仓库代码下载到本地。常见错误:API Key 未配置 / 端口占用 / 数据库连接失败,多数项目在 README 的 Troubleshooting 章节有说明。