ReplicaOcc / README.md
moreba's picture
Duplicate from the-masses/ReplicaOcc
9a776fd
|
Raw
History Blame Contribute Delete
6.95 kB
---
license: apache-2.0
pretty_name: ReplicaOcc
size_categories:
- 10K<n<100K
tags:
- 3d
- robotics
- slam
- rgb-d
- occupancy
- embodied-ai
- replica
---
# Replica_OCC Benchmark
Replica_OCC is a Replica-based occupancy benchmark constructed in the data organization style of [EmbodiedOcc-ScanNet](https://huggingface.co/datasets/YkiWu/EmbodiedOcc-ScanNet) and [OccScanNet](https://huggingface.co/datasets/hongxiaoy/OccScanNet). It provides RGB-D sequences and scene-level occupancy ground truth for evaluating embodied occupancy prediction systems.
Ground-truth occupancy and poses are intended for evaluation-time alignment and metric computation. They are not required for training FreeOcc and are not used for map construction.
## Citation
If you use Replica_OCC with [FreeOcc](https://the-masses.github.io/freeocc-web/), please cite:
```bibtex
@article{jiang2026freeocc,
title={FreeOcc: Training-Free Embodied Open-Vocabulary Occupancy Prediction},
author={Jiang, Zeyu and Zhou, Changqing and Zuo, Xingxing and Chen, Changhao},
journal={arXiv preprint arXiv:2604.28115},
year={2026}
}
```
## Released Files
The released dataset package contains:
```text
Replica_OCC/
├── README.md
├── replica_name.txt
├── prepare_preprocessed.py
├── prepare_scene_occ.py
├── vis_preprocessed.py
├── vis_scene_occ.py
└── Replica_OCC/
├── preprocessed/
├── global_occ_package/
└── sequences/
```
Only the four preparation/visualization scripts above are part of the released benchmark utilities.
## Dataset Layout
```text
Replica_OCC/
├── preprocessed/
│ ├── office0.npy
│ ├── office1.npy
│ ├── office2.npy
│ ├── office3.npy
│ ├── office4.npy
│ ├── room0.npy
│ ├── room1.npy
│ └── room2.npy
├── global_occ_package/
│ ├── office0.pkl
│ ├── office1.pkl
│ ├── office2.pkl
│ ├── office3.pkl
│ ├── office4.pkl
│ ├── room0.pkl
│ ├── room1.pkl
│ └── room2.pkl
└── sequences/
├── cam_params.json
├── office0/
│ ├── color/
│ │ ├── 0.jpg
│ │ └── ...
│ ├── depth/
│ │ ├── 0.png
│ │ └── ...
│ ├── pose/
│ │ ├── 0.txt
│ │ └── ...
│ └── intrinsic/
│ ├── intrinsic_color.txt
│ ├── intrinsic_depth.txt
│ ├── extrinsic_color.txt
│ └── extrinsic_depth.txt
├── office1/
├── office2/
├── office3/
├── office4/
├── room0/
├── room1/
└── room2/
```
For FreeOcc evaluation, use:
```bash
DATA_ROOT=/path/to/Replica_OCC/sequences
SCENE_OCC_ROOT=/path/to/Replica_OCC
```
## Coordinate System
The occupancy ground truth is built in the original Replica world coordinate system.
`prepare_preprocessed.py` back-projects depth pixels using Replica camera poses and intrinsics. The resulting sparse semantic voxel points are stored in Replica world coordinates. `prepare_scene_occ.py` then builds a dense occupancy grid from those points and saves voxel center coordinates in the same Replica world coordinate system.
## Preparation Pipeline
The benchmark is created in two main stages, followed by optional visualization checks.
### 1. Build Sparse Semantic Voxels
`prepare_preprocessed.py` reads raw Replica RGB-D/semantic data and camera poses. For each scene, it back-projects depth pixels into 3D world points, assigns semantic labels from the semantic-id images, and voxelizes them by majority vote.
Input expected by the script:
```text
Replica_SLAM/
├── cam_params.json
├── office0/
│ ├── depths/depth000000.png
│ ├── semantic_ids/semantic_id000000.png
│ └── traj.txt
└── ...
```
Example command:
```bash
python prepare_preprocessed.py \
--replica_root ./Replica_SLAM \
--out_root ./Replica_OCC \
--stride 4 \
--depth_scale -1 \
--max_depth 10.0 \
--max_frames -1
```
Output:
```text
Replica_OCC/preprocessed/<scene>.npy
```
Each `.npy` stores an array of shape `(N, 7)`:
```text
x, y, z, r, g, b, label
```
The RGB columns are placeholders; the semantic label is stored in the last column.
### 2. Inspect Sparse Voxels
`vis_preprocessed.py` visualizes the sparse semantic voxels produced by the previous step.
```bash
python vis_preprocessed.py \
--npy ./Replica_OCC/preprocessed/office0.npy
```
This is mainly a sanity check for depth back-projection and semantic labels.
### 3. Build Scene-Level Occupancy Packages
`prepare_scene_occ.py` converts `preprocessed/<scene>.npy` into a dense scene-level occupancy package. It builds a regular voxel grid, assigns labels by nearest-neighbor lookup, and computes an observed-space mask by projecting voxels into Replica depth frames.
Example command:
```bash
python prepare_scene_occ.py \
--replica_root ./Replica_SLAM \
--preprocessed_dir ./Replica_OCC/preprocessed \
--out_dir ./Replica_OCC/global_occ_package \
--obs_stride_frame 1 \
--obs_stride_pix 1 \
--mask_dilate 0 \
--obs_max_frames -1 \
--max_depth 10.0
```
Output:
```text
Replica_OCC/global_occ_package/<scene>.pkl
```
Each `.pkl` contains:
```text
scene_name scene id
scene_dim dense occupancy grid dimensions
global_pts dense voxel centers in Replica world coordinates
global_labels voxel labels
global_mask observed-space mask
valid_img_count number of depth images used for mask construction
valid_img_paths image paths used by the mask builder
```
Label convention:
```text
0 known free space
>0 occupied semantic label
255 unknown / unobserved
```
### 4. Inspect Final Occupancy Packages
`vis_scene_occ.py` visualizes the final scene-level occupancy package.
```bash
python vis_scene_occ.py \
--pkl ./Replica_OCC/global_occ_package/office0.pkl \
--downsample 1
```
Visualization color meaning:
```text
mask = 0 unknown region
mask = 1, label = 0 known free space
mask = 1, label > 0 occupied semantic voxels
```
## Labels
`replica_name.txt` stores the semantic class names used by Replica_OCC. Evaluation and visualization scripts can use this file to map semantic label ids to readable names.
## Scenes
Replica_OCC contains the following eight Replica scenes:
```text
office0
office1
office2
office3
office4
room0
room1
room2
```
## Notes
- `preprocessed/*.npy` is an intermediate representation used to reproduce `global_occ_package/*.pkl`.
- `global_occ_package/*.pkl` is the occupancy ground truth used by evaluation.
- `sequences/*` is the RGB-D input used by SLAM and Gaussian mapping.
- The dataset follows a ScanNet-like RGB-D folder layout so it can be used by FreeOcc's shared dataloader.