PyTorch implementation of the paper: Dual Focus-Attention Transformer for Robust Point Cloud Registration.
Kexue Fu, Mingzhi Yuan, Changwei Wang, Weiguang Pang, Jing Chi, Manning Wang, Longxiang Gao
Recently, coarse-to-fine methods for point cloud registration have achieved great success, but few works deeply explore the impact of feature interaction at both coarse and fine scales. By visualizing attention scores and correspondences, we find that existing methods fail to achieve effective feature aggregation at the two scales during the feature interaction. To tackle this issue, we propose a Dual FocusAttention Transformer framework, which only focuses on points relevant to the current point for feature interaction, avoiding interactions with irrelevant points. For the coarse scale, we design a superpoint focus-attention transformer guided by sparse keypoints, which are selected from the neighborhood of superpoints. For the fine scale, we only perform feature interaction between the point sets that belong to the same superpoint. Experiments show that our method achieve the state-of-the-art performance on three standard benchmarks.
2025.04: Code and pretrained model on 3DMatch/3DLoMatch release.
Please use the following command for installation.
# It is recommended to create a new environment
conda create -n dfat python==3.8
conda activate dfat
# [Optional] If you are using CUDA 11.8 or newer, please install `torch==2.4.0+cu118`
conda install pytorch==2.4.0 torchvision==0.19.0 torchaudio==2.4.0 pytorch-cuda=11.8 -c pytorch -c nvidia
# Install packages and other dependencies
pip install -r requirements.txt
python setup.py build develop
# PointNet++
pip install "git+https://gitee.com/Fukexue/Pointnet2_PyTorch.git#egg=pointnet2_ops&subdirectory=pointnet2_ops_lib"
# GPU kNN
pip install --upgrade https://github.com/unlimblue/KNN_CUDA/releases/download/0.2/KNN_CUDA-0.2-py3-none-any.whlCode has been tested with Ubuntu 22.04 Torch 2.4.0.
We provide 3DMatch pre-trained weights in the release v1.0 page. Please download the latest weights and put them in output directory.
We also provide KITTI pre-trained weights in the release 2.0 page. Please download the latest weights and put them in output directory.
The dataset can be downloaded from PREDATOR. The data should be organized as follows:
--data--3DMatch--metadata
|--data--train--7-scenes-chess--cloud_bin_0.pth
| | |--...
| |--...
|--test--7-scenes-redkitchen--cloud_bin_0.pth
| |--...
|--...
You can also download this dataset from the link we shared.
The code for 3DMatch is in experiments/3DMatch. Use the following command for training.
python trainval.pyUse the following command for testing.
# 3DMatch
python test.py --cfg config.yaml --snapshot=download_weight_path/your_weight_path --benchmark=3DMatch --note_name release
python eval.py --cfg config.yaml --benchmark=3DMatch --method=lgr --note_name you_note_text
# 3DLoMatch
python test.py --cfg config.yaml --snapshot=download_weight_path/your_weight_path --benchmark=3DLoMatch --note_name release
python eval.py --cfg config.yaml --benchmark=3DLoMatch --method=lgr --note_name you_note_textWe also provide pretrained weights in output, use the following command to test the pretrained weights.
# 3DMatch
python test.py --cfg config.yaml --snapshot=download_weight_path --benchmark=3DMatch --note_name release
python eval.py --cfg config.yaml --benchmark=3DMatch --method=lgr --note_name release
# 3DLoMatch
python test.py --cfg config.yaml --snapshot=download_weight_path --benchmark=3DLoMatch --note_name release
python eval.py --cfg config.yaml --benchmark=3DLoMatch --method=lgr --note_name releaseFor DFAT+PEAL, you can use the output/3DMatch_release/geo_prior(First, run DFAT.) folder as the input for PEAL. Please refer to PEAL for how to run it.
Download the data from the Kitti official website into data/Kitti and run data/Kitti/downsample_pcd.py to generate the data. The data should be organized as follows:
--data--Kitti--metadata
|--sequences--00--velodyne--000000.bin
| | |--...
| |...
|--downsampled--00--000000.npy
| |--...
|--...
The code for Kitti is in experiments/Kitti. Use the following command for training.
python trainval.pyWe provide pretrained weights in output, use the following command to test the pretrained weights.
python test.py --snapshot ../../output/Kitti_release/snapshots/snapshot.pth.tar --note_name release
python eval.py --method lgr --note_name release@inproceedings{fu2025dual,
title={Dual Focus-attention Transformer for Robust Point Cloud Registration},
author={Fu, Kexue and Yuan, Mingzhi and Wang, Changwei and Pang, Weiguang and Chi, Jing and Wang, Manning and Gao, Longxiang},
booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
pages={11769--11778},
year={2025}
}