This repo is built around:
build_rgb_map.pytopdown_vis.pyvisualize_rgb_map.pyvisualize_gt.pyget_metrics_map.pyget_ovo_style_eval.py
Supported datasets:
ScanNetReplica
Supported pose backends:
vanillaorbslamcuvslam
map_runtime/: first-party runtime used by the main scriptsconfigs/: base runtime config plus dataset metadatadata/input/: datasets and checkpointsdata/output/: generated outputsthirdParty/:ORB_SLAM3andsegment-anything-2
All repo commands should be run inside the humble container and the ovo conda env.
docker exec -it humble bash
source /opt/miniconda3/etc/profile.d/conda.sh
conda activate ovo
cd /robodata/smodak/repos/ovoIf you need to create the environment from scratch inside the container:
conda create -y -n ovo python=3.10
conda activate ovo
pip install torch==2.11.0+cu128 torchvision==0.26.0+cu128 \
--index-url https://download.pytorch.org/whl/cu128
pip install pyyaml tqdm psutil plyfile scipy==1.15.2 scikit-learn==1.6.1 \
open3d==0.19.0 open_clip_torch==2.32.0 huggingface-hub==0.30.1 \
einops==0.8.1 timm==1.0.15 ftfy regex transformers==4.51.0 \
hydra-core==1.3.2 iopath==0.1.10 omegaconf==2.3.0 \
tokenizers==0.21.1 sentencepiece==0.2.0 blobfile tiktoken==0.9.0
conda install -y -c conda-forge py-opencv=4.11Sanity check:
python - <<'PY'
import torch, torchvision
print(torch.__version__)
print(torchvision.__version__)
print(torch.version.cuda)
print(torch.cuda.is_available())
PYExpected:
2.11.0+cu1280.26.0+cu12812.8True
git submodule update --init --recursive
cd thirdParty/segment-anything-2
pip install --no-build-isolation -e .
cd ../..
./download_ckpts.shdownload_ckpts.sh fetches the SAM1 and SAM2 checkpoints used by the pipeline.
Use the existing patch helper and build the submodule:
conda activate ovo
conda install -y -c conda-forge \
cxx-compiler glew eigen=3.4 pangolin-opengl=0.9.2 \
boost pkg-config \
libegl libegl-devel libgl libgl-devel \
libglvnd libglvnd-devel libglx libglx-devel libopengl libopengl-devel
ln -sfn "$CONDA_PREFIX/lib/libOpenGL.so.0.0.0" \
"$CONDA_PREFIX/lib/libOpenGL.so"
./patch_orbslam_submodule.sh
cd thirdParty/ORB_SLAM3
rm -rf build Thirdparty/DBoW2/build Thirdparty/g2o/build
bash build.sh
cd ../..Import check:
python - <<'PY'
import orbslam3
print(orbslam3.__file__)
PYcuvslam is optional and is used as a pose provider.
Install the wheel for Ubuntu 22.04, Python 3.10, CUDA 12:
conda activate ovo
pip install \
https://github.com/nvidia-isaac/cuVSLAM/releases/download/v15.0.0/cuvslam-15.0.0%2Bcu12-cp310-cp310-manylinux_2_35_x86_64.whlImport check:
python - <<'PY'
import cuvslam
print(cuvslam.__version__)
PYNICE-SLAM Replica root:
<replica_niceslam_root>/
office0/
results/
frame000000.jpg
depth000000.png
...
traj.txt
office1/
office2/
office3/
office4/
room0/
room1/
room2/
office0_mesh.ply
office1_mesh.ply
office2_mesh.ply
office3_mesh.ply
office4_mesh.ply
room0_mesh.ply
room1_mesh.ply
room2_mesh.ply
Full Replica root:
<replica_full_root>/
office_0/
habitat/
mesh_semantic.ply
info_semantic.json
...
mesh.ply
semantic.bin
semantic.json
preseg.bin
preseg.json
glass.sur
textures/
office_1/
...
Runtime layout:
data/input/Replica/
semantic_gt/
office0/
results/
traj.txt
label-filt/
instance-filt/
habitat/
mesh.ply
semantic.bin
semantic.json
preseg.bin
preseg.json
glass.sur
textures/
office0_mesh.ply
...
Setup flow:
- Download the NICE-SLAM Replica bundle. This provides the RGB-D frames, poses, and root-level
<scene>_mesh.plyfiles used by the mapping pipeline.
wget https://cvg-data.inf.ethz.ch/nice-slam/data/Replica.zip
unzip Replica.zip
rm Replica.zip- Download the full Replica dataset. This provides the additional official scene assets that NICE-SLAM does not include, including the Habitat semantic/instance files such as
habitat/mesh_semantic.plyandhabitat/info_semantic.json.
git clone https://github.com/facebookresearch/Replica-Dataset /tmp/Replica-Dataset
cd /tmp/Replica-Dataset
./download.sh <replica_full_root>The full Replica download uses scene names like office_0 and room_0; replica_decode.py maps those automatically to the NICE-SLAM names office0 and room0.
-
Replica semantic GT for the standard scenes lives in
data/input/Replica/semantic_gt. In this repo, those are theovo-semanticslabels. The default Replicasemanticsandinstancescome from the full Replica Habitat assets. -
Stage Replica into the runtime layout used by this repo. This merges the NICE-SLAM trajectories with the full Replica per-scene assets and generates per-frame
label-filt/*.pngandinstance-filt/*.pngfiles from the Habitat semantic mesh.
By default this creates symlinks in data/input/Replica:
python replica_decode.py \
--source_root <replica_niceslam_root> \
--full_replica_root <replica_full_root>If you want actual copies instead of symlinks:
python replica_decode.py \
--source_root <replica_niceslam_root> \
--full_replica_root <replica_full_root> \
--copyDecode .sens into:
data/input/ScanNet/
semantic_gt/
scene0011_00/
color/
depth/
pose/
intrinsic/
scene0011_00_vh_clean_2.labels.ply
Use:
python scannet_decode_sens.py \
--scans_root /path/to/scannet_v2/scans \
--output_root data/input/ScanNet \
--write_semantic_gt \
--link_pcdsScanNet:
python build_rgb_map.py \
--dataset_name ScanNet \
--scene_name scene0011_00 \
--slam_module vanillaReplica:
python build_rgb_map.py \
--dataset_name Replica \
--scene_name office0 \
--slam_module vanillaThe output scene directory contains:
rgb_map.plyclip_feats.npyinstance_labels.npystats.jsontiming.json
python topdown_vis.py \
--dataset_name ScanNet \
--scene_name scene0011_00 \
--load-view top_view_scene11.jsonpython visualize_rgb_map.py data/output/rgb_maps/ScanNet/scene0011_00 --mode rgb
python visualize_rgb_map.py data/output/rgb_maps/ScanNet/scene0011_00 --mode normals
python visualize_rgb_map.py data/output/rgb_maps/ScanNet/scene0011_00 --mode feat
python visualize_rgb_map.py data/output/rgb_maps/ScanNet/scene0011_00 --mode instancespython visualize_gt.py --dataset_name ScanNet scene0011_00 \
--scannet_raw_root /path/to/scannet_v2/scans --mode semantics
python visualize_gt.py --dataset_name Replica office0 \
--replica_root data/input/Replica --mode ovo-semanticsScanNet:
python get_metrics_map.py data/output/rgb_maps/ScanNet/scene0011_00 \
--scannet_raw_root /path/to/scannet_v2/scans --save_jsonReplica:
python get_metrics_map.py data/output/rgb_maps/Replica/office0 \
--replica_root data/input/Replica --save_jsonUse get_ovo_style_eval.py for the ScanNet/Replica dataset-level OVO-style report:
python get_ovo_style_eval.py \
--dataset_name ScanNet \
--scannet_raw_root /path/to/scannet_v2/scans