Home

Awesome

DepthAnything-ROS

DepthAnything-ROS is ROS2 wrapper for Depth-Anything.

https://github.com/scepter914/DepthAnything-ROS/assets/16330533/9fb5edd2-21b0-4441-a7c1-b304246e49b5

Get started

Set environment

See ROS2 document.

To install ROS2 easily, I recommend to use ansible script of Autoware. In detail, please see the installation page.

sudo apt install libgflags-dev libboost-all-dev

If you don't have any rosbag, I recommend rosbag for Nuscenes dataset.

Set onnx files

Set onnx files for DepthAnything-ROS/data or set onnx_path parameter.

  <arg name="onnx_path" default="$(find-pkg-share depth_anything)/data/depth_anything_vitb14.onnx" />

Run below command to get the onnx files of pre-train model.

# Install gdown
pip install gdown
# Download onnx file
mkdir data && cd data
gdown 1jFTCJv0uJovPAww9PHCYAoek-KfeajK_

If you want to make onnx files at yourself, please use depth-anything-tensorrt.

Launch

ros2 launch depth_anything depth_anything.launch.xml

Interface

Input

The input image.

Output

The depth image made by DepthAnything.

Parameters

The path to onnx file.

The precision mode to use quantization. DepthAnything-ROS supports in "fp32" or "fp16" (#2) for now.

Note

Build for TensorRT engine

When you run on the first start up, you need to wait about 5 minutes for build step.

Performance

ModelParamsRTX4090 TensorRTRTX2070 TensorRT
Depth-Anything-Small24.8M3 ms27 ms, VRAM 300MB
Depth-Anything-Base97.5M6 ms65 ms, VRAM 700MB
Depth-Anything-Large335.3M12 ms200 ms, VRAM 1750MB

Reference