Repo symbol

mono_depth_viewer repository

mono_depth_viewer

ROS Distro
humble

Repository Summary

Checkout URI https://github.com/divagarn/mono_depth_ros2.git
VCS Type git
VCS Version main
Last Updated 2026-11-07
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Packages

Name Version
mono_depth_viewer 0.2.0

README

mono_depth_viewer

Qt viewer for monocular depth estimation on image topics recorded in ROS 2 bags (sqlite3 .db3). Runs transformer models (Depth Anything V1, DPT-Hybrid MiDaS) from Hugging Face and shows the camera image next to a colourised depth map.

Install (ROS 2 Humble)

mkdir -p ~/ros2_ws/src && cd ~/ros2_ws/src
git clone https://github.com/divagarn/mono_depth_ros2.git mono_depth_viewer
cd ~/ros2_ws
rosdep install --from-paths src --ignore-src -y
pip install transformers==4.40.2           # plus torch/torchvision; see requirements.txt
colcon build --symlink-install --packages-select mono_depth_viewer
source install/setup.bash

If you keep torch/transformers in a virtualenv (created with --system-site-packages) instead of the system Python, tell the launch file which interpreter to use, once per shell or per launch:

export MONO_DEPTH_PYTHON=~/venvs/depth/bin/python        # or:  ... viewer.launch.py python:=~/venvs/depth/bin/python

Run with ros2 launch

# live, headless: subscribe to the camera topic, publish /mono_depth/points
ros2 launch mono_depth_viewer viewer.launch.py auto_level:=true hfov:=100
# without a camera, play a bag in another terminal:  ros2 bag play <bag> --topics /camera/image_raw --loop

# debug GUI with a bag file
ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag pointcloud:=true auto_level:=true play:=true

Launch arguments (all optional; ros2 launch mono_depth_viewer viewer.launch.py --show-args lists them): python, debug, bag, play, pointcloud, image_topic, model, input_size, pc_topic, pc_frame, pc_axes, pc_stamp, pc_stride, hfov, near, far, pitch, cam_height, auto_level.

Use

ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag_folder

Pick the topic (default /camera/image_raw), model, input size and colormap in the toolbar. You can play, scrub, save a frame (PNG + raw .npy) or export a side-by-side MP4. The first run downloads model weights from Hugging Face.

Point cloud output

The node has two modes:

  • Live (default, no window): subscribes to a camera topic, runs the depth model and publishes a coloured sensor_msgs/PointCloud2. Works with a real camera or with ros2 bag play.
  • --debug (GUI): opens the viewer to open a bag, play/scrub it and see the depth image. Add --pointcloud to publish clouds from the GUI as well.
# live, headless (e.g. with `ros2 bag play <bag> --topics /camera/image_raw --loop` in another terminal)
ros2 run mono_depth_viewer viewer --image-topic /camera/image_raw --auto-level --hfov 100

# debug GUI with a bag
ros2 run mono_depth_viewer viewer --debug /path/to/bag --pointcloud --auto-level --play --hfov 100

# same through launch
ros2 launch mono_depth_viewer viewer.launch.py image_topic:=/camera/image_raw auto_level:=true hfov:=100
ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag pointcloud:=true

Option Default Meaning
--debug off show the GUI instead of running headless
--image-topic /camera/image_raw live input (Image or CompressedImage)
--model small small, base, large or dpt
--input-size 364 network input short side in pixels; smaller = faster
--pointcloud off (--debug only) also publish; always on in live mode
--pc-topic /mono_depth/points topic name
--pc-axes ros ros: x forward, y left, z up (REP-103). optical: x right, y down, z forward
--pc-frame camera_link (camera_optical_frame for optical) frame_id (image = use each image’s own header frame)
--auto-level off fit the ground plane every frame, level it and put the ground at z = 0
--pitch 0 manual alternative: camera tilt-down angle in degrees
--cam-height 0 lift the cloud by this many metres (use with --pitch)
--pc-stamp image (live) / now (--debug) header stamp: the image’s own (image) or wall clock (now)
--pc-stride 4 use every Nth pixel (bigger = fewer points, faster)
--hfov 90 camera horizontal field of view in degrees (pinhole model)
--near / --far 0.5 / 20 metres assigned to the closest / farthest part of the scene
--play off (--debug) start playback as soon as the model is ready

View it in RViz with Fixed Frame = camera_link (the default --pc-frame) and a PointCloud2 display on the topic. With the default ros axes the ground is horizontal only if the camera is level; for a camera that looks down, add --auto-level (or --pitch <deg>).

The scale is an assumption. The network predicts relative depth, so --near/--far set the metric range; distances are plausible but not measured. Lens distortion is not corrected (pinhole model), so wide-angle or fisheye cameras give curved geometry. Clouds are published at the rate frames are processed (about 1 Hz on CPU); in live mode only the newest camera frame is processed, older ones are dropped.

Performance

File truncated at 100 lines see the full file

No version for distro jazzy showing humble. Known supported distros are highlighted in the buttons above.
Repo symbol

mono_depth_viewer repository

mono_depth_viewer

ROS Distro
humble

Repository Summary

Checkout URI https://github.com/divagarn/mono_depth_ros2.git
VCS Type git
VCS Version main
Last Updated 2026-11-07
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Packages

Name Version
mono_depth_viewer 0.2.0

README

mono_depth_viewer

Qt viewer for monocular depth estimation on image topics recorded in ROS 2 bags (sqlite3 .db3). Runs transformer models (Depth Anything V1, DPT-Hybrid MiDaS) from Hugging Face and shows the camera image next to a colourised depth map.

Install (ROS 2 Humble)

mkdir -p ~/ros2_ws/src && cd ~/ros2_ws/src
git clone https://github.com/divagarn/mono_depth_ros2.git mono_depth_viewer
cd ~/ros2_ws
rosdep install --from-paths src --ignore-src -y
pip install transformers==4.40.2           # plus torch/torchvision; see requirements.txt
colcon build --symlink-install --packages-select mono_depth_viewer
source install/setup.bash

If you keep torch/transformers in a virtualenv (created with --system-site-packages) instead of the system Python, tell the launch file which interpreter to use, once per shell or per launch:

export MONO_DEPTH_PYTHON=~/venvs/depth/bin/python        # or:  ... viewer.launch.py python:=~/venvs/depth/bin/python

Run with ros2 launch

# live, headless: subscribe to the camera topic, publish /mono_depth/points
ros2 launch mono_depth_viewer viewer.launch.py auto_level:=true hfov:=100
# without a camera, play a bag in another terminal:  ros2 bag play <bag> --topics /camera/image_raw --loop

# debug GUI with a bag file
ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag pointcloud:=true auto_level:=true play:=true

Launch arguments (all optional; ros2 launch mono_depth_viewer viewer.launch.py --show-args lists them): python, debug, bag, play, pointcloud, image_topic, model, input_size, pc_topic, pc_frame, pc_axes, pc_stamp, pc_stride, hfov, near, far, pitch, cam_height, auto_level.

Use

ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag_folder

Pick the topic (default /camera/image_raw), model, input size and colormap in the toolbar. You can play, scrub, save a frame (PNG + raw .npy) or export a side-by-side MP4. The first run downloads model weights from Hugging Face.

Point cloud output

The node has two modes:

  • Live (default, no window): subscribes to a camera topic, runs the depth model and publishes a coloured sensor_msgs/PointCloud2. Works with a real camera or with ros2 bag play.
  • --debug (GUI): opens the viewer to open a bag, play/scrub it and see the depth image. Add --pointcloud to publish clouds from the GUI as well.
# live, headless (e.g. with `ros2 bag play <bag> --topics /camera/image_raw --loop` in another terminal)
ros2 run mono_depth_viewer viewer --image-topic /camera/image_raw --auto-level --hfov 100

# debug GUI with a bag
ros2 run mono_depth_viewer viewer --debug /path/to/bag --pointcloud --auto-level --play --hfov 100

# same through launch
ros2 launch mono_depth_viewer viewer.launch.py image_topic:=/camera/image_raw auto_level:=true hfov:=100
ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag pointcloud:=true

Option Default Meaning
--debug off show the GUI instead of running headless
--image-topic /camera/image_raw live input (Image or CompressedImage)
--model small small, base, large or dpt
--input-size 364 network input short side in pixels; smaller = faster
--pointcloud off (--debug only) also publish; always on in live mode
--pc-topic /mono_depth/points topic name
--pc-axes ros ros: x forward, y left, z up (REP-103). optical: x right, y down, z forward
--pc-frame camera_link (camera_optical_frame for optical) frame_id (image = use each image’s own header frame)
--auto-level off fit the ground plane every frame, level it and put the ground at z = 0
--pitch 0 manual alternative: camera tilt-down angle in degrees
--cam-height 0 lift the cloud by this many metres (use with --pitch)
--pc-stamp image (live) / now (--debug) header stamp: the image’s own (image) or wall clock (now)
--pc-stride 4 use every Nth pixel (bigger = fewer points, faster)
--hfov 90 camera horizontal field of view in degrees (pinhole model)
--near / --far 0.5 / 20 metres assigned to the closest / farthest part of the scene
--play off (--debug) start playback as soon as the model is ready

View it in RViz with Fixed Frame = camera_link (the default --pc-frame) and a PointCloud2 display on the topic. With the default ros axes the ground is horizontal only if the camera is level; for a camera that looks down, add --auto-level (or --pitch <deg>).

The scale is an assumption. The network predicts relative depth, so --near/--far set the metric range; distances are plausible but not measured. Lens distortion is not corrected (pinhole model), so wide-angle or fisheye cameras give curved geometry. Clouds are published at the rate frames are processed (about 1 Hz on CPU); in live mode only the newest camera frame is processed, older ones are dropped.

Performance

File truncated at 100 lines see the full file

No version for distro kilted showing humble. Known supported distros are highlighted in the buttons above.
Repo symbol

mono_depth_viewer repository

mono_depth_viewer

ROS Distro
humble

Repository Summary

Checkout URI https://github.com/divagarn/mono_depth_ros2.git
VCS Type git
VCS Version main
Last Updated 2026-11-07
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Packages

Name Version
mono_depth_viewer 0.2.0

README

mono_depth_viewer

Qt viewer for monocular depth estimation on image topics recorded in ROS 2 bags (sqlite3 .db3). Runs transformer models (Depth Anything V1, DPT-Hybrid MiDaS) from Hugging Face and shows the camera image next to a colourised depth map.

Install (ROS 2 Humble)

mkdir -p ~/ros2_ws/src && cd ~/ros2_ws/src
git clone https://github.com/divagarn/mono_depth_ros2.git mono_depth_viewer
cd ~/ros2_ws
rosdep install --from-paths src --ignore-src -y
pip install transformers==4.40.2           # plus torch/torchvision; see requirements.txt
colcon build --symlink-install --packages-select mono_depth_viewer
source install/setup.bash

If you keep torch/transformers in a virtualenv (created with --system-site-packages) instead of the system Python, tell the launch file which interpreter to use, once per shell or per launch:

export MONO_DEPTH_PYTHON=~/venvs/depth/bin/python        # or:  ... viewer.launch.py python:=~/venvs/depth/bin/python

Run with ros2 launch

# live, headless: subscribe to the camera topic, publish /mono_depth/points
ros2 launch mono_depth_viewer viewer.launch.py auto_level:=true hfov:=100
# without a camera, play a bag in another terminal:  ros2 bag play <bag> --topics /camera/image_raw --loop

# debug GUI with a bag file
ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag pointcloud:=true auto_level:=true play:=true

Launch arguments (all optional; ros2 launch mono_depth_viewer viewer.launch.py --show-args lists them): python, debug, bag, play, pointcloud, image_topic, model, input_size, pc_topic, pc_frame, pc_axes, pc_stamp, pc_stride, hfov, near, far, pitch, cam_height, auto_level.

Use

ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag_folder

Pick the topic (default /camera/image_raw), model, input size and colormap in the toolbar. You can play, scrub, save a frame (PNG + raw .npy) or export a side-by-side MP4. The first run downloads model weights from Hugging Face.

Point cloud output

The node has two modes:

  • Live (default, no window): subscribes to a camera topic, runs the depth model and publishes a coloured sensor_msgs/PointCloud2. Works with a real camera or with ros2 bag play.
  • --debug (GUI): opens the viewer to open a bag, play/scrub it and see the depth image. Add --pointcloud to publish clouds from the GUI as well.
