{"data":{"slug":"tencent-ncnn","name":"ncnn","tagline":"High-performance neural network inference framework optimized for mobile platforms","github_url":"https://github.com/Tencent/ncnn","owner":"Tencent","repo":"ncnn","owner_avatar_url":"https://avatars.githubusercontent.com/u/18461506?v=4","primary_language":"C++","stars":23905,"forks":4514,"topics":["android","arm-neon","artificial-intelligence","caffe","darknet","deep-learning","high-preformance","inference","ios","keras","mlir","mxnet","ncnn","neural-network","onnx","pytorch","riscv","simd","tensorflow","vulkan"],"archived":false,"github_pushed_at":"2026-10-01T15:33:05+00:00","maintenance_label":"Very active","stars_delta_30d":261,"url":"https://www.graphcanon.com/tools/tencent-ncnn","markdown_url":"https://www.graphcanon.com/tools/tencent-ncnn.md","api_url":"https://www.graphcanon.com/api/graphcanon/tools/tencent-ncnn","graph_url":"https://www.graphcanon.com/api/graphcanon/graph?tool=tencent-ncnn","description":"ncnn is a high-performance neural network inference framework optimized for the mobile platform","homepage_url":null,"license":"Other","open_issues":1223,"watchers":570,"ai_summary":"ncnn is developed primarily in C++ and supports multiple deep learning frameworks conversion including PyTorch, ONNX, Keras, MXNet, TensorFlow, Darknet, and Caffe. It provides a means to export models from these frameworks into ncnn's format through pnnx and offers an easy integration path with C++ or Python for performing inference.","readme_excerpt":"## Quick Start\n\nThe recommended beginner path is PyTorch -> pnnx -> ncnn.\n\n<table>\n<tr>\n<td width=\"50%\" valign=\"top\">\n\n**Install pnnx in a PyTorch environment**\n\n```shell\npip3 install pnnx\n```\n\n**Export a PyTorch model to ncnn**\n\n```python\nimport torch\nimport torch.nn as nn\nimport pnnx\n\nclass Model(nn.Module):\n    def __init__(self):\n        super().__init__()\n        self.conv = nn.Conv2d(3, 8, 1)\n        self.relu = nn.ReLU()\n        self.fc = nn.Linear(8, 4)\n\n    def forward(self, x):\n        x = self.conv(x)\n        x = self.relu(x)\n        x = x.mean((2, 3))\n        return self.fc(x)\n\nmodel = Model().eval()\n\nx = torch.rand(1, 3, 224, 224)\npnnx.export(model, \"model.pt\", (x,))\n```\n\nThis generates `model.ncnn.param` and `model.ncnn.bin`.\n\n</td>\n<td width=\"50%\" valign=\"top\">\n\n**Run with ncnn C++ API**\n\n```cpp\n#include \"net.h\"\n\nncnn::Net net;\nnet.load_param(\"model.ncnn.param\");\nnet.load_model(\"model.ncnn.bin\");\n\nncnn::Mat in(224, 224, 3);\n\nauto ex = net.create_extractor();\nex.input(\"in0\", in);\n\nncnn::Mat out;\nex.extract(\"out0\", out);\n```\n\n**Or use Python**\n\n```python\nimport numpy as np\nimport ncnn\n\nnet = ncnn.Net()\nnet.load_param(\"model.ncnn.param\")\nnet.load_model(\"model.ncnn.bin\")\n\nx = np.zeros((3, 224, 224), np.float32)\nmat = ncnn.Mat(x)\n\nex = net.create_extractor()\nex.input(\"in0\", mat)\n\nret, out = ex.extract(\"out0\")\nprint(np.array(out).shape)\n```\n\n</td>\n</tr>\n</table>\n\nSee [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.\n\n---","github_created_at":"2017-06-30T10:55:37+00:00","created_at":"2026-07-11T23:37:29.619608+00:00","updated_at":"2026-10-03T06:00:31.029176+00:00","categories":[{"slug":"inference-serving","name":"Inference & Serving","url":"https://www.graphcanon.com/categories/inference-serving","markdown_url":"https://www.graphcanon.com/categories/inference-serving.md","api_url":"https://www.graphcanon.com/api/graphcanon/categories/inference-serving"}],"tags":[{"slug":"android","name":"android"},{"slug":"arm-neon","name":"arm-neon"},{"slug":"artificial-intelligence","name":"artificial-intelligence"},{"slug":"caffe","name":"caffe"},{"slug":"darknet","name":"darknet"},{"slug":"deep-learning","name":"deep-learning"},{"slug":"high-performance","name":"high-performance"},{"slug":"inference","name":"inference"}],"trust":{"provenance":{"is_fork":false,"github_id":95879426,"owner_type":"Organization","methodology":"github_public_v1","parent_repo":null,"near_duplicate_slugs":[]},"computed_at":"2026-10-03T06:00:30.255Z","maintenance":{"label":"Very active","score":96,"methodology":"github_public_v1","releases_90d":0,"days_since_push":1,"last_release_at":"2026-05-26T13:57:09Z","stars_delta_30d":261,"open_issues_delta_30d":8},"security_summary":{"status":"no_lockfile","scanner":null,"low_count":0,"high_count":0,"last_scan_at":"2026-07-11T23:37:32.411Z","medium_count":0,"scan_profile":"none","critical_count":0}},"capability_facts":{"scan":{"source":"repo_scan","observed_at":"2026-10-03T06:00:30.742Z"},"languages":{"value":["c++","python"],"source":"github.language+pyproject.toml","observed_at":"2026-10-03T06:00:30.742Z"},"license_spdx":{"value":"Other","source":"github.license","observed_at":"2026-10-03T06:00:30.742Z"}},"decision_facts":{"hosting":null,"pricing":{"model":"unknown"},"requirements":{"notes":["Requires pnnx for exporting PyTorch models to ncnn."],"min_ram_gb":null,"requires_docker":false},"constraints":{"min_ram_gb":null,"pricing_model":"unknown","requires_docker":false},"when_to_use":["For users requiring fast inference speeds optimized for mobile devices such as Android and iOS.","When integration with existing C++ or Python codebases is necessary without the need for a bulky runtime environment."],"when_not_to_use":["If working in an environment where GPU acceleration on desktop or server is more beneficial than CPU efficiency.","For tasks that demand extensive training within the framework itself, as ncnn focuses on inference rather than training capabilities."],"source":"enrich:decision_facts","observed_at":"2026-07-17T02:10:24.476Z"},"constraint_facets":{"min_ram_gb":null,"pricing_model":"unknown","requires_docker":false},"decision_summary":[{"label":"Pricing","value":"unknown"},{"label":"Requirements","value":"Requires pnnx for exporting PyTorch models to ncnn."},{"label":"Adopt for","value":"ncnn is a high-performance framework for deep learning inference on mobile platforms written in C++, supporting conversion from multiple DL frameworks via pnnx."},{"label":"License detail","value":"Other, details not specified within the provided repository content."}]}}