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.
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 --recursiveThe 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-devSet up the local environment:
# Set up trusted configuration
mise trust
# Install tools
mise install
# Create local Python environment
uv syncOptional Python extras:
# Development tooling (pre-commit)
uv sync --extra devTo install and register pre-commit hooks:
pre-commit install
pre-commit run --all-filesIt 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_assetsFor the complete list of configurable CMake flags, see
cmake/Options.cmake.
What each step does:
mise run configure_onnxDownloads and unpacks ONNX Runtime tothirdparty/onnxruntime-linux-x64-gpu-${ONNX_VERSION}.mise run buildConfigures and builds the depth inference library with CMake + Ninja and installs tobuild/install.mise run install_assetsDownloads ONNX model assets from GitHub Releases intoassets/.
cmake -B build -S . \
-DCMAKE_BUILD_TYPE=Release \
-DBUILD_TESTS=OFF \
-DCMAKE_INSTALL_PREFIX=./build/install \
-GNinja
ninja -C build
ninja -C build installfind_package(depth_inference REQUIRED)
target_link_libraries(your_target PRIVATE depth_inference)We provide some ONNX models. Check assets for instructions on how to download them.
Compile with -DBUILD_TESTS=ON to enable unit tests.
Tests can be found in tests/.
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}
}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)
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