TrustMark — Rust
An implementation of TrustMark watermarking for the Content Authenticity Initiative (CAI) in Rust, as described in:
TrustMark - Universal Watermarking for Arbitrary Resolution Images
https://arxiv.org/abs/2311.18297
Tu Bui1, Shruti Agarwal2, John Collomosse1,2
1DECaDE Centre for the Decentralized Digital Economy, University of Surrey, UK.
2Adobe Research, San Jose CA.
This is a re-implementation of the trustmark Python library.
Quick start
cargo add trustmark
Download models
From the workspace root, run:
$ cargo xtask fetch-models
Run the CLI
From the workspace root, run:
$ cargo run --release -p trustmark-cli -- -m ./models encode -i ./images/bfly_rgba.png -o ./images/encoded.png
$ cargo run --release -p trustmark-cli -- -m ./models decode -i ./images/encoded.png
Use the library
use ;
let tm = new.unwrap;
let input = open.unwrap;
let output = tm.encode;
Running the benchmarks
Rust benchmarks
To run the Rust benchmarks, run:
cargo bench
Python benchmarks
To run the Python benchmarks, run the following from the workspace root:
benches/load.sh && benches/encode.sh
Differences from the Python version
This crate implements a subset of the functionality of the Python version. Open an issue if there's something in the Python version that would be useful in this crate!