ncnn Rust API.

Related tags

Utilities rust ncnn
Overview

rust-ncnn

ncnn Rust API.

Prequisition

Rust Env

$ curl --proto '=https' --tlsv1.2 https://sh.rustup.rs -sSf | sh

CMake >= 3.12

Rust cmake needs --parallel option thus CMake3.12 is complusory

$ pip install cmake --upgrade --user

Clang >= 3.9

Rust bindgen use clang to generate bindings.rs with c_api.h.

$ sudo apt install clang-3.9   libclang-3.9-dev

Build

build with libncnn.so by default.

$ cd rust-ncnn/
$ cargo run --example get_version

build with prebuild ncnn

$ export NCNN_DIR="/path/to/your/ncnn/lib"

build with libncnn.a (not recommand because of libomp link error)

$ export CARGO_FEATURE_STATIC=""
$ cargo build --example get_version

Run Examples and UnitTest

$ cargo test
$ cargo run --example get_version
$ cargo run --example benchmark --release
...
squeezenet.param 		 20 ms
squeezenet_int8.param 		 98 ms
mobilenet.param 		 35 ms
mobilenet_int8.param 		 112 ms
mobilenet_v2.param 		 25 ms
mobilenet_v3.param 		 20 ms
shufflenet.param 		 20 ms
shufflenet_v2.param 		 17 ms
mnasnet.param 		 23 ms
proxylessnasnet.param 		 26 ms
efficientnet_b0.param 		 37 ms
regnety_400m.param 		 27 ms
blazeface.param 		 6 ms
googlenet.param 		 85 ms
googlenet_int8.param 		 267 ms
resnet18.param 		 87 ms
resnet18_int8.param 		 349 ms
alexnet.param 		 114 ms
vgg16.param 		 277 ms
vgg16_int8.param 		 2029 ms
resnet50.param 		 141 ms
resnet50_int8.param 		 533 ms
squeezenet_ssd.param 		 149 ms
squeezenet_ssd_int8.param 		 252 ms
mobilenet_ssd.param 		 69 ms
mobilenet_ssd_int8.param 		 210 ms
mobilenet_yolo.param 		 160 ms
mobilenetv2_yolov3.param 		 73 ms
yolov4-tiny.param 		 103 ms
You might also like...
Simple fake AWS Cognito User Pool API server for development.

Fakey Cognito 🏡 Homepage Simple fake AWS Cognito API server for development. ✅ Implemented features AdminXxx on User Pools API. Get Started # run wit

Femtorinth is a library to interact with a sub-set of the Modrinth API.

Femtorinth Femtorinth is a rust library to interact with a sub-set of the Modrinth api, it only includes the api calls that don't need auth (a.k.a onl

C API to SpringQL (for embedded mode)

SpringQL C Client This repository is a C client for SpringQL and provides it provides: springql.h: C header file. libspringql_client.{so,dylib}: Share

Stream-based FSEvents API bindings.

fsevent-stream Stream-based FSEvents API bindings. Features Support directory-granular and file-granular events. Retrieve related file inode with kFSE

Interact with the crate's API

cargo-api Interact with the crate's API Documentation Installation Getting Started Reference FAQ Contribute CHANGELOG Install Download a pre-built bin

This article is about the unsound api which I found in owning_ref. Owning_ref is a library that has 11 million all-time downloads and 60 reverse dependencies.

Unsoundness in owning_ref This article is about the unsound api which I found in owning_ref. Owning_ref is a library that has 11 million all-time down

weggli-native a "native" C API for Google's weggli

weggli-native a "native" C API for Google's weggli

Manage self-hosted Supabase instances with an easy to use API & Web Portal (soon)

SupaManager A project by Harry Bairstow; Manage self-hosted Supabase instances with an easy to use API & Web Portal (soon) ⚠️ Note: The project is in

Bindings to the Tauri API for projects using wasm-bindgen

tauri-sys Raw bindings to the Tauri API for projects using wasm-bindgen Installation This crate is not yet published to crates.io, so you need to use

Comments
  • A couple of questions

    A couple of questions

    Hi, thanks for a great crate!

    I have a few questions:

    • What is the reason for using ncnn fork instead of original repository? They seem the same except for an old version.
    • Would it make sense to make static build the default one? It seems like that is the usual use-case. Setting env variable for all projects seems redudant.
    opened by chemicstry 4
  • Fix safety bugs

    Fix safety bugs

    This fixes a couple of safety bugs:

    • Set proper mutability for various methods
    • Add lifetime to Extractor, otherwise Net can be dropped while Extractor is still in use
    • Consume Extractor within extract method as Extractor can only be used once
    opened by chemicstry 1
Owner
null
High level rust abstractions for the libretro API

libretro-rs Design Philosophy The approach to this crate can best be summarized as wanting to expose all functionality, even if not idiomatically. The

null 9 Dec 25, 2022
Rust library for interacting with the VTube Studio API

vtubestudio-rs A library for interacting with the VTube Studio API. Basic usage This example creates a Client using the provided builder, which: conne

null 6 Dec 4, 2022
⚡️ Fast MagicString port driven by Rust and N-API

magic-string-rs 100% API compatible (port) MagicString by Rich-Harris implementation for Node and modern browsers, also, for rust, of course. Installa

Hana 35 Nov 21, 2022
Rust crate for creating filters with DirectX shaders. Includes Scale, Color conversion using DirectX api.

DxFilter Scale and ColorConversion done with DirectX filters. You can also create your own filters with the provided api. Crate contains various tools

null 4 Aug 13, 2022
Examples of how to use Rust with Serverless Framework, Lambda, API Gateway v1 and v2, SQS, GraphQL, etc

Rust Serverless Examples All examples live in their own directories: project: there is nothing here, just a simple cargo new project_name with a custo

Fernando Daciuk 9 Dec 17, 2022
prelate-rs is an idiomatic, asynchronous Rust wrapper around the aoe4world API. Very much a WIP at this stage.

prelate-rs is an idiomatic, asynchronous Rust wrapper around the aoe4world API. Very much a WIP at this stage. Project Status We currently support the

William Findlay 4 Dec 29, 2022
An ActivityPub home server written in Rust, implementing the Mastodon API.

Tafarn An ActivityPub home server written in Rust, implementing the Mastodon API. At present no web UI is provided, the API is the only way to interac

✨ Q (it/its) ✨ 12 Jan 22, 2023
Rust wrapper for the Google Places API. Access their hundreds of millions of places, reviews, and ratings.

Google Places API Working Examples cargo run --example nearby_search cargo run --example place_details cargo run --example find_place cargo run --exam

Jared Ucherek 4 Jun 12, 2023
A scrapper that abstracts the IQ Option API calls into a Rust package.

IQ Option API - In Rust An abstraction of IQ Options API calls in a Rust library. License Licensed under either of MIT license (LICENSE-MIT or https:/

Vinícius Roque 8 Jul 17, 2023
Rust API deployed on Vercel.

This project is a Rust API deployed on Vercel. It is designed for users to build Rust code which can then be called using POST requests. This repository is an easy to use Rust-Vercel API that can be amended for your own requirements.

Ellie Sleightholm 3 Feb 28, 2024