# live, headless (e.g. with `ros2 bag play <bag> --topics /camera/image_raw --loop` in another terminal)
ros2 run mono_depth_viewer viewer --image-topic /camera/image_raw --auto-level --hfov 100

# debug GUI with a bag
ros2 run mono_depth_viewer viewer --debug /path/to/bag --pointcloud --auto-level --play --hfov 100

# same through launch
ros2 launch mono_depth_viewer viewer.launch.py image_topic:=/camera/image_raw auto_level:=true hfov:=100
ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag pointcloud:=true

Option Default Meaning
--debug off show the GUI instead of running headless
--image-topic /camera/image_raw live input (Image or CompressedImage)
--model small small, base, large or dpt
--input-size 364 network input short side in pixels; smaller = faster
--pointcloud off (--debug only) also publish; always on in live mode
--pc-topic /mono_depth/points topic name
--pc-axes ros ros: x forward, y left, z up (REP-103). optical: x right, y down, z forward
--pc-frame camera_link (camera_optical_frame for optical) frame_id (image = use each image’s own header frame)
--auto-level off fit the ground plane every frame, level it and put the ground at z = 0
--pitch 0 manual alternative: camera tilt-down angle in degrees
--cam-height 0 lift the cloud by this many metres (use with --pitch)
--pc-stamp image (live) / now (--debug) header stamp: the image’s own (image) or wall clock (now)
--pc-stride 4 use every Nth pixel (bigger = fewer points, faster)
--hfov 90 camera horizontal field of view in degrees (pinhole model)
--near / --far 0.5 / 20 metres assigned to the closest / farthest part of the scene
--play off (--debug) start playback as soon as the model is ready

View it in RViz with Fixed Frame = camera_link (the default --pc-frame) and a PointCloud2 display on the topic. With the default ros axes the ground is horizontal only if the camera is level; for a camera that looks down, add --auto-level (or --pitch <deg>).

The scale is an assumption. The network predicts relative depth, so --near/--far set the metric range; distances are plausible but not measured. Lens distortion is not corrected (pinhole model), so wide-angle or fisheye cameras give curved geometry. Clouds are published at the rate frames are processed (about 1 Hz on CPU); in live mode only the newest camera frame is processed, older ones are dropped.

Performance

File truncated at 100 lines see the full file

No version for distro lyrical showing humble. Known supported distros are highlighted in the buttons above.
Repo symbol

mono_depth_viewer repository

mono_depth_viewer

ROS Distro
humble

Repository Summary

Checkout URI https://github.com/divagarn/mono_depth_ros2.git
VCS Type git
VCS Version main
Last Updated 2026-11-07
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Packages

Name Version
mono_depth_viewer 0.2.0

README

mono_depth_viewer

Qt viewer for monocular depth estimation on image topics recorded in ROS 2 bags (sqlite3 .db3). Runs transformer models (Depth Anything V1, DPT-Hybrid MiDaS) from Hugging Face and shows the camera image next to a colourised depth map.

Install (ROS 2 Humble)

mkdir -p ~/ros2_ws/src && cd ~/ros2_ws/src
git clone https://github.com/divagarn/mono_depth_ros2.git mono_depth_viewer
cd ~/ros2_ws
rosdep install --from-paths src --ignore-src -y
pip install transformers==4.40.2           # plus torch/torchvision; see requirements.txt
colcon build --symlink-install --packages-select mono_depth_viewer
source install/setup.bash

If you keep torch/transformers in a virtualenv (created with --system-site-packages) instead of the system Python, tell the launch file which interpreter to use, once per shell or per launch:

export MONO_DEPTH_PYTHON=~/venvs/depth/bin/python        # or:  ... viewer.launch.py python:=~/venvs/depth/bin/python

Run with ros2 launch

# live, headless: subscribe to the camera topic, publish /mono_depth/points
ros2 launch mono_depth_viewer viewer.launch.py auto_level:=true hfov:=100
# without a camera, play a bag in another terminal:  ros2 bag play <bag> --topics /camera/image_raw --loop

# debug GUI with a bag file
ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag pointcloud:=true auto_level:=true play:=true

Launch arguments (all optional; ros2 launch mono_depth_viewer viewer.launch.py --show-args lists them): python, debug, bag, play, pointcloud, image_topic, model, input_size, pc_topic, pc_frame, pc_axes, pc_stamp, pc_stride, hfov, near, far, pitch, cam_height, auto_level.

Use

ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag_folder

Pick the topic (default /camera/image_raw), model, input size and colormap in the toolbar. You can play, scrub, save a frame (PNG + raw .npy) or export a side-by-side MP4. The first run downloads model weights from Hugging Face.

Point cloud output

The node has two modes:

  • Live (default, no window): subscribes to a camera topic, runs the depth model and publishes a coloured sensor_msgs/PointCloud2. Works with a real camera or with ros2 bag play.
  • --debug (GUI): opens the viewer to open a bag, play/scrub it and see the depth image. Add --pointcloud to publish clouds from the GUI as well.
# live, headless (e.g. with `ros2 bag play <bag> --topics /camera/image_raw --loop` in another terminal)
ros2 run mono_depth_viewer viewer --image-topic /camera/image_raw --auto-level --hfov 100

# debug GUI with a bag
ros2 run mono_depth_viewer viewer --debug /path/to/bag --pointcloud --auto-level --play --hfov 100

# same through launch
ros2 launch mono_depth_viewer viewer.launch.py image_topic:=/camera/image_raw auto_level:=true hfov:=100
ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag pointcloud:=true

Option Default Meaning
--debug off show the GUI instead of running headless
--image-topic /camera/image_raw live input (Image or CompressedImage)
--model small small, base, large or dpt
--input-size 364 network input short side in pixels; smaller = faster
--pointcloud off (--debug only) also publish; always on in live mode
--pc-topic /mono_depth/points topic name
--pc-axes ros ros: x forward, y left, z up (REP-103). optical: x right, y down, z forward
--pc-frame camera_link (camera_optical_frame for optical) frame_id (image = use each image’s own header frame)
--auto-level off fit the ground plane every frame, level it and put the ground at z = 0
--pitch 0 manual alternative: camera tilt-down angle in degrees
--cam-height 0 lift the cloud by this many metres (use with --pitch)
--pc-stamp image (live) / now (--debug) header stamp: the image’s own (image) or wall clock (now)
--pc-stride 4 use every Nth pixel (bigger = fewer points, faster)
--hfov 90 camera horizontal field of view in degrees (pinhole model)
--near / --far 0.5 / 20 metres assigned to the closest / farthest part of the scene
--play off (--debug) start playback as soon as the model is ready

View it in RViz with Fixed Frame = camera_link (the default --pc-frame) and a PointCloud2 display on the topic. With the default ros axes the ground is horizontal only if the camera is level; for a camera that looks down, add --auto-level (or --pitch <deg>).

The scale is an assumption. The network predicts relative depth, so --near/--far set the metric range; distances are plausible but not measured. Lens distortion is not corrected (pinhole model), so wide-angle or fisheye cameras give curved geometry. Clouds are published at the rate frames are processed (about 1 Hz on CPU); in live mode only the newest camera frame is processed, older ones are dropped.

Performance

File truncated at 100 lines see the full file

No version for distro rolling showing humble. Known supported distros are highlighted in the buttons above.
Repo symbol

mono_depth_viewer repository

mono_depth_viewer

ROS Distro
humble

Repository Summary

Checkout URI https://github.com/divagarn/mono_depth_ros2.git
VCS Type git
VCS Version main
Last Updated 2026-11-07
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Packages

Name Version
mono_depth_viewer 0.2.0

README

mono_depth_viewer

Qt viewer for monocular depth estimation on image topics recorded in ROS 2 bags (sqlite3 .db3). Runs transformer models (Depth Anything V1, DPT-Hybrid MiDaS) from Hugging Face and shows the camera image next to a colourised depth map.

Install (ROS 2 Humble)

mkdir -p ~/ros2_ws/src && cd ~/ros2_ws/src
git clone https://github.com/divagarn/mono_depth_ros2.git mono_depth_viewer
cd ~/ros2_ws
rosdep install --from-paths src --ignore-src -y
pip install transformers==4.40.2           # plus torch/torchvision; see requirements.txt
colcon build --symlink-install --packages-select mono_depth_viewer
source install/setup.bash

If you keep torch/transformers in a virtualenv (created with --system-site-packages) instead of the system Python, tell the launch file which interpreter to use, once per shell or per launch:

export MONO_DEPTH_PYTHON=~/venvs/depth/bin/python        # or:  ... viewer.launch.py python:=~/venvs/depth/bin/python

Run with ros2 launch

# live, headless: subscribe to the camera topic, publish /mono_depth/points
ros2 launch mono_depth_viewer viewer.launch.py auto_level:=true hfov:=100
# without a camera, play a bag in another terminal:  ros2 bag play <bag> --topics /camera/image_raw --loop

# debug GUI with a bag file
ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag pointcloud:=true auto_level:=true play:=true

Launch arguments (all optional; ros2 launch mono_depth_viewer viewer.launch.py --show-args lists them): python, debug, bag, play, pointcloud, image_topic, model, input_size, pc_topic, pc_frame, pc_axes, pc_stamp, pc_stride, hfov, near, far, pitch, cam_height, auto_level.

Use

ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag_folder

Pick the topic (default /camera/image_raw), model, input size and colormap in the toolbar. You can play, scrub, save a frame (PNG + raw .npy) or export a side-by-side MP4. The first run downloads model weights from Hugging Face.

Point cloud output

The node has two modes:

  • Live (default, no window): subscribes to a camera topic, runs the depth model and publishes a coloured sensor_msgs/PointCloud2. Works with a real camera or with ros2 bag play.
  • --debug (GUI): opens the viewer to open a bag, play/scrub it and see the depth image. Add --pointcloud to publish clouds from the GUI as well.
# live, headless (e.g. with `ros2 bag play <bag> --topics /camera/image_raw --loop` in another terminal)
ros2 run mono_depth_viewer viewer --image-topic /camera/image_raw --auto-level --hfov 100

# debug GUI with a bag
ros2 run mono_depth_viewer viewer --debug /path/to/bag --pointcloud --auto-level --play --hfov 100

# same through launch
ros2 launch mono_depth_viewer viewer.launch.py image_topic:=/camera/image_raw auto_level:=true hfov:=100
ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag pointcloud:=true

Option Default Meaning
--debug off show the GUI instead of running headless
--image-topic /camera/image_raw live input (Image or CompressedImage)
--model small small, base, large or dpt
--input-size 364 network input short side in pixels; smaller = faster
--pointcloud off (--debug only) also publish; always on in live mode
--pc-topic /mono_depth/points topic name
--pc-axes ros ros: x forward, y left, z up (REP-103). optical: x right, y down, z forward
--pc-frame camera_link (camera_optical_frame for optical) frame_id (image = use each image’s own header frame)
--auto-level off fit the ground plane every frame, level it and put the ground at z = 0
--pitch 0 manual alternative: camera tilt-down angle in degrees
--cam-height 0 lift the cloud by this many metres (use with --pitch)
--pc-stamp image (live) / now (--debug) header stamp: the image’s own (image) or wall clock (now)
--pc-stride 4 use every Nth pixel (bigger = fewer points, faster)
--hfov 90 camera horizontal field of view in degrees (pinhole model)
--near / --far 0.5 / 20 metres assigned to the closest / farthest part of the scene
--play off (--debug) start playback as soon as the model is ready

View it in RViz with Fixed Frame = camera_link (the default --pc-frame) and a PointCloud2 display on the topic. With the default ros axes the ground is horizontal only if the camera is level; for a camera that looks down, add --auto-level (or --pitch <deg>).

The scale is an assumption. The network predicts relative depth, so --near/--far set the metric range; distances are plausible but not measured. Lens distortion is not corrected (pinhole model), so wide-angle or fisheye cameras give curved geometry. Clouds are published at the rate frames are processed (about 1 Hz on CPU); in live mode only the newest camera frame is processed, older ones are dropped.

Performance

File truncated at 100 lines see the full file

No version for distro ardent showing humble. Known supported distros are highlighted in the buttons above.
Repo symbol

mono_depth_viewer repository

