Hugging Face model-definition framework for text, vision, audio and multimodal models, for inference and training.
Opening the entry
Opening the entry
ncnn is a high-performance neural network inference framework optimized for the mobile platform
ncnn is a high-performance neural network inference framework optimized for mobile, embedded, and desktop deployment. It has no third-party runtime dependencies and runs on CPU and Vulkan GPU backends. Developers convert PyTorch or ONNX models using the pnnx tool, then run inference via C++ or Python APIs on phones, PCs, browsers, and edge devices.
pip3 install pnnx
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,))Tencent/ncnn is a third-party open-source project, listed here from public GitHub data. ImuTechz did not write it and has not reviewed or security-audited its code. Read the source and its permissions before you install or run it.