Multimodal Floorplan Encoding
TwinWorld Workshop
at ECCV 2026
Aligning rasterized floorplans across modalities — architectural drawing, projected SfM point cloud, simulated LiDAR scan, noisy predicted floorplan — in a shared latent space, so that a floorplan of one modality can be matched to, and geometrically aligned with, a floorplan of another.
📄 Paper: arXiv:2609.12723
Authors: Xavier Anadón, Rémi Pautrat, Rui Wang
@article{anadon2026mmfe,
title = {Multimodal Floorplan Encoding: Learning Dense Modality-Invariant Representations},
author = {Anad{\'o}n, Xavier and Pautrat, R{\'e}mi and Wang, Rui},
journal = {arXiv preprint arXiv:2609.12723},
year = {2026},
}conda create -n mmfe python=3.11
conda activate mmfe
pip install torch==2.9.0 torchvision==0.24.0 --index-url https://download.pytorch.org/whl/cu126
pip install -e .
# Only to rebuild the Structured3D density maps (steps 1-2 below): open3d, plyfile
pip install -e ".[s3d-prep]"On Blackwell cards (RTX 50xx, sm_120) install from .../whl/cu128 instead: the
cu126 wheels carry no sm_120 kernels and every CUDA op fails with no kernel image
is available for execution on the device. torch.cuda.get_arch_list() must contain
your card's architecture.
DINOv3. The encoder builds its ViT-B/16 backbone through torch.hub, so it
needs a local clone of facebookresearch/dinov3.
cp .env.example .env # then set DINOV3_LOCAL_PATH=/path/to/dinov3
pip install termcolor ftfy regex submitit # the clone's own requirementsThat second line is not optional: hubconf.py in the clone imports the whole model
zoo, which pulls in termcolor, so without it the local load raises, falls back to a
GitHub download, and that fails the same way — with a traceback that points at the
hub cache rather than at the missing package.
The scripts call load_dotenv(), so a .env in the repository root is picked up
automatically. If the variable is unset, the architecture is downloaded from
GitHub instead, which needs network access.
| Download | mmfe_final.ckpt on Google Drive (374 MiB) |
| sha256 | 3ee77a41c76a89f8369004e34f74d35dbd213b550feee3d7099981738908cd9e |
| Place at | checkpoints/mmfe_final.ckpt (any path works; it is passed on the command line) |
mkdir -p checkpoints
pip install gdown
gdown 1CsFG2ggQde1th6JxKkIyd6GBiKiqkkv5 -O checkpoints/mmfe_final.ckpt
sha256sum checkpoints/mmfe_final.ckpt # must match the hash aboveA quick check on any two images of your own — typically two modalities of the same scene:
python scripts/demo_features.py \
--checkpoint checkpoints/mmfe_final.ckpt \
--image demo_data/colored/27088.png \
--image demo_data/points/27088.png \
--out outputs/demo_features.pngThis writes a figure with one row per image and four columns:
input | MMFE PCA | input rotated 25° | MMFE PCA
The four MMFE panels share one PCA, so colours are comparable down the rows and
across the rotation: the panels look alike in both rows because the two modalities
are embedded in the same space. --rotation changes the angle, and --run_dino
adds a raw DINOv3 column after each MMFE one, which does not match across the rows.
The two scenes in demo_data/ are rendered from
Swiss Dwellings
(CC BY 4.0) in three modalities — colored, binary and points — so any pair of
them is a cross-modality test. No model in this repository was trained on them.
As a library:
from training.lightning_module import ContrastiveLearningModule
model = ContrastiveLearningModule.load_from_checkpoint(
"checkpoints/mmfe_final.ckpt", weights_only=False
).eval()
embeddings = model.get_embeddings(images) # (B, 32, 32, 32) for 256x256 inputStructured3D is not redistributed here. Request access through the official repository (a signed agreement is required) and download the panorama, annotation_3d and bbox archives. Then, in order:
# 1. Orthographic point clouds (writes point_cloud.ply into the panorama tree)
python src/data_preprocess/generate_point_cloud_stru3d.py --data_root /path/to/Structured3D_panorama
# 2. Density maps
python src/data_preprocess/generate_coco_stru3d.py --data_root /path/to/Structured3D_panorama \
--output /path/to/all_density_maps --width 256 --height 256
# 3. Collect annotations and density maps into the scene folders
bash_utils/move_s3d_annotations.sh # annotation_3d.json -> Structured3D_bbox/
bash_utils/move_s3d_density_maps.sh /path/to/all_density_maps # density maps -> scene folders
# 4. Pre-render the modalities
python scripts/utility_scripts/generate_all_images.py \
--s3d-root data/structure3D/Structured3D_bbox/Structured3D \
--s3d-ids-file splits/structured3d/val.txtSteps 1-2 need the s3d-prep extra. Expected result per scene:
data/structure3D/Structured3D_bbox/Structured3D/scene_XXXXX/
├── annotation_3d.json # from the annotation_3d archive
├── bbox_3d.json # from the bbox archive — required by the LiDAR renderer
├── density_map_XXXXX.png
├── ann/{0,25,50,75,100}.png
└── points/{0,25,50,75,100}.png
Step 4 is mandatory, not an optimization. Evaluation always reads pre-rendered PNGs; the on-the-fly
generate=Truepath is not reachable from any config. Without it the loader finds no valid samples and raisesNo valid scene IDs found.
Two failure modes worth knowing about, because neither is loud:
- A scene is silently dropped if its folder, its
ann/or itspoints/is missing — an error is raised only if every scene is dropped. Neither script prints a scene count, so check it on disk:ls -d $S3D/scene_*/ann 2>/dev/null | wc -lmust print 247. - A missing
density_map_XXXXX.pngdoes not raise: the loader substitutes the floorplan, so that scene quietly evaluates floorplan-against-floorplan.
Splits. The scene-id lists used in the paper are in
splits/structured3d/: 2964 train, 247 val and 241
test. Only validation is used here. They were derived from the COCO-style files
published with RoomFormer; the loader
accepts either those JSONs or the .txt lists shipped here.
Rendering is stochastic (the LiDAR sampling, the furniture subset and colours).
--seed (default 0) derives each sample's RNG from the seed and the sample id, so
the same seed reproduces byte-identical images and the work can be sharded with
--start-sample / --end-sample without changing the result.
Both entry points are Hydra scripts: configs/ holds the
defaults and anything can be overridden with key=value. Values shown as ???
are required.
export S3D=data/structure3D/Structured3D_bbox/Structured3D
export VAL=splits/structured3d/val.txt
export MMFE=checkpoints/mmfe_final.ckptFeature quality (Acc / AEPE / PCK@3) — repeat with tf_difficulty=medium|hard:
python scripts/evaluation_scripts/validate.py \
model.checkpoint=$MMFE \
data.structured3d.path=$S3D data.structured3d.val=$VAL \
data.image_size='[256,256]' transforms.tf_difficulty=easy \
tta=8 val.batch_size=8 val.num_workers=8 val.seed=0 viz_debug=false \
logging.output_csv=outputs/repro/feature_quality/mmfe_easy.csvRead the mean column of the *_agg.csv: Acc is val_acc_all, AEPE is
val_AEPE, PCK@3.0 is val_PCK@3.0. (val_acc_self is a different, much
higher number — it scores only the paired cross-modal grid.)
Coarse alignment (nearest neighbour + RANSAC) — repeat with
tf_difficulty=hard:
python scripts/evaluation_scripts/evaluate_alignment.py \
model.checkpoint=$MMFE \
data.structured3d.path=$S3D data.structured3d.val=$VAL \
data.image_size='[256,256]' transforms.tf_difficulty=medium \
eval.threshold='[1,3,5,10,20]' eval.method=ransac eval.use_inliers=true \
eval.tta_n_augs=8 eval.batch_size=8 eval.num_workers=8 eval.seed=0 \
logging.output_csv=outputs/repro/alignment/mmfe_medium.csveval.tta_n_augs=8 is the 45° test-time rotation search; eval.use_inliers=true
picks the rotation hypothesis with the most RANSAC inliers. RMSE is the mean
of the rms_error column, Med RSE its median, Acc@k the mean of
accuracy@k. Corner distances are in pixels of eval.corner_canvas (256), which
sets the units regardless of the resolution the model ran at.
A sample whose affine estimation fails is recorded as an all-NaN row and excluded
from the averages, so every run also writes a *_coverage.json with
total_samples / valid_samples / failed_samples. Check it whenever
failed_samples > 0.
Two rendering parameters are hardcoded rather than exposed through Hydra, and
re-rendering the dataset with different ones will not reproduce the paper's numbers
(scene_to_lidar_image in src/third_parties/structured3D/struct3D_utils.py,
which overrides the generic defaults of sample_points_along_polygon):
| Parameter | Value | Meaning |
|---|---|---|
points_per_unit_length |
0.02 |
sampling density of the simulated sparse 2D-LiDAR along wall contours |
noise_std |
110 |
Gaussian noise on each LiDAR point, in Structured3D units |
Scenes render with figsize=(10, 10), dpi=100 — 1000 px on the longer side,
padded to square — and are resized to data.image_size by the loader.
configs/ Hydra configs, one per entry point
scripts/
demo_features.py Encode two images, no dataset needed
evaluation_scripts/ validate.py, evaluate_alignment.py
utility_scripts/ Structured3D modality pre-rendering
src/
dataloading/ Structured3D dataset + UnifiedDataset wrapper
data_preprocess/ Structured3D point clouds and density maps (from RoomFormer)
training/ Lightning module, model and loss, used to load the checkpoint
inference/ Test-time augmentation
mmfe_utils/ Affine estimation, tensors, visualization, reporting
third_parties/ Vendored upstream code (see THIRD_PARTY_NOTICES.md)
bash_utils/ Small dataset-shuffling helpers
splits/ Structured3D scene-id lists used in the paper
MIT. All vendored third-party code is MIT as well; see THIRD_PARTY_NOTICES.md. DINOv3 weights are not redistributed. The only dataset content shipped here is demo_data/, rendered from Swiss Dwellings under CC BY 4.0; every other dataset must be obtained from its own source under its own terms.
