Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 5 additions & 0 deletions rust/CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -6,6 +6,11 @@ crate is versioned independently of the Python package in this repository.
Entries for releases before 0.3.0 were reconstructed from the commit history,
since those versions were published manually and without tags.

## 0.4.0

- Downgrade `ort` to 2.0.0-rc.10 to restore support for Intel macOS.
- Downgrade `ndarray` to 0.16 to match the version used by `ort` 2.0.0-rc.10.

## 0.3.0

- Upgrade `ort` to 2.0.0-rc.12. This is the fix for 0.2.2 no longer being
Expand Down
143 changes: 117 additions & 26 deletions rust/Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

8 changes: 4 additions & 4 deletions rust/Cargo.toml
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
[package]
name = "trustmark"
description = "A Rust implementation of TrustMark"
version = "0.3.0"
version = "0.4.0"
authors = [
"John Collomosse <collomos@adobe.com>",
"Maurice Fisher <mfisher@adobe.com>",
Expand Down Expand Up @@ -29,9 +29,9 @@ harness = false
[dependencies]
image = "0.25.6"
fast_image_resize = { version = "5.1.4", features = ["image", "rayon"] }
ndarray = "0.17"
ort = "=2.0.0-rc.12"
ort-sys = { version = "=2.0.0-rc.12", default-features = false }
ndarray = "0.16"
ort = "=2.0.0-rc.10"
ort-sys = { version = "=2.0.0-rc.10", default-features = false }
thiserror = "1"

[dev-dependencies]
Expand Down
4 changes: 2 additions & 2 deletions rust/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -18,7 +18,7 @@ Open an issue if there's something in the Python version that want added to this

## Platform Support

Building this crate requires Rust 1.88 or newer. TrustMark 0.3.0 uses [ort](https://ort.pyke.io) 2.0.0-rc.12 as its ONNX runtime, so it can only be used on platforms supported by that crate. See [the documentation](https://ort.pyke.io/setup/platforms) for supported platforms.
Building this crate requires Rust 1.88 or newer. TrustMark 0.4.0 uses [ort](https://ort.pyke.io) 2.0.0-rc.10 as its ONNX runtime, so it can only be used on platforms supported by that crate. See [the documentation](https://ort.pyke.io/setup/platforms) for supported platforms.

In particular, the ONNX runtime requires either:

Expand Down Expand Up @@ -61,7 +61,7 @@ Add `trustmark` to your project's `cargo` manifest with:
cargo add trustmark
```

This installs the version available on crates.io; TrustMark 0.3.0 contains the ORT rc.12 upgrade.
This installs the version available on crates.io; TrustMark 0.4.0 contains the ORT rc.10 change.

A basic example of using `trustmark` is:

Expand Down
12 changes: 4 additions & 8 deletions rust/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -99,16 +99,12 @@ impl Trustmark {
version: Version,
) -> Result<Self, Error> {
let encoder = Session::builder()?
.with_optimization_level(GraphOptimizationLevel::Level3)
.map_err(ort::Error::from)?
.with_intra_threads(8)
.map_err(ort::Error::from)?
.with_optimization_level(GraphOptimizationLevel::Level3)?
.with_intra_threads(8)?
.commit_from_file(models.as_ref().join(variant.encoder_filename()))?;
let decoder = Session::builder()?
.with_optimization_level(GraphOptimizationLevel::Level3)
.map_err(ort::Error::from)?
.with_intra_threads(8)
.map_err(ort::Error::from)?
.with_optimization_level(GraphOptimizationLevel::Level3)?
.with_intra_threads(8)?
.commit_from_file(models.as_ref().join(variant.decoder_filename()))?;
Ok(Self {
encoder: Mutex::new(encoder),
Expand Down
Loading