burn_depth

Crates.ioburn_depth
lib.rsburn_depth
version0.2.0
created_at2025-11-04 20:54:47.450913+00
updated_at2025-11-05 22:47:28.800113+00
descriptionburn depth pro model inference
homepagehttps://github.com/mosure/burn_depth
repositoryhttps://github.com/mosure/burn_depth
max_upload_size
id1916929
size376,612
Mitchell Mosure (mosure)

documentation

README

burn_depth 🔥📐😎

test crates.io

burn depth pro model inference

input metric depth
Alt text Alt text

usage

use burn::prelude::*;
use burn_depth::{InferenceBackend, model::depth_pro::DepthPro};

// NdArray backend (alternatively: burn::backend::Cuda, burn::backend::Cpu)
let device = <InferenceBackend as Backend>::Device::default();

let model = DepthPro::<InferenceBackend>::load(&device, "assets/model/depth_pro.mpk")?;

// Image tensor with shape [1, 3, H, W] (batch, channels, height, width)
let input: Tensor<InferenceBackend, 4> = Tensor::zeros([1, 3, 512, 512], &device);

let result = model.infer(input, None);
// result.depth: Tensor<InferenceBackend, 3> with shape [1, H, W]
// result.focallength_px: Tensor<InferenceBackend, 1> with shape [1]

setup

  • download depth_pro.pt to assets/model/
  • cargo run --bin import --features import
  • cargo run --example inference
Commit count: 0

cargo fmt