mono_depth_viewer

ROS Distro
humble

Repository Summary

Checkout URI https://github.com/divagarn/mono_depth_ros2.git
VCS Type git
VCS Version main
Last Updated 2026-11-07
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Packages

Name Version
mono_depth_viewer 0.2.0

README

mono_depth_viewer

Qt viewer for monocular depth estimation on image topics recorded in ROS 2 bags (sqlite3 .db3). Runs transformer models (Depth Anything V1, DPT-Hybrid MiDaS) from Hugging Face and shows the camera image next to a colourised depth map.

Install (ROS 2 Humble)

mkdir -p ~/ros2_ws/src && cd ~/ros2_ws/src
git clone https://github.com/divagarn/mono_depth_ros2.git mono_depth_viewer
cd ~/ros2_ws
rosdep install --from-paths src --ignore-src -y
pip install transformers==4.40.2           # plus torch/torchvision; see requirements.txt
colcon build --symlink-install --packages-select mono_depth_viewer
source install/setup.bash

If you keep torch/transformers in a virtualenv (created with --system-site-packages) instead of the system Python, tell the launch file which interpreter to use, once per shell or per launch:

export MONO_DEPTH_PYTHON=~/venvs/depth/bin/python        # or:  ... viewer.launch.py python:=~/venvs/depth/bin/python

Run with ros2 launch

# live, headless: subscribe to the camera topic, publish /mono_depth/points
ros2 launch mono_depth_viewer viewer.launch.py auto_level:=true hfov:=100
# without a camera, play a bag in another terminal:  ros2 bag play <bag> --topics /camera/image_raw --loop

# debug GUI with a bag file
ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag pointcloud:=true auto_level:=true play:=true

Launch arguments (all optional; ros2 launch mono_depth_viewer viewer.launch.py --show-args lists them): python, debug, bag, play, pointcloud, image_topic, model, input_size, pc_topic, pc_frame, pc_axes, pc_stamp, pc_stride, hfov, near, far, pitch, cam_height, auto_level.

Use

ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag_folder

Pick the topic (default /camera/image_raw), model, input size and colormap in the toolbar. You can play, scrub, save a frame (PNG + raw .npy) or export a side-by-side MP4. The first run downloads model weights from Hugging Face.

Point cloud output

The node has two modes:

  • Live (default, no window): subscribes to a camera topic, runs the depth model and publishes a coloured sensor_msgs/PointCloud2. Works with a real camera or with ros2 bag play.
  • --debug (GUI): opens the viewer to open a bag, play/scrub it and see the depth image. Add --pointcloud to publish clouds from the GUI as well.
# live, headless (e.g. with `ros2 bag play <bag> --topics /camera/image_raw --loop` in another terminal)
ros2 run mono_depth_viewer viewer --image-topic /camera/image_raw --auto-level --hfov 100

# debug GUI with a bag
ros2 run mono_depth_viewer viewer --debug /path/to/bag --pointcloud --auto-level --play --hfov 100

# same through launch
ros2 launch mono_depth_viewer viewer.launch.py image_topic:=/camera/image_raw auto_level:=true hfov:=100
ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag pointcloud:=true

Option Default Meaning
--debug off show the GUI instead of running headless
--image-topic /camera/image_raw live input (Image or CompressedImage)
--model small small, base, large or dpt
--input-size 364 network input short side in pixels; smaller = faster
--pointcloud off (--debug only) also publish; always on in live mode
--pc-topic /mono_depth/points topic name
--pc-axes ros ros: x forward, y left, z up (REP-103). optical: x right, y down, z forward
--pc-frame camera_link (camera_optical_frame for optical) frame_id (image = use each image’s own header frame)
--auto-level off fit the ground plane every frame, level it and put the ground at z = 0
--pitch 0 manual alternative: camera tilt-down angle in degrees
--cam-height 0 lift the cloud by this many metres (use with --pitch)
--pc-stamp image (live) / now (--debug) header stamp: the image’s own (image) or wall clock (now)
--pc-stride 4 use every Nth pixel (bigger = fewer points, faster)
--hfov 90 camera horizontal field of view in degrees (pinhole model)
--near / --far 0.5 / 20 metres assigned to the closest / farthest part of the scene
--play off (--debug) start playback as soon as the model is ready

View it in RViz with Fixed Frame = camera_link (the default --pc-frame) and a PointCloud2 display on the topic. With the default ros axes the ground is horizontal only if the camera is level; for a camera that looks down, add --auto-level (or --pitch <deg>).

The scale is an assumption. The network predicts relative depth, so --near/--far set the metric range; distances are plausible but not measured. Lens distortion is not corrected (pinhole model), so wide-angle or fisheye cameras give curved geometry. Clouds are published at the rate frames are processed (about 1 Hz on CPU); in live mode only the newest camera frame is processed, older ones are dropped.

Performance

File truncated at 100 lines see the full file

No version for distro bouncy showing humble. Known supported distros are highlighted in the buttons above.
Repo symbol

mono_depth_viewer repository

mono_depth_viewer

ROS Distro
humble

Repository Summary

Checkout URI https://github.com/divagarn/mono_depth_ros2.git
VCS Type git
VCS Version main
Last Updated 2026-11-07
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Packages

Name Version
mono_depth_viewer 0.2.0

README

mono_depth_viewer

Qt viewer for monocular depth estimation on image topics recorded in ROS 2 bags (sqlite3 .db3). Runs transformer models (Depth Anything V1, DPT-Hybrid MiDaS) from Hugging Face and shows the camera image next to a colourised depth map.

Install (ROS 2 Humble)

mkdir -p ~/ros2_ws/src && cd ~/ros2_ws/src
git clone https://github.com/divagarn/mono_depth_ros2.git mono_depth_viewer
cd ~/ros2_ws
rosdep install --from-paths src --ignore-src -y
pip install transformers==4.40.2           # plus torch/torchvision; see requirements.txt
colcon build --symlink-install --packages-select mono_depth_viewer
source install/setup.bash

If you keep torch/transformers in a virtualenv (created with --system-site-packages) instead of the system Python, tell the launch file which interpreter to use, once per shell or per launch:

export MONO_DEPTH_PYTHON=~/venvs/depth/bin/python        # or:  ... viewer.launch.py python:=~/venvs/depth/bin/python

Run with ros2 launch

# live, headless: subscribe to the camera topic, publish /mono_depth/points
ros2 launch mono_depth_viewer viewer.launch.py auto_level:=true hfov:=100
# without a camera, play a bag in another terminal:  ros2 bag play <bag> --topics /camera/image_raw --loop

# debug GUI with a bag file
ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag pointcloud:=true auto_level:=true play:=true

Launch arguments (all optional; ros2 launch mono_depth_viewer viewer.launch.py --show-args lists them): python, debug, bag, play, pointcloud, image_topic, model, input_size, pc_topic, pc_frame, pc_axes, pc_stamp, pc_stride, hfov, near, far, pitch, cam_height, auto_level.

Use

ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag_folder

Pick the topic (default /camera/image_raw), model, input size and colormap in the toolbar. You can play, scrub, save a frame (PNG + raw .npy) or export a side-by-side MP4. The first run downloads model weights from Hugging Face.

Point cloud output

The node has two modes:

  • Live (default, no window): subscribes to a camera topic, runs the depth model and publishes a coloured sensor_msgs/PointCloud2. Works with a real camera or with ros2 bag play.
  • --debug (GUI): opens the viewer to open a bag, play/scrub it and see the depth image. Add --pointcloud to publish clouds from the GUI as well.
# live, headless (e.g. with `ros2 bag play <bag> --topics /camera/image_raw --loop` in another terminal)
ros2 run mono_depth_viewer viewer --image-topic /camera/image_raw --auto-level --hfov 100

# debug GUI with a bag
ros2 run mono_depth_viewer viewer --debug /path/to/bag --pointcloud --auto-level --play --hfov 100

# same through launch
ros2 launch mono_depth_viewer viewer.launch.py image_topic:=/camera/image_raw auto_level:=true hfov:=100
ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag pointcloud:=true

Option Default Meaning
--debug off show the GUI instead of running headless
--image-topic /camera/image_raw live input (Image or CompressedImage)
--model small small, base, large or dpt
--input-size 364 network input short side in pixels; smaller = faster
--pointcloud off (--debug only) also publish; always on in live mode
--pc-topic /mono_depth/points topic name
--pc-axes ros ros: x forward, y left, z up (REP-103). optical: x right, y down, z forward
--pc-frame camera_link (camera_optical_frame for optical) frame_id (image = use each image’s own header frame)
--auto-level off fit the ground plane every frame, level it and put the ground at z = 0
--pitch 0 manual alternative: camera tilt-down angle in degrees
--cam-height 0 lift the cloud by this many metres (use with --pitch)
--pc-stamp image (live) / now (--debug) header stamp: the image’s own (image) or wall clock (now)
--pc-stride 4 use every Nth pixel (bigger = fewer points, faster)
--hfov 90 camera horizontal field of view in degrees (pinhole model)
--near / --far 0.5 / 20 metres assigned to the closest / farthest part of the scene
--play off (--debug) start playback as soon as the model is ready

View it in RViz with Fixed Frame = camera_link (the default --pc-frame) and a PointCloud2 display on the topic. With the default ros axes the ground is horizontal only if the camera is level; for a camera that looks down, add --auto-level (or --pitch <deg>).

The scale is an assumption. The network predicts relative depth, so --near/--far set the metric range; distances are plausible but not measured. Lens distortion is not corrected (pinhole model), so wide-angle or fisheye cameras give curved geometry. Clouds are published at the rate frames are processed (about 1 Hz on CPU); in live mode only the newest camera frame is processed, older ones are dropped.

Performance

File truncated at 100 lines see the full file

No version for distro crystal showing humble. Known supported distros are highlighted in the buttons above.
Repo symbol

mono_depth_viewer repository

mono_depth_viewer

ROS Distro
humble

Repository Summary

Checkout URI https://github.com/divagarn/mono_depth_ros2.git
VCS Type git
VCS Version main
Last Updated 2026-11-07
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Packages

Name Version
mono_depth_viewer 0.2.0

README

mono_depth_viewer

Qt viewer for monocular depth estimation on image topics recorded in ROS 2 bags (sqlite3 .db3). Runs transformer models (Depth Anything V1, DPT-Hybrid MiDaS) from Hugging Face and shows the camera image next to a colourised depth map.

Install (ROS 2 Humble)

mkdir -p ~/ros2_ws/src && cd ~/ros2_ws/src
git clone https://github.com/divagarn/mono_depth_ros2.git mono_depth_viewer
cd ~/ros2_ws
rosdep install --from-paths src --ignore-src -y
pip install transformers==4.40.2           # plus torch/torchvision; see requirements.txt
colcon build --symlink-install --packages-select mono_depth_viewer
source install/setup.bash

If you keep torch/transformers in a virtualenv (created with --system-site-packages) instead of the system Python, tell the launch file which interpreter to use, once per shell or per launch:

export MONO_DEPTH_PYTHON=~/venvs/depth/bin/python        # or:  ... viewer.launch.py python:=~/venvs/depth/bin/python

Run with ros2 launch

# live, headless: subscribe to the camera topic, publish /mono_depth/points
ros2 launch mono_depth_viewer viewer.launch.py auto_level:=true hfov:=100
# without a camera, play a bag in another terminal:  ros2 bag play <bag> --topics /camera/image_raw --loop

# debug GUI with a bag file
ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag pointcloud:=true auto_level:=true play:=true

Launch arguments (all optional; ros2 launch mono_depth_viewer viewer.launch.py --show-args lists them): python, debug, bag, play, pointcloud, image_topic, model, input_size, pc_topic, pc_frame, pc_axes, pc_stamp, pc_stride, hfov, near, far, pitch, cam_height, auto_level.

Use

ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag_folder

Pick the topic (default /camera/image_raw), model, input size and colormap in the toolbar. You can play, scrub, save a frame (PNG + raw .npy) or export a side-by-side MP4. The first run downloads model weights from Hugging Face.

Point cloud output

The node has two modes:

  • Live (default, no window): subscribes to a camera topic, runs the depth model and publishes a coloured sensor_msgs/PointCloud2. Works with a real camera or with ros2 bag play.
  • --debug (GUI): opens the viewer to open a bag, play/scrub it and see the depth image. Add --pointcloud to publish clouds from the GUI as well.
