Skip to content

slam-mer/depth_inference

Repository files navigation

Depth Inference

Depth Inference is a C++ library for monocular depth estimation with ONNX Runtime. It provides a simple interface to run inference, retrieve point maps and confidence maps, and integrate with consumer projects via CMake.

If you are using this module as part of SLAM-MER, see the main project README: SLAM-MER README.

Usage

Download

Typical git commands to clone the repository and initialize submodules:

# Clone depth_inference
git clone https://github.com/slam-mer/depth_inference.git
# Go to the repository directory
cd depth_inference
# Initialize and update submodules
git submodule update --init --recursive

Compilation

The code has been tested on Ubuntu 24.04 with CUDA 12.8. To simplify compilation, we use mise tasks. Please make sure mise is installed on your machine. Check and update mise.toml accordingly, especially the CUDA version and architecture.

Install system prerequisites:

sudo apt install libc++-18-dev libc++abi-18-dev

Set up the local environment:

# Set up trusted configuration
mise trust
# Install tools
mise install
# Create local Python environment
uv sync

Optional Python extras:

# Development tooling (pre-commit)
uv sync --extra dev

To install and register pre-commit hooks:

pre-commit install
pre-commit run --all-files

It is also recommended to install and configure GitHub CLI for downloading ONNX models from GitHub Releases.

Run the following commands from the root of depth_inference to build from scratch:

# Install ONNX Runtime
mise run configure_onnx
# Build and install depth_inference
mise run build
# Optional: install ONNX model assets
mise run install_assets

For the complete list of configurable CMake flags, see cmake/Options.cmake.

What each step does:

  1. mise run configure_onnx Downloads and unpacks ONNX Runtime to thirdparty/onnxruntime-linux-x64-gpu-${ONNX_VERSION}.
  2. mise run build Configures and builds the depth inference library with CMake + Ninja and installs to build/install.
  3. mise run install_assets Downloads ONNX model assets from GitHub Releases into assets/.

Manual build alternative (without mise)

cmake -B build -S . \
    -DCMAKE_BUILD_TYPE=Release \
    -DBUILD_TESTS=OFF \
    -DCMAKE_INSTALL_PREFIX=./build/install \
    -GNinja
ninja -C build
ninja -C build install

CMake Integration (Consumer Project)

find_package(depth_inference REQUIRED)
target_link_libraries(your_target PRIVATE depth_inference)

ONNX models

We provide some ONNX models. Check assets for instructions on how to download them.

Unit Tests

Compile with -DBUILD_TESTS=ON to enable unit tests.

Tests can be found in tests/.

Citation

If you use this repository, please cite:

@inproceedings{merl2026revisiting,
  author = {Piedade, Valter and Manam, Lalit and Yamazaki, Masashi and Miraldo, Pedro},
  title = {Revisiting Monocular SLAM with Spatio-Temporal Scene Modeling},
  booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
  year = {2026}
}

Contact

Pedro Miraldo
Senior Principal Research Scientist Mitsubishi Electric Research Laboratories miraldo@merl.com

Valter Piedade
PhD Student in Electrical and Computer Engineering Instituto Superior Tecnico, Lisbon (MERL consultant)

License

Released under the AGPL-3.0-or-later license, as described in LICENSE.md.

All files, except those listed in LICENSE-THIRD-PARTY.md, have:

Copyright (C) 2026 Mitsubishi Electric Research Laboratories (MERL)
SPDX-License-Identifier: AGPL-3.0-or-later

About

Implementation of the module for single-image depth inference used in SLAM-MER.

Resources

License

Unknown, Unknown licenses found

Licenses found

Unknown
LICENSE.md
Unknown
LICENSE-THIRD-PARTY.md

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors