{"id":16270291,"url":"https://github.com/tpoisonooo/rust-ncnn","last_synced_at":"2025-09-02T09:30:48.158Z","repository":{"id":57643758,"uuid":"436103967","full_name":"tpoisonooo/rust-ncnn","owner":"tpoisonooo","description":"ncnn Rust API.","archived":false,"fork":false,"pushed_at":"2023-12-19T11:53:16.000Z","size":150,"stargazers_count":39,"open_issues_count":5,"forks_count":9,"subscribers_count":2,"default_branch":"master","last_synced_at":"2024-12-28T08:24:27.185Z","etag":null,"topics":["deep-learning","deeplearning","ncnn","rust","vulkan"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"apache-2.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/tpoisonooo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null}},"created_at":"2021-12-08T03:29:19.000Z","updated_at":"2024-10-11T01:21:38.000Z","dependencies_parsed_at":"2023-12-19T12:19:15.552Z","dependency_job_id":"126828e0-badd-47e9-8ce3-1df8906a90f0","html_url":"https://github.com/tpoisonooo/rust-ncnn","commit_stats":{"total_commits":34,"total_committers":5,"mean_commits":6.8,"dds":"0.20588235294117652","last_synced_commit":"bd2036f069f4645a3e7f2d255a386deae91daf91"},"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpoisonooo%2Frust-ncnn","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpoisonooo%2Frust-ncnn/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpoisonooo%2Frust-ncnn/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/tpoisonooo%2Frust-ncnn/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/tpoisonooo","download_url":"https://codeload.github.com/tpoisonooo/rust-ncnn/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":231768723,"owners_count":18423790,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["deep-learning","deeplearning","ncnn","rust","vulkan"],"created_at":"2024-10-10T18:10:04.769Z","updated_at":"2024-12-29T17:43:25.142Z","avatar_url":"https://github.com/tpoisonooo.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"\u003cdiv align=\"center\"\u003e\n\u003cimg src=\"images/logo-512.jpg\" width=\"128\"/\u003e\n\u003c/div\u003e\n\n## rust-ncnn\n[![GitHub license](https://img.shields.io/badge/license-apache--2--Clause-brightgreen.svg)](./LICENSE) [![CI](https://img.shields.io/github/actions/workflow/status/tpoisonooo/rust-ncnn/ci.yaml?branch=master)](https://github.com/tpoisonooo/rust-ncnn/actions/workflows/ci.yaml?query=workflow%3A)\n\nRust bindings for [ncnn](https://github.com/tencent/ncnn).\n\n## Docs\n\nOpen Github pages\n* [ncnn_rs](https://rust-ncnn.github.io/ncnn_rs/) - safe ncnn abstractions\n* [ncnn_bind](https://rust-ncnn.github.io/ncnn_bind/) - low-level bindings\n\nOr `cargo doc` and open with browser byself\n\n```bash\ncd /path/to/rust-ncnn\ncargo doc --open\n```\n\n## Prequisition\n\n### Rust Env\n```bash\ncurl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh\n```\n\n\n### CMake \u003e= 3.12\n\nRust cmake needs `--parallel` option thus CMake\u003e=3.12 is complusory\n\n```bash\npip install cmake --upgrade --user\n```\n\n### Clang \u003e= 3.9\n\nRust bindgen uses `clang` to generate `bindings.rs` from `c_api.h`\n\n```bash\nsudo apt install clang-3.9 libclang-3.9-dev\nsudo apt install clang-10 libclang-10-dev # use clang-10 for ubuntu 20.04 \nsudo apt install clang libclang-dev # use clang-14 for Linux maixbox 5.15.7 \n```\n\n## Build\n\nncnn build from source:\n```bash\ncd rust-ncnn/\ncargo run --example get_version\n# print YYYYMMDD\n```\n\nUse specific ncnn release:\n```bash\nexport NCNN_TAG=\"20231027\"\n```\n\n[Here](https://github.com/Tencent/ncnn/tags) is all available release tags.\n\nUse prebuilt ncnn:\n```bash\nexport NCNN_DIR=\"/path/to/your/ncnn/lib\"\n```\n\nOr use vcpkg\n```bash\nvcpkg install ncnn:x64-windows-static-md\ncargo run --example get_version\n```\n\n## Linking\n\nBy default library uses dynamic **linking on linux** and **static linking on windows**.\n\nTo explicitly use static linking:\n```bash\ncargo build --example benchmark --features ncnn-bind/static\n```\n\nTo explicitly use dynamic linking:\n```bash\ncargo build --example benchmark --features ncnn-bind/dynamic\n```\n\n## Vulkan\n\nBuild with Vulkan support (requires Vulkan SDK):\n```bash\ncargo build --example benchmark --features ncnn-bind/vulkan\n```\n\n## Run Examples and UnitTest\n\n```bash\ncargo test\ncargo run --example get_version\ncargo run --example benchmark --release\n    Finished release [optimized] target(s) in 0.01s\n     Running `target/release/examples/benchmark`\nsqueezenet.param \t\t 2 ms\nsqueezenet_int8.param \t\t 5 ms\nmobilenet.param \t\t 3 ms\nmobilenet_int8.param \t\t 7 ms\nmobilenet_v2.param \t\t 3 ms\nmobilenet_v3.param \t\t 2 ms\nshufflenet.param \t\t 2 ms\nshufflenet_v2.param \t\t 2 ms\nmnasnet.param \t\t 2 ms\nproxylessnasnet.param \t\t 3 ms\nefficientnet_b0.param \t\t 5 ms\nregnety_400m.param \t\t 6 ms\nblazeface.param \t\t 0 ms\ngooglenet.param \t\t 10 ms\ngooglenet_int8.param \t\t 19 ms\nresnet18.param \t\t 9 ms\nresnet18_int8.param \t\t 16 ms\nalexnet.param \t\t 7 ms\nvgg16.param \t\t 49 ms\nvgg16_int8.param \t\t 71 ms\nresnet50.param \t\t 18 ms\nresnet50_int8.param \t\t 40 ms\nsqueezenet_ssd.param \t\t 17 ms\nsqueezenet_ssd_int8.param \t\t 13 ms\nmobilenet_ssd.param \t\t 8 ms\nmobilenet_ssd_int8.param \t\t 15 ms\nmobilenet_yolo.param \t\t 30 ms\nmobilenetv2_yolov3.param \t\t 13 ms\nyolov4-tiny.param \t\t 20 ms\nnanodet-plus-m_416.param \t\t 11 ms\nnanodet-plus-m_416-int8.param \t\t 20 ms\n```\n\n## FAQ\n* cross-build: rust-ncnn currently **not support** cross-build, please excute `cargo build` on target board.\n\n\n## Acknowledgements\n\n* [lit-robotics/rust-ncnn](https://github.com/lit-robotics/rust-ncnn)\n* [ncnn](https://github.com/tencent/ncnn)\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftpoisonooo%2Frust-ncnn","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftpoisonooo%2Frust-ncnn","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftpoisonooo%2Frust-ncnn/lists"}