# live, headless (e.g. with `ros2 bag play <bag> --topics /camera/image_raw --loop` in another terminal)
ros2 run mono_depth_viewer viewer --image-topic /camera/image_raw --auto-level --hfov 100

# debug GUI with a bag
ros2 run mono_depth_viewer viewer --debug /path/to/bag --pointcloud --auto-level --play --hfov 100

# same through launch
ros2 launch mono_depth_viewer viewer.launch.py image_topic:=/camera/image_raw auto_level:=true hfov:=100
ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag pointcloud:=true

Option Default Meaning
--debug off show the GUI instead of running headless
--image-topic /camera/image_raw live input (Image or CompressedImage)
--model small small, base, large or dpt
--input-size 364 network input short side in pixels; smaller = faster
--pointcloud off (--debug only) also publish; always on in live mode
--pc-topic /mono_depth/points topic name
--pc-axes ros ros: x forward, y left, z up (REP-103). optical: x right, y down, z forward
--pc-frame camera_link (camera_optical_frame for optical) frame_id (image = use each image’s own header frame)
--auto-level off fit the ground plane every frame, level it and put the ground at z = 0
--pitch 0 manual alternative: camera tilt-down angle in degrees
--cam-height 0 lift the cloud by this many metres (use with --pitch)
--pc-stamp image (live) / now (--debug) header stamp: the image’s own (image) or wall clock (now)
--pc-stride 4 use every Nth pixel (bigger = fewer points, faster)
--hfov 90 camera horizontal field of view in degrees (pinhole model)
--near / --far 0.5 / 20 metres assigned to the closest / farthest part of the scene
--play off (--debug) start playback as soon as the model is ready

View it in RViz with Fixed Frame = camera_link (the default --pc-frame) and a PointCloud2 display on the topic. With the default ros axes the ground is horizontal only if the camera is level; for a camera that looks down, add --auto-level (or --pitch <deg>).

The scale is an assumption. The network predicts relative depth, so --near/--far set the metric range; distances are plausible but not measured. Lens distortion is not corrected (pinhole model), so wide-angle or fisheye cameras give curved geometry. Clouds are published at the rate frames are processed (about 1 Hz on CPU); in live mode only the newest camera frame is processed, older ones are dropped.

Performance

File truncated at 100 lines see the full file

No version for distro eloquent showing humble. Known supported distros are highlighted in the buttons above.
Repo symbol

mono_depth_viewer repository

mono_depth_viewer

ROS Distro
humble

Repository Summary

Checkout URI https://github.com/divagarn/mono_depth_ros2.git
VCS Type git
VCS Version main
Last Updated 2026-11-07
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Packages

Name Version
mono_depth_viewer 0.2.0

README

mono_depth_viewer

Qt viewer for monocular depth estimation on image topics recorded in ROS 2 bags (sqlite3 .db3). Runs transformer models (Depth Anything V1, DPT-Hybrid MiDaS) from Hugging Face and shows the camera image next to a colourised depth map.

Install (ROS 2 Humble)

mkdir -p ~/ros2_ws/src && cd ~/ros2_ws/src
git clone https://github.com/divagarn/mono_depth_ros2.git mono_depth_viewer
cd ~/ros2_ws
rosdep install --from-paths src --ignore-src -y
pip install transformers==4.40.2           # plus torch/torchvision; see requirements.txt
colcon build --symlink-install --packages-select mono_depth_viewer
source install/setup.bash

If you keep torch/transformers in a virtualenv (created with --system-site-packages) instead of the system Python, tell the launch file which interpreter to use, once per shell or per launch:

export MONO_DEPTH_PYTHON=~/venvs/depth/bin/python        # or:  ... viewer.launch.py python:=~/venvs/depth/bin/python

Run with ros2 launch

# live, headless: subscribe to the camera topic, publish /mono_depth/points
ros2 launch mono_depth_viewer viewer.launch.py auto_level:=true hfov:=100
# without a camera, play a bag in another terminal:  ros2 bag play <bag> --topics /camera/image_raw --loop

# debug GUI with a bag file
ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag pointcloud:=true auto_level:=true play:=true

Launch arguments (all optional; ros2 launch mono_depth_viewer viewer.launch.py --show-args lists them): python, debug, bag, play, pointcloud, image_topic, model, input_size, pc_topic, pc_frame, pc_axes, pc_stamp, pc_stride, hfov, near, far, pitch, cam_height, auto_level.

Use

ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag_folder

Pick the topic (default /camera/image_raw), model, input size and colormap in the toolbar. You can play, scrub, save a frame (PNG + raw .npy) or export a side-by-side MP4. The first run downloads model weights from Hugging Face.

Point cloud output

The node has two modes:

  • Live (default, no window): subscribes to a camera topic, runs the depth model and publishes a coloured sensor_msgs/PointCloud2. Works with a real camera or with ros2 bag play.
  • --debug (GUI): opens the viewer to open a bag, play/scrub it and see the depth image. Add --pointcloud to publish clouds from the GUI as well.
# live, headless (e.g. with `ros2 bag play <bag> --topics /camera/image_raw --loop` in another terminal)
ros2 run mono_depth_viewer viewer --image-topic /camera/image_raw --auto-level --hfov 100

# debug GUI with a bag
ros2 run mono_depth_viewer viewer --debug /path/to/bag --pointcloud --auto-level --play --hfov 100

# same through launch
ros2 launch mono_depth_viewer viewer.launch.py image_topic:=/camera/image_raw auto_level:=true hfov:=100
ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag pointcloud:=true

Option Default Meaning
--debug off show the GUI instead of running headless
--image-topic /camera/image_raw live input (Image or CompressedImage)
--model small small, base, large or dpt
--input-size 364 network input short side in pixels; smaller = faster
--pointcloud off (--debug only) also publish; always on in live mode
--pc-topic /mono_depth/points topic name
--pc-axes ros ros: x forward, y left, z up (REP-103). optical: x right, y down, z forward
--pc-frame camera_link (camera_optical_frame for optical) frame_id (image = use each image’s own header frame)
--auto-level off fit the ground plane every frame, level it and put the ground at z = 0
--pitch 0 manual alternative: camera tilt-down angle in degrees
--cam-height 0 lift the cloud by this many metres (use with --pitch)
--pc-stamp image (live) / now (--debug) header stamp: the image’s own (image) or wall clock (now)
--pc-stride 4 use every Nth pixel (bigger = fewer points, faster)
--hfov 90 camera horizontal field of view in degrees (pinhole model)
--near / --far 0.5 / 20 metres assigned to the closest / farthest part of the scene
--play off (--debug) start playback as soon as the model is ready

View it in RViz with Fixed Frame = camera_link (the default --pc-frame) and a PointCloud2 display on the topic. With the default ros axes the ground is horizontal only if the camera is level; for a camera that looks down, add --auto-level (or --pitch <deg>).

The scale is an assumption. The network predicts relative depth, so --near/--far set the metric range; distances are plausible but not measured. Lens distortion is not corrected (pinhole model), so wide-angle or fisheye cameras give curved geometry. Clouds are published at the rate frames are processed (about 1 Hz on CPU); in live mode only the newest camera frame is processed, older ones are dropped.

Performance

File truncated at 100 lines see the full file

No version for distro dashing showing humble. Known supported distros are highlighted in the buttons above.
Repo symbol

mono_depth_viewer repository

mono_depth_viewer

ROS Distro
humble

Repository Summary

Checkout URI https://github.com/divagarn/mono_depth_ros2.git
VCS Type git
VCS Version main
Last Updated 2026-11-07
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Packages

Name Version
mono_depth_viewer 0.2.0

README

mono_depth_viewer

Qt viewer for monocular depth estimation on image topics recorded in ROS 2 bags (sqlite3 .db3). Runs transformer models (Depth Anything V1, DPT-Hybrid MiDaS) from Hugging Face and shows the camera image next to a colourised depth map.

Install (ROS 2 Humble)

mkdir -p ~/ros2_ws/src && cd ~/ros2_ws/src
git clone https://github.com/divagarn/mono_depth_ros2.git mono_depth_viewer
cd ~/ros2_ws
rosdep install --from-paths src --ignore-src -y
pip install transformers==4.40.2           # plus torch/torchvision; see requirements.txt
colcon build --symlink-install --packages-select mono_depth_viewer
source install/setup.bash

If you keep torch/transformers in a virtualenv (created with --system-site-packages) instead of the system Python, tell the launch file which interpreter to use, once per shell or per launch:

export MONO_DEPTH_PYTHON=~/venvs/depth/bin/python        # or:  ... viewer.launch.py python:=~/venvs/depth/bin/python

Run with ros2 launch

# live, headless: subscribe to the camera topic, publish /mono_depth/points
ros2 launch mono_depth_viewer viewer.launch.py auto_level:=true hfov:=100
# without a camera, play a bag in another terminal:  ros2 bag play <bag> --topics /camera/image_raw --loop

# debug GUI with a bag file
ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag pointcloud:=true auto_level:=true play:=true

Launch arguments (all optional; ros2 launch mono_depth_viewer viewer.launch.py --show-args lists them): python, debug, bag, play, pointcloud, image_topic, model, input_size, pc_topic, pc_frame, pc_axes, pc_stamp, pc_stride, hfov, near, far, pitch, cam_height, auto_level.

Use

ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag_folder

Pick the topic (default /camera/image_raw), model, input size and colormap in the toolbar. You can play, scrub, save a frame (PNG + raw .npy) or export a side-by-side MP4. The first run downloads model weights from Hugging Face.

Point cloud output

The node has two modes:

  • Live (default, no window): subscribes to a camera topic, runs the depth model and publishes a coloured sensor_msgs/PointCloud2. Works with a real camera or with ros2 bag play.
  • --debug (GUI): opens the viewer to open a bag, play/scrub it and see the depth image. Add --pointcloud to publish clouds from the GUI as well.
# live, headless (e.g. with `ros2 bag play <bag> --topics /camera/image_raw --loop` in another terminal)
ros2 run mono_depth_viewer viewer --image-topic /camera/image_raw --auto-level --hfov 100

# debug GUI with a bag
ros2 run mono_depth_viewer viewer --debug /path/to/bag --pointcloud --auto-level --play --hfov 100

# same through launch
ros2 launch mono_depth_viewer viewer.launch.py image_topic:=/camera/image_raw auto_level:=true hfov:=100
ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag pointcloud:=true

Option Default Meaning
--debug off show the GUI instead of running headless
--image-topic /camera/image_raw live input (Image or CompressedImage)
--model small small, base, large or dpt
--input-size 364 network input short side in pixels; smaller = faster
--pointcloud off (--debug only) also publish; always on in live mode
--pc-topic /mono_depth/points topic name
--pc-axes ros ros: x forward, y left, z up (REP-103). optical: x right, y down, z forward
--pc-frame camera_link (camera_optical_frame for optical) frame_id (image = use each image’s own header frame)
--auto-level off fit the ground plane every frame, level it and put the ground at z = 0
--pitch 0 manual alternative: camera tilt-down angle in degrees
--cam-height 0 lift the cloud by this many metres (use with --pitch)
--pc-stamp image (live) / now (--debug) header stamp: the image’s own (image) or wall clock (now)
--pc-stride 4 use every Nth pixel (bigger = fewer points, faster)
--hfov 90 camera horizontal field of view in degrees (pinhole model)
--near / --far 0.5 / 20 metres assigned to the closest / farthest part of the scene
--play off (--debug) start playback as soon as the model is ready

View it in RViz with Fixed Frame = camera_link (the default --pc-frame) and a PointCloud2 display on the topic. With the default ros axes the ground is horizontal only if the camera is level; for a camera that looks down, add --auto-level (or --pitch <deg>).

The scale is an assumption. The network predicts relative depth, so --near/--far set the metric range; distances are plausible but not measured. Lens distortion is not corrected (pinhole model), so wide-angle or fisheye cameras give curved geometry. Clouds are published at the rate frames are processed (about 1 Hz on CPU); in live mode only the newest camera frame is processed, older ones are dropped.

Performance

File truncated at 100 lines see the full file

No version for distro galactic showing humble. Known supported distros are highlighted in the buttons above.
Repo symbol

mono_depth_viewer repository

mono_depth_viewer

