Multi-view room layout estimation
This repository contains three datasets, based on ScanNet++, 2D-3D-Semantics and Aria Synthetic Environments, for benchmarking multi-view room layout estimation.
Each dataset consists of a set of image tuples and corresponding ground truth room layouts. We supply scripts to evaluate predicted layouts against the ground truth.
Given images with known camera poses captured inside a room the goal is to estimate the room layout.
The datasets were created during the course of our work on the room layout estimation methods PixCuboid and PolyLayout.
PixCuboid introduced the training, validation and test sets with cuboid rooms from ScanNet++ and the 2D-3D-Semantics test set (also with only cuboids).
The follow-up paper PolyLayout added multi-room validation and test sets created from Aria Synthetic Environments plus a set of new, manually annotated multi-room scenes for ScanNet++. These contain a mix of cuboid and non-cuboid room layouts.
Installation
Setup a virtual environment with the required Python packages:
virtualenv venv
source venv/bin/activate
pip install -r requirements.txt
Dataset
Images and camera poses
Download images and camera poses from the ScanNet++, 2D-3D-Semantics and Aria Synthetic Environments web sites.
Tip: For Aria Synthetic Environments download the 200 scenes in our validation and test sets by passing --scene-ids "`paste -d, -s dataset/ase/scenes_val.txt`,`paste -d, -s dataset/ase/scenes_test.txt`" to their download script.
Perspective images (2D-3D-Semantics)
To be able to compare panorama and perspective based methods we supply a script to split the panorama images of 2D-3D-Semantics into four perspective views:
for area in area_1 area_2 area_3 area_4 area_5a area_5b area_6
do
python -m mvrl.pano_to_persp_2d3ds --root_dir ROOT_DIR --area $area
done
Image undistortion (Aria Synthetic Environments)
Undistort the fisheye images by running
python -m mvrl.undistort_images_ase --root_dir ROOT_DIR
Scenes
ScanNet++
The subset of cuboid-shaped scenes in ScanNet++ v2 have been split into training (391 scenes), validation (10 scenes) and test (18 scenes) sets according to the files scenes_train.txt, scenes_val.txt and scenes_test.txt.
An additional set of 80 scenes including non-cuboid rooms and multi-room scenes are available in scenes_multi_room.txt.
2D-3D-Semantics
No data split has been performed for the cuboid-shaped scenes (also called "spaces") of 2D-3D-Semantics. The 160 scenes are listed in scenes_test.txt.
Aria Synthetic Environments
100 scenes were randomly selected to create validation and test sets, see scenes_val.txt and scenes_test.txt.
Image tuples
ScanNet++
Each tuple consists of randomly sampled DSLR images. For the training scenes 250 tuples were generated whereas the validation and test scenes each have 20 image tuples - all containing 10 images. The tuples can be found in the files images_train.json, images_val.json and images_test.json.
For the "multi_room" split 3 image tuples, with 20 DSLR images per room, were generated for every scene. These are given in images_multi_room.json.
2D-3D-Semantics
For each space there is one tuple with 2 panoramic and 8 corresponding perspective images, see images_test.json.
Aria Synthetic Environments
For each scene 5 image tuples were generated, with 20 images per room (images_val.json, images_test.json).
Ground truth layouts
Ground truth room layouts for all scenes are available in:
Layouts are represented as cuboids or triangle meshes.
Cuboids are parameterized by a rotation matrix $R$ and translation vector $t$ such that a point $x$ in scene coordinates is transformed to the cuboid's local frame via $Rx + t$. The size of the cuboid in the local frame is given by the size vector $s = [s_x ~ s_y ~ s_z]$.
Triangle meshes are given as lists of vertices and faces.
Evaluation
To evaluate your room layout estimation method run it on each image tuple and output a JSON file containing a list with one entry per tuple. An entry can either be a single layout prediction or a list of predictions. This is to support both multi-view methods (that make a single prediction per image tuple) and single-view methods (predicting one room layout per image in the tuple).
A layout prediction can be either:
- A cuboid, using the same format as in the ground truth cuboid files (keys: "R", "t", "s").
- A triangle mesh (keys: "faces", "verts").
- The path to a triangle mesh file that can be read with MeshLib.
If your method generates predictions using some other representation, for example a floor-level polygon with height, we suggest that you convert it into a mesh.
Tip: The script generate_predictions.py can be used to generate example room layout predictions for both ScanNet++ and 2D-3D-Semantics.
We offer two different scripts to run the evaluation, with different metrics as outlined below.
3D metrics
To compute the 3D Intersection-over-Union (IoU) and Chamfer distance between the predictions and the ground truth room layouts run
python -m mvrl.evaluate --pred PRED --dataset {scannetpp,2d3ds,ase} --split {train,val,test,multi_room}
The script also calculates the "wall recall" (i.e. how many of the walls that were successfully captured by the predictions), and the rotation error if the predictions are cuboids.
Pixel-wise metrics
To render the predicted and ground truth room layouts in each view and compute per-pixel depth and normal angle errors use
python -m mvrl.evaluate_pixel --root_dir ROOT_DIR --pred PRED --dataset {scannetpp,2d3ds,ase} --split {train,val,test,multi_room} [--num_images NUM_IMAGES]
If your predictions are based only on a subset of the images in each tuple (e.g. you used the first 5 images out of the 10 for ScanNet++) specify this with the --num_images argument.
Note: The script assumes that the ScanNet++ DSLR images have been undistorted, which can be done by the ScanNet++ Toolbox.
Predicted camera poses
If your room layout estimation method also predicts the camera poses (i.e. does not use the ground truth poses) then the following script can be used to align the layout predictions to the ground truth coordinate system before running the evaluation:
python -m mvrl.align_pred_to_gt --root_dir ROOT_DIR --input_pred INPUT_PRED --output_pred OUTPUT_PRED --dataset {scannetpp,ase,2d3ds} --split SPLIT [--max_error MAX_ERROR]
The predicted camera poses should be included in the input layout prediction file as a list where each item has the keys "R" and "t" (world-to-camera transformation).
Creating the datasets
Below we document the steps taken to create the training, validation and test splits of ScanNet++ and the 2D-3D-Semantics dataset. To run this code some additional dependencies are needed:
pip install -r requirements_extra.txt
Note: The ScanNet++ "multi_room" split was constructed in a different way, using an internally developed room layout annotation tool.
ScanNet++
Details
Define paths
SCANNETPP_ROOT_DIR=<PATH TO SCANNET++ ROOT DIR>
SCANNETPP_DATASET_DIR=dataset/scannetpp
SCANNETPP_CUBOID_DIR=cuboids/scannetpp
Cuboid fitting
For each scene a cuboid was fitted to the vertices of the semantic mesh classified as either "floor", "wall" or "ceiling".
for split in train val
do
python -m mvrl.fit_cuboids_scannetpp --root_dir $SCANNETPP_ROOT_DIR --split_path $SCANNETPP_ROOT_DIR/splits/nvs_sem_$split.txt --output_dir $SCANNETPP_CUBOID_DIR --output_split_path $SCANNETPP_DATASET_DIR/scenes_$split.txt
done
The script also outputs an initial list of scenes for which the cuboid fits well with the mesh, and animated renderings of the mesh vertices and the cuboid.
Manual inspection
The GIF animations of all scenes in the preliminary lists were inspected manually. If the scene was determined not to be cuboid-shaped, or if the cuboid fitting had failed, it was removed from the list.

