diff options
author | Edgar Riba <edgar.riba@gmail.com> | 2024-12-21 12:06:03 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2024-12-21 12:06:03 +0100 |
commit | 5c2f893e5aa21c9f7c82a00407edb6d76db1d06c (patch) | |
tree | b0f90e5c82f676a8935afbf2db2f468e43d298ad /candle-examples | |
parent | 67cab7d6b8279f953b0a8cc5012b135b9743cdc8 (diff) | |
download | candle-5c2f893e5aa21c9f7c82a00407edb6d76db1d06c.tar.gz candle-5c2f893e5aa21c9f7c82a00407edb6d76db1d06c.tar.bz2 candle-5c2f893e5aa21c9f7c82a00407edb6d76db1d06c.zip |
make DepthAnythingV2 more reusable (#2675)
* make DepthAnythingV2 more reusable
* Fix clippy lints.
---------
Co-authored-by: laurent <laurent.mazare@gmail.com>
Diffstat (limited to 'candle-examples')
-rw-r--r-- | candle-examples/examples/depth_anything_v2/main.rs | 6 |
1 files changed, 2 insertions, 4 deletions
diff --git a/candle-examples/examples/depth_anything_v2/main.rs b/candle-examples/examples/depth_anything_v2/main.rs index ef337eba..2608b40d 100644 --- a/candle-examples/examples/depth_anything_v2/main.rs +++ b/candle-examples/examples/depth_anything_v2/main.rs @@ -6,10 +6,8 @@ extern crate accelerate_src; #[cfg(feature = "mkl")] extern crate intel_mkl_src; -use std::ffi::OsString; -use std::path::PathBuf; - use clap::Parser; +use std::{ffi::OsString, path::PathBuf, sync::Arc}; use candle::DType::{F32, U8}; use candle::{DType, Device, Module, Result, Tensor}; @@ -82,7 +80,7 @@ pub fn main() -> anyhow::Result<()> { }; let config = DepthAnythingV2Config::vit_small(); - let depth_anything = DepthAnythingV2::new(&dinov2, &config, vb)?; + let depth_anything = DepthAnythingV2::new(Arc::new(dinov2), config, vb)?; let (original_height, original_width, image) = load_and_prep_image(&args.image, &device)?; |