ROS Distro
humble

Repository Summary

Checkout URI https://github.com/divagarn/mono_depth_ros2.git
VCS Type git
VCS Version main
Last Updated 2026-11-07
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Packages

Name Version
mono_depth_viewer 0.2.0

README

mono_depth_viewer

Qt viewer for monocular depth estimation on image topics recorded in ROS 2 bags (sqlite3 .db3). Runs transformer models (Depth Anything V1, DPT-Hybrid MiDaS) from Hugging Face and shows the camera image next to a colourised depth map.

Install (ROS 2 Humble)

mkdir -p ~/ros2_ws/src && cd ~/ros2_ws/src
git clone https://github.com/divagarn/mono_depth_ros2.git mono_depth_viewer
cd ~/ros2_ws
rosdep install --from-paths src --ignore-src -y
pip install transformers==4.40.2           # plus torch/torchvision; see requirements.txt
colcon build --symlink-install --packages-select mono_depth_viewer
source install/setup.bash

If you keep torch/transformers in a virtualenv (created with --system-site-packages) instead of the system Python, tell the launch file which interpreter to use, once per shell or per launch:

export MONO_DEPTH_PYTHON=~/venvs/depth/bin/python        # or:  ... viewer.launch.py python:=~/venvs/depth/bin/python

Run with ros2 launch

# live, headless: subscribe to the camera topic, publish /mono_depth/points
ros2 launch mono_depth_viewer viewer.launch.py auto_level:=true hfov:=100
# without a camera, play a bag in another terminal:  ros2 bag play <bag> --topics /camera/image_raw --loop

# debug GUI with a bag file
ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag pointcloud:=true auto_level:=true play:=true

Launch arguments (all optional; ros2 launch mono_depth_viewer viewer.launch.py --show-args lists them): python, debug, bag, play, pointcloud, image_topic, model, input_size, pc_topic, pc_frame, pc_axes, pc_stamp, pc_stride, hfov, near, far, pitch, cam_height, auto_level.

Use

ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag_folder

Pick the topic (default /camera/image_raw), model, input size and colormap in the toolbar. You can play, scrub, save a frame (PNG + raw .npy) or export a side-by-side MP4. The first run downloads model weights from Hugging Face.

Point cloud output

The node has two modes:

  • Live (default, no window): subscribes to a camera topic, runs the depth model and publishes a coloured sensor_msgs/PointCloud2. Works with a real camera or with ros2 bag play.
  • --debug (GUI): opens the viewer to open a bag, play/scrub it and see the depth image. Add --pointcloud to publish clouds from the GUI as well.
# live, headless (e.g. with `ros2 bag play <bag> --topics /camera/image_raw --loop` in another terminal)
ros2 run mono_depth_viewer viewer --image-topic /camera/image_raw --auto-level --hfov 100

# debug GUI with a bag
ros2 run mono_depth_viewer viewer --debug /path/to/bag --pointcloud --auto-level --play --hfov 100

# same through launch
ros2 launch mono_depth_viewer viewer.launch.py image_topic:=/camera/image_raw auto_level:=true hfov:=100
ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag pointcloud:=true

Option Default Meaning
--debug off show the GUI instead of running headless
--image-topic /camera/image_raw live input (Image or CompressedImage)
--model small small, base, large or dpt
--input-size 364 network input short side in pixels; smaller = faster
--pointcloud off (--debug only) also publish; always on in live mode
--pc-topic /mono_depth/points topic name
--pc-axes ros ros: x forward, y left, z up (REP-103). optical: x right, y down, z forward
--pc-frame camera_link (camera_optical_frame for optical) frame_id (image = use each image’s own header frame)
--auto-level off fit the ground plane every frame, level it and put the ground at z = 0
--pitch 0 manual alternative: camera tilt-down angle in degrees
--cam-height 0 lift the cloud by this many metres (use with --pitch)
--pc-stamp image (live) / now (--debug) header stamp: the image’s own (image) or wall clock (now)
--pc-stride 4 use every Nth pixel (bigger = fewer points, faster)
--hfov 90 camera horizontal field of view in degrees (pinhole model)
--near / --far 0.5 / 20 metres assigned to the closest / farthest part of the scene
--play off (--debug) start playback as soon as the model is ready

View it in RViz with Fixed Frame = camera_link (the default --pc-frame) and a PointCloud2 display on the topic. With the default ros axes the ground is horizontal only if the camera is level; for a camera that looks down, add --auto-level (or --pitch <deg>).

The scale is an assumption. The network predicts relative depth, so --near/--far set the metric range; distances are plausible but not measured. Lens distortion is not corrected (pinhole model), so wide-angle or fisheye cameras give curved geometry. Clouds are published at the rate frames are processed (about 1 Hz on CPU); in live mode only the newest camera frame is processed, older ones are dropped.

Performance

File truncated at 100 lines see the full file

No version for distro foxy showing humble. Known supported distros are highlighted in the buttons above.
Repo symbol

mono_depth_viewer repository

mono_depth_viewer

ROS Distro
humble

Repository Summary

Checkout URI https://github.com/divagarn/mono_depth_ros2.git
VCS Type git
VCS Version main
Last Updated 2026-11-07
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Packages

Name Version
mono_depth_viewer 0.2.0

README

mono_depth_viewer

Qt viewer for monocular depth estimation on image topics recorded in ROS 2 bags (sqlite3 .db3). Runs transformer models (Depth Anything V1, DPT-Hybrid MiDaS) from Hugging Face and shows the camera image next to a colourised depth map.

Install (ROS 2 Humble)

mkdir -p ~/ros2_ws/src && cd ~/ros2_ws/src
git clone https://github.com/divagarn/mono_depth_ros2.git mono_depth_viewer
cd ~/ros2_ws
rosdep install --from-paths src --ignore-src -y
pip install transformers==4.40.2           # plus torch/torchvision; see requirements.txt
colcon build --symlink-install --packages-select mono_depth_viewer
source install/setup.bash

If you keep torch/transformers in a virtualenv (created with --system-site-packages) instead of the system Python, tell the launch file which interpreter to use, once per shell or per launch:

export MONO_DEPTH_PYTHON=~/venvs/depth/bin/python        # or:  ... viewer.launch.py python:=~/venvs/depth/bin/python

Run with ros2 launch

# live, headless: subscribe to the camera topic, publish /mono_depth/points
ros2 launch mono_depth_viewer viewer.launch.py auto_level:=true hfov:=100
# without a camera, play a bag in another terminal:  ros2 bag play <bag> --topics /camera/image_raw --loop

# debug GUI with a bag file
ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag pointcloud:=true auto_level:=true play:=true

Launch arguments (all optional; ros2 launch mono_depth_viewer viewer.launch.py --show-args lists them): python, debug, bag, play, pointcloud, image_topic, model, input_size, pc_topic, pc_frame, pc_axes, pc_stamp, pc_stride, hfov, near, far, pitch, cam_height, auto_level.

Use

ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag_folder

Pick the topic (default /camera/image_raw), model, input size and colormap in the toolbar. You can play, scrub, save a frame (PNG + raw .npy) or export a side-by-side MP4. The first run downloads model weights from Hugging Face.

Point cloud output

The node has two modes:

  • Live (default, no window): subscribes to a camera topic, runs the depth model and publishes a coloured sensor_msgs/PointCloud2. Works with a real camera or with ros2 bag play.
  • --debug (GUI): opens the viewer to open a bag, play/scrub it and see the depth image. Add --pointcloud to publish clouds from the GUI as well.
# live, headless (e.g. with `ros2 bag play <bag> --topics /camera/image_raw --loop` in another terminal)
ros2 run mono_depth_viewer viewer --image-topic /camera/image_raw --auto-level --hfov 100

# debug GUI with a bag
ros2 run mono_depth_viewer viewer --debug /path/to/bag --pointcloud --auto-level --play --hfov 100

# same through launch
ros2 launch mono_depth_viewer viewer.launch.py image_topic:=/camera/image_raw auto_level:=true hfov:=100
ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag pointcloud:=true

Option Default Meaning
--debug off show the GUI instead of running headless
--image-topic /camera/image_raw live input (Image or CompressedImage)
--model small small, base, large or dpt
--input-size 364 network input short side in pixels; smaller = faster
--pointcloud off (--debug only) also publish; always on in live mode
--pc-topic /mono_depth/points topic name
--pc-axes ros ros: x forward, y left, z up (REP-103). optical: x right, y down, z forward
--pc-frame camera_link (camera_optical_frame for optical) frame_id (image = use each image’s own header frame)
--auto-level off fit the ground plane every frame, level it and put the ground at z = 0
--pitch 0 manual alternative: camera tilt-down angle in degrees
--cam-height 0 lift the cloud by this many metres (use with --pitch)
--pc-stamp image (live) / now (--debug) header stamp: the image’s own (image) or wall clock (now)
--pc-stride 4 use every Nth pixel (bigger = fewer points, faster)
--hfov 90 camera horizontal field of view in degrees (pinhole model)
--near / --far 0.5 / 20 metres assigned to the closest / farthest part of the scene
--play off (--debug) start playback as soon as the model is ready

View it in RViz with Fixed Frame = camera_link (the default --pc-frame) and a PointCloud2 display on the topic. With the default ros axes the ground is horizontal only if the camera is level; for a camera that looks down, add --auto-level (or --pitch <deg>).

The scale is an assumption. The network predicts relative depth, so --near/--far set the metric range; distances are plausible but not measured. Lens distortion is not corrected (pinhole model), so wide-angle or fisheye cameras give curved geometry. Clouds are published at the rate frames are processed (about 1 Hz on CPU); in live mode only the newest camera frame is processed, older ones are dropped.

Performance

File truncated at 100 lines see the full file

No version for distro iron showing humble. Known supported distros are highlighted in the buttons above.
Repo symbol

mono_depth_viewer repository

mono_depth_viewer

ROS Distro
humble

Repository Summary

Checkout URI https://github.com/divagarn/mono_depth_ros2.git
VCS Type git
VCS Version main
Last Updated 2026-11-07
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Packages

Name Version
mono_depth_viewer 0.2.0

README

mono_depth_viewer

Qt viewer for monocular depth estimation on image topics recorded in ROS 2 bags (sqlite3 .db3). Runs transformer models (Depth Anything V1, DPT-Hybrid MiDaS) from Hugging Face and shows the camera image next to a colourised depth map.

Install (ROS 2 Humble)

mkdir -p ~/ros2_ws/src && cd ~/ros2_ws/src
git clone https://github.com/divagarn/mono_depth_ros2.git mono_depth_viewer
cd ~/ros2_ws
rosdep install --from-paths src --ignore-src -y
pip install transformers==4.40.2           # plus torch/torchvision; see requirements.txt
colcon build --symlink-install --packages-select mono_depth_viewer
source install/setup.bash

If you keep torch/transformers in a virtualenv (created with --system-site-packages) instead of the system Python, tell the launch file which interpreter to use, once per shell or per launch:

export MONO_DEPTH_PYTHON=~/venvs/depth/bin/python        # or:  ... viewer.launch.py python:=~/venvs/depth/bin/python

Run with ros2 launch

# live, headless: subscribe to the camera topic, publish /mono_depth/points
ros2 launch mono_depth_viewer viewer.launch.py auto_level:=true hfov:=100
# without a camera, play a bag in another terminal:  ros2 bag play <bag> --topics /camera/image_raw --loop

# debug GUI with a bag file
ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag pointcloud:=true auto_level:=true play:=true

Launch arguments (all optional; ros2 launch mono_depth_viewer viewer.launch.py --show-args lists them): python, debug, bag, play, pointcloud, image_topic, model, input_size, pc_topic, pc_frame, pc_axes, pc_stamp, pc_stride, hfov, near, far, pitch, cam_height, auto_level.

Use

ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag_folder

Pick the topic (default /camera/image_raw), model, input size and colormap in the toolbar. You can play, scrub, save a frame (PNG + raw .npy) or export a side-by-side MP4. The first run downloads model weights from Hugging Face.

Point cloud output

The node has two modes:

  • Live (default, no window): subscribes to a camera topic, runs the depth model and publishes a coloured sensor_msgs/PointCloud2. Works with a real camera or with ros2 bag play.
  • --debug (GUI): opens the viewer to open a bag, play/scrub it and see the depth image. Add --pointcloud to publish clouds from the GUI as well.
