mirror of
https://github.com/mii443/usls.git
synced 2025-08-22 15:45:41 +00:00
16
examples/depth-anything/README.md
Normal file
16
examples/depth-anything/README.md
Normal file
@ -0,0 +1,16 @@
|
||||
## Quick Start
|
||||
|
||||
```shell
|
||||
cargo run -r --example depth-anything
|
||||
```
|
||||
|
||||
## ONNX Model
|
||||
|
||||
- [depth-anything-s-dyn](https://github.com/jamjamjon/assets/releases/download/v0.0.1/depth-anything-s-dyn.onnx)
|
||||
- [depth-anything-b-dyn](https://github.com/jamjamjon/assets/releases/download/v0.0.1/depth-anything-b-dyn.onnx)
|
||||
- [depth-anything-l-dyn](https://github.com/jamjamjon/assets/releases/download/v0.0.1/depth-anything-l-dyn.onnx)
|
||||
|
||||
|
||||
## Results
|
||||
|
||||

|
BIN
examples/depth-anything/demo.png
Normal file
BIN
examples/depth-anything/demo.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 180 KiB |
23
examples/depth-anything/main.rs
Normal file
23
examples/depth-anything/main.rs
Normal file
@ -0,0 +1,23 @@
|
||||
use usls::{models::DepthAnything, Annotator, DataLoader, Options};
|
||||
|
||||
fn main() -> Result<(), Box<dyn std::error::Error>> {
|
||||
// visual
|
||||
let options = Options::default()
|
||||
.with_model("../models/depth-anything-s-dyn.onnx")
|
||||
.with_i00((1, 1, 8).into())
|
||||
.with_i02((384, 512, 1024).into())
|
||||
.with_i03((384, 512, 1024).into());
|
||||
let 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_saveout("Depth-Anything");
|
||||
annotator.annotate(&x, &y);
|
||||
|
||||
Ok(())
|
||||
}
|
Reference in New Issue
Block a user