Skip to content

scepter914/DepthAnything-ROS

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

13 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

DepthAnything-ROS

DepthAnything-ROS is a ROS2 wrapper for Depth-Anything.

nuscenes_demo.mp4

Environment

  • Ubuntu 22.04.01, ROS2 Humble
  • CUDA 12.3, cuDNN 8.9.5.29-1+cuda12.2, TensorRT 8.6.1.6-1+cuda12.0

Get Started

Set Up the Environment

    1. Install ROS2

See the ROS2 installation documentation for detailed instructions. To install ROS2 easily, I recommend using the Ansible script from Autoware. For more details, refer to the installation guide.

    1. Install dependencies
sudo apt install libgflags-dev libboost-all-dev
    1. Prepare your rosbag

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

  • Set ONNX Files

Place the ONNX files in the DepthAnything-ROS/data directory, or set the onnx_path parameter in the launch file.

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

To download the ONNX files for the pre-trained model, run the following commands:

# Install gdown
pip install gdown

# Download ONNX file
mkdir -p data && cd data
gdown 1jFTCJv0uJovPAww9PHCYAoek-KfeajK_

If you prefer to create the ONNX files yourself, you can use depth-anything-tensorrt.

Launch the node

ros2 launch depth_anything depth_anything.launch.xml

Interface

Input

  • input/image (sensor_msgs::msg::Image)
    • The input image.

Output

  • ~/output/depth_image (sensor_msgs::msg::Image)
    • The depth image generated by DepthAnything.

Parameters

  • onnx_path (string)
    • Default: $(find-pkg-share depth_anything)/data/depth_anything_vitb14.onnx
    • The path to the ONNX file.
  • precision (string)
    • Default: "fp32"
    • The precision mode to use for quantization. DepthAnything-ROS supports "fp32" or "fp16" (#2).

Notes

Building the TensorRT Engine

The first time you run the system, you may need to wait for about 5 minutes for the build process to complete.

Performance

  • Performance data is based on results from an RTX4090 and RTX2070.
Model Params RTX4090 TensorRT RTX2070 TensorRT
Depth-Anything-Small 24.8M 3 ms 27 ms, VRAM 300MB
Depth-Anything-Base 97.5M 6 ms 65 ms, VRAM 700MB
Depth-Anything-Large 335.3M 12 ms 200 ms, VRAM 1750MB

References

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published