mirror of
https://github.com/mii443/usls.git
synced 2025-08-22 15:45:41 +00:00
🐍 v0.1.0 (#53)
This commit is contained in:
@ -1,24 +1,26 @@
|
||||
use anyhow::Result;
|
||||
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_ixx(0, 2, (384, 512, 1024).into())
|
||||
.with_ixx(0, 3, (384, 512, 1024).into());
|
||||
fn main() -> Result<()> {
|
||||
tracing_subscriber::fmt()
|
||||
.with_env_filter(tracing_subscriber::EnvFilter::from_default_env())
|
||||
.with_timer(tracing_subscriber::fmt::time::ChronoLocal::rfc_3339())
|
||||
.init();
|
||||
|
||||
// build model
|
||||
let options = Options::depth_anything_v2_small().commit()?;
|
||||
let mut model = DepthAnything::new(options)?;
|
||||
|
||||
// load
|
||||
let x = [DataLoader::try_read("images/street.jpg")?];
|
||||
|
||||
// run
|
||||
let y = model.run(&x)?;
|
||||
let y = model.forward(&x)?;
|
||||
|
||||
// annotate
|
||||
let annotator = Annotator::default()
|
||||
.with_colormap("Turbo")
|
||||
.with_saveout("Depth-Anything");
|
||||
.with_saveout(model.spec());
|
||||
annotator.annotate(&x, &y);
|
||||
|
||||
Ok(())
|
||||
|
Reference in New Issue
Block a user