# live, headless (e.g. with `ros2 bag play <bag> --topics /camera/image_raw --loop` in another terminal)
ros2 run mono_depth_viewer viewer --image-topic /camera/image_raw --auto-level --hfov 100

# debug GUI with a bag
ros2 run mono_depth_viewer viewer --debug /path/to/bag --pointcloud --auto-level --play --hfov 100

# same through launch
ros2 launch mono_depth_viewer viewer.launch.py image_topic:=/camera/image_raw auto_level:=true hfov:=100
ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag pointcloud:=true

Option Default Meaning
--debug off show the GUI instead of running headless
--image-topic /camera/image_raw live input (Image or CompressedImage)
--model small small, base, large or dpt
--input-size 364 network input short side in pixels; smaller = faster
--pointcloud off (--debug only) also publish; always on in live mode
--pc-topic /mono_depth/points topic name
--pc-axes ros ros: x forward, y left, z up (REP-103). optical: x right, y down, z forward
--pc-frame camera_link (camera_optical_frame for optical) frame_id (image = use each image’s own header frame)
--auto-level off fit the ground plane every frame, level it and put the ground at z = 0
--pitch 0 manual alternative: camera tilt-down angle in degrees
--cam-height 0 lift the cloud by this many metres (use with --pitch)
--pc-stamp image (live) / now (--debug) header stamp: the image’s own (image) or wall clock (now)
--pc-stride 4 use every Nth pixel (bigger = fewer points, faster)
--hfov 90 camera horizontal field of view in degrees (pinhole model)
--near / --far 0.5 / 20 metres assigned to the closest / farthest part of the scene
--play off (--debug) start playback as soon as the model is ready

View it in RViz with Fixed Frame = camera_link (the default --pc-frame) and a PointCloud2 display on the topic. With the default ros axes the ground is horizontal only if the camera is level; for a camera that looks down, add --auto-level (or --pitch <deg>).

The scale is an assumption. The network predicts relative depth, so --near/--far set the metric range; distances are plausible but not measured. Lens distortion is not corrected (pinhole model), so wide-angle or fisheye cameras give curved geometry. Clouds are published at the rate frames are processed (about 1 Hz on CPU); in live mode only the newest camera frame is processed, older ones are dropped.

Performance

File truncated at 100 lines see the full file

No version for distro lunar showing humble. Known supported distros are highlighted in the buttons above.
Repo symbol

mono_depth_viewer repository

mono_depth_viewer

ROS Distro
humble

Repository Summary

Checkout URI https://github.com/divagarn/mono_depth_ros2.git
VCS Type git
VCS Version main
Last Updated 2026-11-07
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Packages

Name Version
mono_depth_viewer 0.2.0

README

mono_depth_viewer

Qt viewer for monocular depth estimation on image topics recorded in ROS 2 bags (sqlite3 .db3). Runs transformer models (Depth Anything V1, DPT-Hybrid MiDaS) from Hugging Face and shows the camera image next to a colourised depth map.

Install (ROS 2 Humble)

mkdir -p ~/ros2_ws/src && cd ~/ros2_ws/src
git clone https://github.com/divagarn/mono_depth_ros2.git mono_depth_viewer
cd ~/ros2_ws
rosdep install --from-paths src --ignore-src -y
pip install transformers==4.40.2           # plus torch/torchvision; see requirements.txt
colcon build --symlink-install --packages-select mono_depth_viewer
source install/setup.bash

If you keep torch/transformers in a virtualenv (created with --system-site-packages) instead of the system Python, tell the launch file which interpreter to use, once per shell or per launch:

export MONO_DEPTH_PYTHON=~/venvs/depth/bin/python        # or:  ... viewer.launch.py python:=~/venvs/depth/bin/python

Run with ros2 launch

# live, headless: subscribe to the camera topic, publish /mono_depth/points
ros2 launch mono_depth_viewer viewer.launch.py auto_level:=true hfov:=100
# without a camera, play a bag in another terminal:  ros2 bag play <bag> --topics /camera/image_raw --loop

# debug GUI with a bag file
ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag pointcloud:=true auto_level:=true play:=true

Launch arguments (all optional; ros2 launch mono_depth_viewer viewer.launch.py --show-args lists them): python, debug, bag, play, pointcloud, image_topic, model, input_size, pc_topic, pc_frame, pc_axes, pc_stamp, pc_stride, hfov, near, far, pitch, cam_height, auto_level.

Use

ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag_folder

Pick the topic (default /camera/image_raw), model, input size and colormap in the toolbar. You can play, scrub, save a frame (PNG + raw .npy) or export a side-by-side MP4. The first run downloads model weights from Hugging Face.

Point cloud output

The node has two modes:

  • Live (default, no window): subscribes to a camera topic, runs the depth model and publishes a coloured sensor_msgs/PointCloud2. Works with a real camera or with ros2 bag play.
  • --debug (GUI): opens the viewer to open a bag, play/scrub it and see the depth image. Add --pointcloud to publish clouds from the GUI as well.
# live, headless (e.g. with `ros2 bag play <bag> --topics /camera/image_raw --loop` in another terminal)
ros2 run mono_depth_viewer viewer --image-topic /camera/image_raw --auto-level --hfov 100

# debug GUI with a bag
ros2 run mono_depth_viewer viewer --debug /path/to/bag --pointcloud --auto-level --play --hfov 100

# same through launch
ros2 launch mono_depth_viewer viewer.launch.py image_topic:=/camera/image_raw auto_level:=true hfov:=100
ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag pointcloud:=true

Option Default Meaning
--debug off show the GUI instead of running headless
--image-topic /camera/image_raw live input (Image or CompressedImage)
--model small small, base, large or dpt
--input-size 364 network input short side in pixels; smaller = faster
--pointcloud off (--debug only) also publish; always on in live mode
--pc-topic /mono_depth/points topic name
--pc-axes ros ros: x forward, y left, z up (REP-103). optical: x right, y down, z forward
--pc-frame camera_link (camera_optical_frame for optical) frame_id (image = use each image’s own header frame)
--auto-level off fit the ground plane every frame, level it and put the ground at z = 0
--pitch 0 manual alternative: camera tilt-down angle in degrees
--cam-height 0 lift the cloud by this many metres (use with --pitch)
--pc-stamp image (live) / now (--debug) header stamp: the image’s own (image) or wall clock (now)
--pc-stride 4 use every Nth pixel (bigger = fewer points, faster)
--hfov 90 camera horizontal field of view in degrees (pinhole model)
--near / --far 0.5 / 20 metres assigned to the closest / farthest part of the scene
--play off (--debug) start playback as soon as the model is ready

View it in RViz with Fixed Frame = camera_link (the default --pc-frame) and a PointCloud2 display on the topic. With the default ros axes the ground is horizontal only if the camera is level; for a camera that looks down, add --auto-level (or --pitch <deg>).

The scale is an assumption. The network predicts relative depth, so --near/--far set the metric range; distances are plausible but not measured. Lens distortion is not corrected (pinhole model), so wide-angle or fisheye cameras give curved geometry. Clouds are published at the rate frames are processed (about 1 Hz on CPU); in live mode only the newest camera frame is processed, older ones are dropped.

Performance

File truncated at 100 lines see the full file

No version for distro jade showing humble. Known supported distros are highlighted in the buttons above.
Repo symbol

mono_depth_viewer repository

mono_depth_viewer

ROS Distro
humble

Repository Summary

Checkout URI https://github.com/divagarn/mono_depth_ros2.git
VCS Type git
VCS Version main
Last Updated 2026-11-07
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Packages

Name Version
mono_depth_viewer 0.2.0

README

mono_depth_viewer

Qt viewer for monocular depth estimation on image topics recorded in ROS 2 bags (sqlite3 .db3). Runs transformer models (Depth Anything V1, DPT-Hybrid MiDaS) from Hugging Face and shows the camera image next to a colourised depth map.

Install (ROS 2 Humble)

mkdir -p ~/ros2_ws/src && cd ~/ros2_ws/src
git clone https://github.com/divagarn/mono_depth_ros2.git mono_depth_viewer
cd ~/ros2_ws
rosdep install --from-paths src --ignore-src -y
pip install transformers==4.40.2           # plus torch/torchvision; see requirements.txt
colcon build --symlink-install --packages-select mono_depth_viewer
source install/setup.bash

If you keep torch/transformers in a virtualenv (created with --system-site-packages) instead of the system Python, tell the launch file which interpreter to use, once per shell or per launch:

export MONO_DEPTH_PYTHON=~/venvs/depth/bin/python        # or:  ... viewer.launch.py python:=~/venvs/depth/bin/python

Run with ros2 launch

# live, headless: subscribe to the camera topic, publish /mono_depth/points
ros2 launch mono_depth_viewer viewer.launch.py auto_level:=true hfov:=100
# without a camera, play a bag in another terminal:  ros2 bag play <bag> --topics /camera/image_raw --loop

# debug GUI with a bag file
ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag pointcloud:=true auto_level:=true play:=true

Launch arguments (all optional; ros2 launch mono_depth_viewer viewer.launch.py --show-args lists them): python, debug, bag, play, pointcloud, image_topic, model, input_size, pc_topic, pc_frame, pc_axes, pc_stamp, pc_stride, hfov, near, far, pitch, cam_height, auto_level.

Use

ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag_folder

Pick the topic (default /camera/image_raw), model, input size and colormap in the toolbar. You can play, scrub, save a frame (PNG + raw .npy) or export a side-by-side MP4. The first run downloads model weights from Hugging Face.

Point cloud output

The node has two modes:

  • Live (default, no window): subscribes to a camera topic, runs the depth model and publishes a coloured sensor_msgs/PointCloud2. Works with a real camera or with ros2 bag play.
  • --debug (GUI): opens the viewer to open a bag, play/scrub it and see the depth image. Add --pointcloud to publish clouds from the GUI as well.
# live, headless (e.g. with `ros2 bag play <bag> --topics /camera/image_raw --loop` in another terminal)
ros2 run mono_depth_viewer viewer --image-topic /camera/image_raw --auto-level --hfov 100

# debug GUI with a bag
ros2 run mono_depth_viewer viewer --debug /path/to/bag --pointcloud --auto-level --play --hfov 100

# same through launch
ros2 launch mono_depth_viewer viewer.launch.py image_topic:=/camera/image_raw auto_level:=true hfov:=100
ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag pointcloud:=true

Option Default Meaning
--debug off show the GUI instead of running headless
--image-topic /camera/image_raw live input (Image or CompressedImage)
--model small small, base, large or dpt
--input-size 364 network input short side in pixels; smaller = faster
--pointcloud off (--debug only) also publish; always on in live mode
--pc-topic /mono_depth/points topic name
--pc-axes ros ros: x forward, y left, z up (REP-103). optical: x right, y down, z forward
--pc-frame camera_link (camera_optical_frame for optical) frame_id (image = use each image’s own header frame)
--auto-level off fit the ground plane every frame, level it and put the ground at z = 0
--pitch 0 manual alternative: camera tilt-down angle in degrees
--cam-height 0 lift the cloud by this many metres (use with --pitch)
--pc-stamp image (live) / now (--debug) header stamp: the image’s own (image) or wall clock (now)
--pc-stride 4 use every Nth pixel (bigger = fewer points, faster)
--hfov 90 camera horizontal field of view in degrees (pinhole model)
--near / --far 0.5 / 20 metres assigned to the closest / farthest part of the scene
--play off (--debug) start playback as soon as the model is ready

View it in RViz with Fixed Frame = camera_link (the default --pc-frame) and a PointCloud2 display on the topic. With the default ros axes the ground is horizontal only if the camera is level; for a camera that looks down, add --auto-level (or --pitch <deg>).

The scale is an assumption. The network predicts relative depth, so --near/--far set the metric range; distances are plausible but not measured. Lens distortion is not corrected (pinhole model), so wide-angle or fisheye cameras give curved geometry. Clouds are published at the rate frames are processed (about 1 Hz on CPU); in live mode only the newest camera frame is processed, older ones are dropped.

Performance

File truncated at 100 lines see the full file

No version for distro indigo showing humble. Known supported distros are highlighted in the buttons above.
Repo symbol

mono_depth_viewer repository

mono_depth_viewer

ROS Distro
humble

Repository Summary

