mirror of
https://github.com/mii443/usls.git
synced 2025-08-22 15:45:41 +00:00
- Added `Hub` for resource management - Updated `DataLoader` to support video and streaming - Updated `CI` - Replaced `println!` with `tracing` for logging
27 lines
735 B
Rust
27 lines
735 B
Rust
use usls::{models::DepthAnything, Annotator, DataLoader, Options};
|
|
|
|
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
|
// options
|
|
let options = Options::default()
|
|
// .with_model("depth-anything/v1-s-dyn.onnx")?
|
|
.with_model("depth-anything/v2-s.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 = [DataLoader::try_read("images/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(())
|
|
}
|