Code Monkey home page Code Monkey logo

onnxruntime-rs's Introduction

onnxruntime

Cargo CI Nix CI

This crate provides bindings to onnxruntime. Raw bindings to the C API (sys module) as well as some opinionated wrappers to make onnxruntime usable safely from plain Rust.

In order to build and use this crate with cargo you must either have onnxruntime installed on your system or point to the release (or build) of onnxruntime you want to use manually.

Tested (on Linux) with onnxruntime versions:

Download the latest release of onnxruntime

Download from: https://github.com/microsoft/onnxruntime/releases

Then either install it globally (for example /usr/local/{lib,include/) or export the following environment variables:

ONNXRUNTIME_LIB_DIR: path to the lib directory of the release ONNXRUNTIME_INCLUDE_DIR: path to the include directory of the release

Also make sure the lib directory is also part of LD_LIBRARY_PATH.

Build onnxruntime from source

Follow the guide at: https://github.com/microsoft/onnxruntime/blob/master/BUILD.md

For Linux/Mac OS X:

  • The lib directory will be: onnxruntime/build/Linux/RelWithDebInfo/
  • The include directory will be: onnxruntime/include/onnxruntime/core/session/

In onnxruntime directory:

./build.sh --config RelWithDebInfo --build_shared_lib --parallel
export ONNXRUNTIME_LIB_DIR=$PWD/build/Linux/RelWithDebInfo/
export ONNXRUNTIME_INCLUDE_DIR=$PWD/include
export LD_LIBRARY_PATH=$ONNXRUNTIME_LIB_DIR:$LD_LIBRARY_PATH

License

MIT License

Copyright 2020 Basile Henry, Chris Chalmers

onnxruntime-rs's People

Contributors

andreytkachenko avatar basile-henry avatar cchalmers avatar

Watchers

 avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.