Checkout URI https://github.com/divagarn/mono_depth_ros2.git
VCS Type git
VCS Version main
Last Updated 2026-11-07
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Packages

Name Version
mono_depth_viewer 0.2.0

README

mono_depth_viewer

Qt viewer for monocular depth estimation on image topics recorded in ROS 2 bags (sqlite3 .db3). Runs transformer models (Depth Anything V1, DPT-Hybrid MiDaS) from Hugging Face and shows the camera image next to a colourised depth map.

Install (ROS 2 Humble)

mkdir -p ~/ros2_ws/src && cd ~/ros2_ws/src
git clone https://github.com/divagarn/mono_depth_ros2.git mono_depth_viewer
cd ~/ros2_ws
rosdep install --from-paths src --ignore-src -y
pip install transformers==4.40.2           # plus torch/torchvision; see requirements.txt
colcon build --symlink-install --packages-select mono_depth_viewer
source install/setup.bash

If you keep torch/transformers in a virtualenv (created with --system-site-packages) instead of the system Python, tell the launch file which interpreter to use, once per shell or per launch:

export MONO_DEPTH_PYTHON=~/venvs/depth/bin/python        # or:  ... viewer.launch.py python:=~/venvs/depth/bin/python

Run with ros2 launch

# live, headless: subscribe to the camera topic, publish /mono_depth/points
ros2 launch mono_depth_viewer viewer.launch.py auto_level:=true hfov:=100
# without a camera, play a bag in another terminal:  ros2 bag play <bag> --topics /camera/image_raw --loop

# debug GUI with a bag file
ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag pointcloud:=true auto_level:=true play:=true

Launch arguments (all optional; ros2 launch mono_depth_viewer viewer.launch.py --show-args lists them): python, debug, bag, play, pointcloud, image_topic, model, input_size, pc_topic, pc_frame, pc_axes, pc_stamp, pc_stride, hfov, near, far, pitch, cam_height, auto_level.

Use

ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag_folder

Pick the topic (default /camera/image_raw), model, input size and colormap in the toolbar. You can play, scrub, save a frame (PNG + raw .npy) or export a side-by-side MP4. The first run downloads model weights from Hugging Face.

Point cloud output

The node has two modes:

  • Live (default, no window): subscribes to a camera topic, runs the depth model and publishes a coloured sensor_msgs/PointCloud2. Works with a real camera or with ros2 bag play.
  • --debug (GUI): opens the viewer to open a bag, play/scrub it and see the depth image. Add --pointcloud to publish clouds from the GUI as well.
# live, headless (e.g. with `ros2 bag play <bag> --topics /camera/image_raw --loop` in another terminal)
ros2 run mono_depth_viewer viewer --image-topic /camera/image_raw --auto-level --hfov 100

# debug GUI with a bag
ros2 run mono_depth_viewer viewer --debug /path/to/bag --pointcloud --auto-level --play --hfov 100

# same through launch
ros2 launch mono_depth_viewer viewer.launch.py image_topic:=/camera/image_raw auto_level:=true hfov:=100
ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag pointcloud:=true

Option Default Meaning
--debug off show the GUI instead of running headless
--image-topic /camera/image_raw live input (Image or CompressedImage)
--model small small, base, large or dpt
--input-size 364 network input short side in pixels; smaller = faster
--pointcloud off (--debug only) also publish; always on in live mode
--pc-topic /mono_depth/points topic name
--pc-axes ros ros: x forward, y left, z up (REP-103). optical: x right, y down, z forward
--pc-frame camera_link (camera_optical_frame for optical) frame_id (image = use each image’s own header frame)
--auto-level off fit the ground plane every frame, level it and put the ground at z = 0
--pitch 0 manual alternative: camera tilt-down angle in degrees
--cam-height 0 lift the cloud by this many metres (use with --pitch)
--pc-stamp image (live) / now (--debug) header stamp: the image’s own (image) or wall clock (now)
--pc-stride 4 use every Nth pixel (bigger = fewer points, faster)
--hfov 90 camera horizontal field of view in degrees (pinhole model)
--near / --far 0.5 / 20 metres assigned to the closest / farthest part of the scene
--play off (--debug) start playback as soon as the model is ready

View it in RViz with Fixed Frame = camera_link (the default --pc-frame) and a PointCloud2 display on the topic. With the default ros axes the ground is horizontal only if the camera is level; for a camera that looks down, add --auto-level (or --pitch <deg>).

The scale is an assumption. The network predicts relative depth, so --near/--far set the metric range; distances are plausible but not measured. Lens distortion is not corrected (pinhole model), so wide-angle or fisheye cameras give curved geometry. Clouds are published at the rate frames are processed (about 1 Hz on CPU); in live mode only the newest camera frame is processed, older ones are dropped.

Performance

File truncated at 100 lines see the full file

No version for distro hydro showing humble. Known supported distros are highlighted in the buttons above.
Repo symbol

mono_depth_viewer repository

mono_depth_viewer

ROS Distro
humble

Repository Summary

Checkout URI https://github.com/divagarn/mono_depth_ros2.git
VCS Type git
VCS Version main
Last Updated 2026-11-07
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Packages

Name Version
mono_depth_viewer 0.2.0

README

mono_depth_viewer

Qt viewer for monocular depth estimation on image topics recorded in ROS 2 bags (sqlite3 .db3). Runs transformer models (Depth Anything V1, DPT-Hybrid MiDaS) from Hugging Face and shows the camera image next to a colourised depth map.

Install (ROS 2 Humble)

mkdir -p ~/ros2_ws/src && cd ~/ros2_ws/src
git clone https://github.com/divagarn/mono_depth_ros2.git mono_depth_viewer
cd ~/ros2_ws
rosdep install --from-paths src --ignore-src -y
pip install transformers==4.40.2           # plus torch/torchvision; see requirements.txt
colcon build --symlink-install --packages-select mono_depth_viewer
source install/setup.bash

If you keep torch/transformers in a virtualenv (created with --system-site-packages) instead of the system Python, tell the launch file which interpreter to use, once per shell or per launch:

export MONO_DEPTH_PYTHON=~/venvs/depth/bin/python        # or:  ... viewer.launch.py python:=~/venvs/depth/bin/python

Run with ros2 launch

# live, headless: subscribe to the camera topic, publish /mono_depth/points
ros2 launch mono_depth_viewer viewer.launch.py auto_level:=true hfov:=100
# without a camera, play a bag in another terminal:  ros2 bag play <bag> --topics /camera/image_raw --loop

# debug GUI with a bag file
ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag pointcloud:=true auto_level:=true play:=true

Launch arguments (all optional; ros2 launch mono_depth_viewer viewer.launch.py --show-args lists them): python, debug, bag, play, pointcloud, image_topic, model, input_size, pc_topic, pc_frame, pc_axes, pc_stamp, pc_stride, hfov, near, far, pitch, cam_height, auto_level.

Use

ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag_folder

Pick the topic (default /camera/image_raw), model, input size and colormap in the toolbar. You can play, scrub, save a frame (PNG + raw .npy) or export a side-by-side MP4. The first run downloads model weights from Hugging Face.

Point cloud output

The node has two modes:

  • Live (default, no window): subscribes to a camera topic, runs the depth model and publishes a coloured sensor_msgs/PointCloud2. Works with a real camera or with ros2 bag play.
  • --debug (GUI): opens the viewer to open a bag, play/scrub it and see the depth image. Add --pointcloud to publish clouds from the GUI as well.
# live, headless (e.g. with `ros2 bag play <bag> --topics /camera/image_raw --loop` in another terminal)
ros2 run mono_depth_viewer viewer --image-topic /camera/image_raw --auto-level --hfov 100

# debug GUI with a bag
ros2 run mono_depth_viewer viewer --debug /path/to/bag --pointcloud --auto-level --play --hfov 100

# same through launch
ros2 launch mono_depth_viewer viewer.launch.py image_topic:=/camera/image_raw auto_level:=true hfov:=100
ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag pointcloud:=true

Option Default Meaning
--debug off show the GUI instead of running headless
--image-topic /camera/image_raw live input (Image or CompressedImage)
--model small small, base, large or dpt
--input-size 364 network input short side in pixels; smaller = faster
--pointcloud off (--debug only) also publish; always on in live mode
--pc-topic /mono_depth/points topic name
--pc-axes ros ros: x forward, y left, z up (REP-103). optical: x right, y down, z forward
--pc-frame camera_link (camera_optical_frame for optical) frame_id (image = use each image’s own header frame)
--auto-level off fit the ground plane every frame, level it and put the ground at z = 0
--pitch 0 manual alternative: camera tilt-down angle in degrees
--cam-height 0 lift the cloud by this many metres (use with --pitch)
--pc-stamp image (live) / now (--debug) header stamp: the image’s own (image) or wall clock (now)
--pc-stride 4 use every Nth pixel (bigger = fewer points, faster)
--hfov 90 camera horizontal field of view in degrees (pinhole model)
--near / --far 0.5 / 20 metres assigned to the closest / farthest part of the scene
--play off (--debug) start playback as soon as the model is ready

View it in RViz with Fixed Frame = camera_link (the default --pc-frame) and a PointCloud2 display on the topic. With the default ros axes the ground is horizontal only if the camera is level; for a camera that looks down, add --auto-level (or --pitch <deg>).

The scale is an assumption. The network predicts relative depth, so --near/--far set the metric range; distances are plausible but not measured. Lens distortion is not corrected (pinhole model), so wide-angle or fisheye cameras give curved geometry. Clouds are published at the rate frames are processed (about 1 Hz on CPU); in live mode only the newest camera frame is processed, older ones are dropped.

Performance

File truncated at 100 lines see the full file

No version for distro kinetic showing humble. Known supported distros are highlighted in the buttons above.
Repo symbol

mono_depth_viewer repository

mono_depth_viewer

ROS Distro
humble

Repository Summary

Checkout URI https://github.com/divagarn/mono_depth_ros2.git
VCS Type git
VCS Version main
Last Updated 2026-11-07
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Packages

Name Version
mono_depth_viewer 0.2.0

README

mono_depth_viewer

Qt viewer for monocular depth estimation on image topics recorded in ROS 2 bags (sqlite3 .db3). Runs transformer models (Depth Anything V1, DPT-Hybrid MiDaS) from Hugging Face and shows the camera image next to a colourised depth map.

Install (ROS 2 Humble)

mkdir -p ~/ros2_ws/src && cd ~/ros2_ws/src
git clone https://github.com/divagarn/mono_depth_ros2.git mono_depth_viewer
cd ~/ros2_ws
rosdep install --from-paths src --ignore-src -y
pip install transformers==4.40.2           # plus torch/torchvision; see requirements.txt
colcon build --symlink-install --packages-select mono_depth_viewer
source install/setup.bash

If you keep torch/transformers in a virtualenv (created with --system-site-packages) instead of the system Python, tell the launch file which interpreter to use, once per shell or per launch:

export MONO_DEPTH_PYTHON=~/venvs/depth/bin/python        # or:  ... viewer.launch.py python:=~/venvs/depth/bin/python

Run with ros2 launch

# live, headless: subscribe to the camera topic, publish /mono_depth/points
ros2 launch mono_depth_viewer viewer.launch.py auto_level:=true hfov:=100
# without a camera, play a bag in another terminal:  ros2 bag play <bag> --topics /camera/image_raw --loop

# debug GUI with a bag file
ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag pointcloud:=true auto_level:=true play:=true

Launch arguments (all optional; ros2 launch mono_depth_viewer viewer.launch.py --show-args lists them): python, debug, bag, play, pointcloud, image_topic, model, input_size, pc_topic, pc_frame, pc_axes, pc_stamp, pc_stride, hfov, near, far, pitch, cam_height, auto_level.

Use

ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag_folder

Pick the topic (default /camera/image_raw), model, input size and colormap in the toolbar. You can play, scrub, save a frame (PNG + raw .npy) or export a side-by-side MP4. The first run downloads model weights from Hugging Face.

Point cloud output

The node has two modes:

  • Live (default, no window): subscribes to a camera topic, runs the depth model and publishes a coloured sensor_msgs/PointCloud2. Works with a real camera or with ros2 bag play.
  • --debug (GUI): opens the viewer to open a bag, play/scrub it and see the depth image. Add --pointcloud to publish clouds from the GUI as well.
