Files
usls/examples/depth-anything/main.rs
Jamjamjon fc970fc117 Update ort and improve the speed of preprocessing
* Add onnx proto

* Update ort to 2.0.0-rc.2

* Improve the speed of resizing

* Fix yolo-seg bug

* Update README.md
2024-05-12 18:12:34 +08:00

26 lines
685 B
Rust

use usls::{models::DepthAnything, Annotator, DataLoader, Options};
fn main() -> Result<(), Box<dyn std::error::Error>> {
// visual
let options = Options::default()
.with_model("depth-anything-s-dyn.onnx")?
.with_i00((1, 1, 8).into())
.with_i02((384, 512, 1024).into())
.with_i03((384, 512, 1024).into());
let mut model = DepthAnything::new(options)?;
// load
let x = vec![DataLoader::try_read("./assets/2.jpg")?];
// run
let y = model.run(&x)?;
// annotate
let annotator = Annotator::default()
.with_colormap("Turbo")
.with_saveout("Depth-Anything");
annotator.annotate(&x, &y);
Ok(())
}