✅ A cuboid-shaped scene.

❌ A scene that is not cuboid-shaped.
This process resulted in a set of 391 training scenes (out of 856 in the existing ScanNet++ v2 training set) and 28 validation scenes (out of 50 in the existing validation set).
Test split
A test split was created by taking two thirds of the scenes from the validation set.
shuf $SCANNETPP_DATASET_DIR/scenes_val.txt | split -l $(( $(wc -l <$SCANNETPP_DATASET_DIR/scenes_val.txt) * 2 / 3))
mv xaa $SCANNETPP_DATASET_DIR/scenes_test.txt
mv xab $SCANNETPP_DATASET_DIR/scenes_val.txt
Ground truth cuboids
Ground truth cuboid files for the training, validation and test splits were generated as follows:
for split in train val test
do
python -m mvrl.compile_gt_cuboids --cuboid_dir $SCANNETPP_CUBOID_DIR --split_path $SCANNETPP_DATASET_DIR/scenes_$split.txt --output_path $SCANNETPP_DATASET_DIR/layouts_$split.json
done
Image sampling
Tuples of 10 DSLR images were sampled randomly for each scene:
NUM_IMAGES=10
python -m mvrl.sample_images_scannetpp --root_dir $SCANNETPP_ROOT_DIR --split_path $SCANNETPP_DATASET_DIR/scenes_train.txt --num_images $NUM_IMAGES --num_tuples 250 --output_path $SCANNETPP_DATASET_DIR/images_train.json
python -m mvrl.sample_images_scannetpp --root_dir $SCANNETPP_ROOT_DIR --split_path $SCANNETPP_DATASET_DIR/scenes_val.txt --num_images $NUM_IMAGES --num_tuples 20 --output_path $SCANNETPP_DATASET_DIR/images_val.json
python -m mvrl.sample_images_scannetpp --root_dir $SCANNETPP_ROOT_DIR --split_path $SCANNETPP_DATASET_DIR/scenes_test.txt --num_images $NUM_IMAGES --num_tuples 20 --output_path $SCANNETPP_DATASET_DIR/images_test.json
2D-3D-Semantics
Details