Crates.io | mlua-tract |
lib.rs | mlua-tract |
version | 0.1.2 |
source | src |
created_at | 2024-01-07 19:03:12.18341 |
updated_at | 2024-02-17 15:05:35.09743 |
description | Lua bindings for tract, the tiny, no-nonsense, self-contained, Rust-based Tensorflow and ONNX inference runtime. |
homepage | https://on-prem.net |
repository | https://gitlab.com/megalithic-llc/mlua-tract.git |
max_upload_size | |
id | 1091966 |
size | 133,238 |
Lua bindings for tract, the tiny, no-nonsense, self-contained, Rust-based Tensorflow and ONNX inference runtime.
Add to your Rust project using one of MLua's features: [lua51, lua52, lua53, lua54, luajit, luajit52].
$ cargo add mlua-tract --features luajit
use mlua::Lua;
use mlua_tract;
let lua = Lua::new();
mlua_tract::preload(&lua)?;
let script = r#"
local tract_onnx = require('tract.onnx')
local model = tract_onnx.model_for_path('testdata/keras-tract-tf2-example.onnx')
return tostring(model:input_fact(1))
"#;
let result: String = lua.load(script).eval()?; // returns: "unk__6,100,F32"
$ make check