# live, headless (e.g. with `ros2 bag play <bag> --topics /camera/image_raw --loop` in another terminal)
ros2 run mono_depth_viewer viewer --image-topic /camera/image_raw --auto-level --hfov 100

# debug GUI with a bag
ros2 run mono_depth_viewer viewer --debug /path/to/bag --pointcloud --auto-level --play --hfov 100

# same through launch
ros2 launch mono_depth_viewer viewer.launch.py image_topic:=/camera/image_raw auto_level:=true hfov:=100
ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag pointcloud:=true

Option Default Meaning
--debug off show the GUI instead of running headless
--image-topic /camera/image_raw live input (Image or CompressedImage)
--model small small, base, large or dpt
--input-size 364 network input short side in pixels; smaller = faster
--pointcloud off (--debug only) also publish; always on in live mode
--pc-topic /mono_depth/points topic name
--pc-axes ros ros: x forward, y left, z up (REP-103). optical: x right, y down, z forward
--pc-frame camera_link (camera_optical_frame for optical) frame_id (image = use each image’s own header frame)
--auto-level off fit the ground plane every frame, level it and put the ground at z = 0
--pitch 0 manual alternative: camera tilt-down angle in degrees
--cam-height 0 lift the cloud by this many metres (use with --pitch)
--pc-stamp image (live) / now (--debug) header stamp: the image’s own (image) or wall clock (now)
--pc-stride 4 use every Nth pixel (bigger = fewer points, faster)
--hfov 90 camera horizontal field of view in degrees (pinhole model)
--near / --far 0.5 / 20 metres assigned to the closest / farthest part of the scene
--play off (--debug) start playback as soon as the model is ready

View it in RViz with Fixed Frame = camera_link (the default --pc-frame) and a PointCloud2 display on the topic. With the default ros axes the ground is horizontal only if the camera is level; for a camera that looks down, add --auto-level (or --pitch <deg>).

The scale is an assumption. The network predicts relative depth, so --near/--far set the metric range; distances are plausible but not measured. Lens distortion is not corrected (pinhole model), so wide-angle or fisheye cameras give curved geometry. Clouds are published at the rate frames are processed (about 1 Hz on CPU); in live mode only the newest camera frame is processed, older ones are dropped.

Performance

File truncated at 100 lines see the full file

No version for distro melodic showing humble. Known supported distros are highlighted in the buttons above.
Repo symbol

mono_depth_viewer repository

mono_depth_viewer

ROS Distro
humble

Repository Summary

Checkout URI https://github.com/divagarn/mono_depth_ros2.git
VCS Type git
VCS Version main
Last Updated 2026-11-07
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Packages

Name Version
mono_depth_viewer 0.2.0

README

mono_depth_viewer

Qt viewer for monocular depth estimation on image topics recorded in ROS 2 bags (sqlite3 .db3). Runs transformer models (Depth Anything V1, DPT-Hybrid MiDaS) from Hugging Face and shows the camera image next to a colourised depth map.

Install (ROS 2 Humble)

mkdir -p ~/ros2_ws/src && cd ~/ros2_ws/src
git clone https://github.com/divagarn/mono_depth_ros2.git mono_depth_viewer
cd ~/ros2_ws
rosdep install --from-paths src --ignore-src -y
pip install transformers==4.40.2           # plus torch/torchvision; see requirements.txt
colcon build --symlink-install --packages-select mono_depth_viewer
source install/setup.bash

If you keep torch/transformers in a virtualenv (created with --system-site-packages) instead of the system Python, tell the launch file which interpreter to use, once per shell or per launch:

export MONO_DEPTH_PYTHON=~/venvs/depth/bin/python        # or:  ... viewer.launch.py python:=~/venvs/depth/bin/python

Run with ros2 launch

# live, headless: subscribe to the camera topic, publish /mono_depth/points
ros2 launch mono_depth_viewer viewer.launch.py auto_level:=true hfov:=100
# without a camera, play a bag in another terminal:  ros2 bag play <bag> --topics /camera/image_raw --loop

# debug GUI with a bag file
ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag pointcloud:=true auto_level:=true play:=true

Launch arguments (all optional; ros2 launch mono_depth_viewer viewer.launch.py --show-args lists them): python, debug, bag, play, pointcloud, image_topic, model, input_size, pc_topic, pc_frame, pc_axes, pc_stamp, pc_stride, hfov, near, far, pitch, cam_height, auto_level.

Use

ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag_folder

Pick the topic (default /camera/image_raw), model, input size and colormap in the toolbar. You can play, scrub, save a frame (PNG + raw .npy) or export a side-by-side MP4. The first run downloads model weights from Hugging Face.

Point cloud output

The node has two modes:

  • Live (default, no window): subscribes to a camera topic, runs the depth model and publishes a coloured sensor_msgs/PointCloud2. Works with a real camera or with ros2 bag play.
  • --debug (GUI): opens the viewer to open a bag, play/scrub it and see the depth image. Add --pointcloud to publish clouds from the GUI as well.
# live, headless (e.g. with `ros2 bag play <bag> --topics /camera/image_raw --loop` in another terminal)
ros2 run mono_depth_viewer viewer --image-topic /camera/image_raw --auto-level --hfov 100

# debug GUI with a bag
ros2 run mono_depth_viewer viewer --debug /path/to/bag --pointcloud --auto-level --play --hfov 100

# same through launch
ros2 launch mono_depth_viewer viewer.launch.py image_topic:=/camera/image_raw auto_level:=true hfov:=100
ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag pointcloud:=true

Option Default Meaning
--debug off show the GUI instead of running headless
--image-topic /camera/image_raw live input (Image or CompressedImage)
--model small small, base, large or dpt
--input-size 364 network input short side in pixels; smaller = faster
--pointcloud off (--debug only) also publish; always on in live mode
--pc-topic /mono_depth/points topic name
--pc-axes ros ros: x forward, y left, z up (REP-103). optical: x right, y down, z forward
--pc-frame camera_link (camera_optical_frame for optical) frame_id (image = use each image’s own header frame)
--auto-level off fit the ground plane every frame, level it and put the ground at z = 0
--pitch 0 manual alternative: camera tilt-down angle in degrees
--cam-height 0 lift the cloud by this many metres (use with --pitch)
--pc-stamp image (live) / now (--debug) header stamp: the image’s own (image) or wall clock (now)
--pc-stride 4 use every Nth pixel (bigger = fewer points, faster)
--hfov 90 camera horizontal field of view in degrees (pinhole model)
--near / --far 0.5 / 20 metres assigned to the closest / farthest part of the scene
--play off (--debug) start playback as soon as the model is ready

View it in RViz with Fixed Frame = camera_link (the default --pc-frame) and a PointCloud2 display on the topic. With the default ros axes the ground is horizontal only if the camera is level; for a camera that looks down, add --auto-level (or --pitch <deg>).

The scale is an assumption. The network predicts relative depth, so --near/--far set the metric range; distances are plausible but not measured. Lens distortion is not corrected (pinhole model), so wide-angle or fisheye cameras give curved geometry. Clouds are published at the rate frames are processed (about 1 Hz on CPU); in live mode only the newest camera frame is processed, older ones are dropped.

Performance

File truncated at 100 lines see the full file

No version for distro noetic showing humble. Known supported distros are highlighted in the buttons above.
Repo symbol

mono_depth_viewer repository

mono_depth_viewer

ROS Distro
humble

Repository Summary

Checkout URI https://github.com/divagarn/mono_depth_ros2.git
VCS Type git
VCS Version main
Last Updated 2026-11-07
Dev Status DEVELOPED
Released RELEASED
Contributing Help Wanted (-)
Good First Issues (-)
Pull Requests to Review (-)

Packages

Name Version
mono_depth_viewer 0.2.0

README

mono_depth_viewer

Qt viewer for monocular depth estimation on image topics recorded in ROS 2 bags (sqlite3 .db3). Runs transformer models (Depth Anything V1, DPT-Hybrid MiDaS) from Hugging Face and shows the camera image next to a colourised depth map.

Install (ROS 2 Humble)

mkdir -p ~/ros2_ws/src && cd ~/ros2_ws/src
git clone https://github.com/divagarn/mono_depth_ros2.git mono_depth_viewer
cd ~/ros2_ws
rosdep install --from-paths src --ignore-src -y
pip install transformers==4.40.2           # plus torch/torchvision; see requirements.txt
colcon build --symlink-install --packages-select mono_depth_viewer
source install/setup.bash

If you keep torch/transformers in a virtualenv (created with --system-site-packages) instead of the system Python, tell the launch file which interpreter to use, once per shell or per launch:

export MONO_DEPTH_PYTHON=~/venvs/depth/bin/python        # or:  ... viewer.launch.py python:=~/venvs/depth/bin/python

Run with ros2 launch

# live, headless: subscribe to the camera topic, publish /mono_depth/points
ros2 launch mono_depth_viewer viewer.launch.py auto_level:=true hfov:=100
# without a camera, play a bag in another terminal:  ros2 bag play <bag> --topics /camera/image_raw --loop

# debug GUI with a bag file
ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag pointcloud:=true auto_level:=true play:=true

Launch arguments (all optional; ros2 launch mono_depth_viewer viewer.launch.py --show-args lists them): python, debug, bag, play, pointcloud, image_topic, model, input_size, pc_topic, pc_frame, pc_axes, pc_stamp, pc_stride, hfov, near, far, pitch, cam_height, auto_level.

Use

ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag_folder

Pick the topic (default /camera/image_raw), model, input size and colormap in the toolbar. You can play, scrub, save a frame (PNG + raw .npy) or export a side-by-side MP4. The first run downloads model weights from Hugging Face.

Point cloud output

The node has two modes:

  • Live (default, no window): subscribes to a camera topic, runs the depth model and publishes a coloured sensor_msgs/PointCloud2. Works with a real camera or with ros2 bag play.
  • --debug (GUI): opens the viewer to open a bag, play/scrub it and see the depth image. Add --pointcloud to publish clouds from the GUI as well.
# live, headless (e.g. with `ros2 bag play <bag> --topics /camera/image_raw --loop` in another terminal)
ros2 run mono_depth_viewer viewer --image-topic /camera/image_raw --auto-level --hfov 100

# debug GUI with a bag
ros2 run mono_depth_viewer viewer --debug /path/to/bag --pointcloud --auto-level --play --hfov 100

# same through launch
ros2 launch mono_depth_viewer viewer.launch.py image_topic:=/camera/image_raw auto_level:=true hfov:=100
ros2 launch mono_depth_viewer viewer.launch.py debug:=true bag:=/path/to/bag pointcloud:=true

Option Default Meaning
--debug off show the GUI instead of running headless
--image-topic /camera/image_raw live input (Image or CompressedImage)
--model small small, base, large or dpt
--input-size 364 network input short side in pixels; smaller = faster
--pointcloud off (--debug only) also publish; always on in live mode
--pc-topic /mono_depth/points topic name
--pc-axes ros ros: x forward, y left, z up (REP-103). optical: x right, y down, z forward
--pc-frame camera_link (camera_optical_frame for optical) frame_id (image = use each image’s own header frame)
--auto-level off fit the ground plane every frame, level it and put the ground at z = 0
--pitch 0 manual alternative: camera tilt-down angle in degrees
--cam-height 0 lift the cloud by this many metres (use with --pitch)
--pc-stamp image (live) / now (--debug) header stamp: the image’s own (image) or wall clock (now)
--pc-stride 4 use every Nth pixel (bigger = fewer points, faster)
--hfov 90 camera horizontal field of view in degrees (pinhole model)
--near / --far 0.5 / 20 metres assigned to the closest / farthest part of the scene
--play off (--debug) start playback as soon as the model is ready

View it in RViz with Fixed Frame = camera_link (the default --pc-frame) and a PointCloud2 display on the topic. With the default ros axes the ground is horizontal only if the camera is level; for a camera that looks down, add --auto-level (or --pitch <deg>).

The scale is an assumption. The network predicts relative depth, so --near/--far set the metric range; distances are plausible but not measured. Lens distortion is not corrected (pinhole model), so wide-angle or fisheye cameras give curved geometry. Clouds are published at the rate frames are processed (about 1 Hz on CPU); in live mode only the newest camera frame is processed, older ones are dropped.

Performance

File truncated at 100 lines see the full file