[ICCV 2021] HRegNet: A Hierarchical Network for Large-scale Outdoor LiDAR Point Cloud Registration

Overview

HRegNet: A Hierarchical Network for Large-scale Outdoor LiDAR Point Cloud Registration

Introduction

The repository contains the source code and pre-trained models of our paper (published on ICCV 2021): HRegNet: A Hierarchical Network for Large-scale Outdoor LiDAR Point Cloud Registration.

The overall network architecture is shown below:

Environments

The code mainly requires the following libraries and you can check requirements.txt for more environment requirements.

Please run the following commands to install point_utils

cd models/PointUtils
python setup.py install

Training device: NVIDIA RTX 3090

Datasets

The point cloud pairs list and the ground truth relative transformation are stored in data/kitti_list and data/nuscenes_list. The data of the two datasets should be organized as follows:

KITTI odometry dataset

DATA_ROOT
├── 00
│   ├── velodyne
│   ├── calib.txt
├── 01
├── ...

NuScenes dataset

DATA_ROOT
├── v1.0-trainval
│   ├── maps
│   ├── samples
│   │   ├──LIDAR_TOP
│   ├── sweeps
│   ├── v1.0-trainval
├── v1.0-test
│   ├── maps
│   ├── samples
│   │   ├──LIDAR_TOP
│   ├── sweeps
│   ├── v1.0-test

Train

The training of the whole network is divided into two steps: we firstly train the feature extraction module and then train the network based on the pretrain features.

Train feature extraction

  • Train keypoints detector by running sh scripts/train_kitti_det.sh or sh scripts/train_nusc_det.sh, please reminder to specify the GPU,DATA_ROOT,CKPT_DIR,RUNNAME,WANDB_DIR in the scripts.
  • Train descriptor by running sh scripts/train_kitti_desc.sh or sh scripts/train_nusc_desc.sh, please reminder to specify the GPU,DATA_ROOT,CKPT_DIR,RUNNAME,WANDB_DIR and PRETRAIN_DETECTOR in the scripts.

Train the whole network

Train the network by running sh scripts/train_kitti_reg.sh or sh scripts/train_nusc_reg.sh, please reminder to specify the GPU,DATA_ROOT,CKPT_DIR,RUNNAME,WANDB_DIR and PRETRAIN_FEATS in the scripts.

Update: Pretrained weights for detector and descriptor are provided in ckpt/pretrained. If you want to train descriptor, you can set PRETRAIN_DETECTOR to DATASET_keypoints.pth. If you want to train the whole network, you can set PRETRAIN_FEATS to DATASET_feats.pth.

Test

We provide pretrain models in ckpt/pretrained, please run sh scripts/test_kitti.sh or sh scripts/test_nusc.sh, please reminder to specify GPU,DATA_ROOT,SAVE_DIR in the scripts. The test results will be saved in SAVE_DIR.

Citation

If you find this project useful for your work, please consider citing:

@InProceedings{Lu_2021_HRegNet,
        author = {Lu, Fan and Chen, Guang and Liu, Yinlong and Zhang Lijun, Qu Sanqing, Liu Shu, Gu Rongqi},
        title = {HRegNet: A Hierarchical Network for Large-scale Outdoor LiDAR Point Cloud Registration},
        booktitle = {Proceedings of the IEEE/CVF International Conference on Computer Vision},
        year = {2021}
}

Acknowledgments

We want to thank all the ICCV reviewers and the following open-source projects for the help of the implementation:

  • DGR(Point clouds preprocessing and evaluation)
  • PointNet++(unofficial implementation, for Furthest Points Sampling)
Comments
  • How to get the rotation error?

    How to get the rotation error?

    Thank for your generous sharing. However after I reproduced your experiment, I found that the results of the rotation error in the KITTI_SUMMARY is not consistent with the results in the paper. How did you get it from the results in the KITTI_SUMMARY?

    opened by xiyue-wx 8
  • Bug in Hierarchical Transformation

    Bug in Hierarchical Transformation

    I think there's a mistake in Hierarchical Transformation from coarse to fine, the last element in transformation matrix should be 1 not 0, it will result the wrong translation. Maybe it can be fixed like this:
    

    image

    opened by WinterCodeForEverything 5
  • "There appear to be 6 leaked semaphore objects to clean up at shutdown"

    I ran the code sh scripts/train_kitti_det.sh, and I got error message like this: image

    I looked into it on the google, they said it was because batch_size is too large or num_worker is too large.

    I set parameter "batch_size" as 1, and set parameter "gpu" as "0,1,2"(everyone is a 3090 gpu), and set train_feats.py/train_loader/num_workers as 1,but I still got the same message.

    Here is my train_kitti_det.sh by the way.

    python train_feats.py --batch_size 1 --epochs 100 --lr 0.001 --seed 1 --gpu 0,1,2 \
    --npoints 16384 --dataset kitti --voxel_size 0.3 --ckpt_dir /media/data3/hlf_data/HRegNet0/HRegNet/ckpt \
    --use_fps --use_weights --data_list ./data/kitti_list --runname "train_kitti_det0" --augment 0.5 \
    --root /media/data3/hlf_data/HRegNet0/HRegNet/data/kitti_list --wandb_dir /media/data3/hlf_data/HRegNet0/HRegNet/wandb_env --use_wandb
    

    Is there any way to solve this? :)

    opened by Git-oNmE 4
  • How to process the dataset?

    How to process the dataset?

    I run the command sh scripts/train_kitti_det.sh, and I got the error message like this:

    Traceback (most recent call last):
      File "/media/data3/hlf_data/HRegNet0/HRegNet/train_feats.py", line 243, in <module>
        train_feats(args)
      File "/media/data3/hlf_data/HRegNet0/HRegNet/train_feats.py", line 159, in train_feats
        for i, data in pbar:
      File "/home/hlf/miniconda3/envs/HRegNet/lib/python3.9/site-packages/tqdm/std.py", line 1195, in __iter__
        for obj in iterable:
      File "/home/hlf/miniconda3/envs/HRegNet/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 435, in __next__
        data = self._next_data()
      File "/home/hlf/miniconda3/envs/HRegNet/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 1085, in _next_data
        return self._process_data(data)
      File "/home/hlf/miniconda3/envs/HRegNet/lib/python3.9/site-packages/torch/utils/data/dataloader.py", line 1111, in _process_data
        data.reraise()
      File "/home/hlf/miniconda3/envs/HRegNet/lib/python3.9/site-packages/torch/_utils.py", line 428, in reraise
        raise self.exc_type(msg)
    FileNotFoundError: Caught FileNotFoundError in DataLoader worker process 0.
    Original Traceback (most recent call last):
      File "/home/hlf/miniconda3/envs/HRegNet/lib/python3.9/site-packages/torch/utils/data/_utils/worker.py", line 198, in _worker_loop
        data = fetcher.fetch(index)
      File "/home/hlf/miniconda3/envs/HRegNet/lib/python3.9/site-packages/torch/utils/data/_utils/fetch.py", line 44, in fetch
        data = [self.dataset[idx] for idx in possibly_batched_index]
      File "/home/hlf/miniconda3/envs/HRegNet/lib/python3.9/site-packages/torch/utils/data/_utils/fetch.py", line 44, in <listcomp>
        data = [self.dataset[idx] for idx in possibly_batched_index]
      File "/media/data3/hlf_data/HRegNet0/HRegNet/data/kitti_data.py", line 89, in __getitem__
        src_points = read_kitti_bin_voxel(data_dict['points1'], self.npoints, self.voxel_size)
      File "/media/data3/hlf_data/HRegNet0/HRegNet/data/kitti_data.py", line 20, in read_kitti_bin_voxel
        scan = np.fromfile(filename, dtype=np.float32, count=-1).reshape([-1,4])
    FileNotFoundError: [Errno 2] No such file or directory: '/media/data3/hlf_data/HRegNet0/HRegNet/data/kitti_list/01/velodyne/000204.bin'
    

    Seems like I didn't process the data files rightly.

    I see it in the readme.md that the files should be organized like this: image

    But I don't know how to come to this. Mine is just like thiis: image

    Someone help me please? Thanks!

    opened by Git-oNmE 4
  • "import point_utils_cuda" cant make it

    I was running sh scripts/train_kitti_det.sh,then I got the error message

    /home/hlf/miniconda3/envs/HRegNet/lib/python3.9/site-packages/MinkowskiEngine-0.5.4-py3.9-linux-x86_64.egg/MinkowskiEngine/__init__.py:36: UserWarning: The environment variable `OMP_NUM_THREADS` not set. MinkowskiEngine will automatically set `OMP_NUM_THREADS=16`. If you want to set `OMP_NUM_THREADS` manually, please export it on the command line before running a python script. e.g. `export OMP_NUM_THREADS=12; python your_program.py`. It is recommended to set it below 24.
      warnings.warn(
    Traceback (most recent call last):
      File "/media/data3/hlf_data/HRegNet0/HRegNet/train_feats.py", line 7, in <module>
        from data.kitti_data import KittiDataset
      File "/media/data3/hlf_data/HRegNet0/HRegNet/data/kitti_data.py", line 11, in <module>
        from models.utils import generate_rand_rotm, generate_rand_trans, apply_transform
      File "/media/data3/hlf_data/HRegNet0/HRegNet/models/utils.py", line 7, in <module>
        import point_utils_cuda
    ImportError: /home/hlf/miniconda3/envs/HRegNet/lib/python3.9/site-packages/point_utils-0.0.0-py3.9-linux-x86_64.egg/point_utils_cuda.cpython-39-x86_64-linux-gnu.so: undefined symbol: _ZN3c104cuda20getCurrentCUDAStreamEa
    

    I checked my file list, found no file named "point_utils_cuda.py" indeed. image

    How can I deal with this problem? Thank you very much!

    opened by Git-oNmE 4
  • How did you process the gt ?

    How did you process the gt ?

    Hello,

    Thank you for the sharing but I found out if I transfer your datalist (e.g. kitti sequence 08) back to the format in kitti odometry, they don't equal to each other. can you tell me how did you process to get your train data set ?

    opened by sYANGunique1111 4
  • Question in CoarseReg class

    Question in CoarseReg class

    Hello,

    Thank you for your generosity to share the code. However I got stuck when I come to the forward() function of CoarseReg class.

    屏幕截图 2022-01-27 111733

    What I understand about line 249 and line 255 is that you want to gather k nearest cosine neighbors in src for keypoints in dst and k nearest neighbors in dst for keypoints in src. I didn't understand why you used src_knn_idx for both cases? I assume it should be dst_knn_idx instead in line 249, because it gathers k nearest neighbors in src to keypoints in dst.

    Best regards.

    opened by sYANGunique1111 3
  • Test Keypoints

    Test Keypoints

    Hello, I am trying to use just the keypoint detector part and am willing to use the pretrained detector weights to be tested on my own data sample (save keypoints of each pointcloud). I can see that there is a test.py for the testing entire network, could you please guide me on how can I test just the detector part and not the entire Net on my sample?

    Thanks for the nice work, btw. Looking forward to your response. Fatemeh

    opened by fatemechangizian 2
  • Detect keypoints and find correspondances

    Detect keypoints and find correspondances

    Hello,

    I have been studying your model and I found out that the keypoints are found by summing the product of weights and knn points, how ever this may not affirm that they exactly exist in the original point cloud. Besides I found something silimar in the process of finding correspondances in target point cloud that you use the attentive weights to multiplys knn points as well, which doesn't verify the corres points exist in target point cloud either. Did I get somewhere wrong ?

    opened by sYANGunique1111 2
Owner
Intelligent Sensing, Perception and Computing Group
Intelligent Sensing, Perception and Computing Group
Point Cloud Denoising input segmentation output raw point-cloud valid/clear fog rain de-noised Abstract Lidar sensors are frequently used in environme

Point Cloud Denoising input segmentation output raw point-cloud valid/clear fog rain de-noised Abstract Lidar sensors are frequently used in environme

null 75 Nov 24, 2022
Synthetic LiDAR sequential point cloud dataset with point-wise annotations

SynLiDAR dataset: Learning From Synthetic LiDAR Sequential Point Cloud This is official repository of the SynLiDAR dataset. For technical details, ple

null 78 Dec 27, 2022
Compute descriptors for 3D point cloud registration using a multi scale sparse voxel architecture

MS-SVConv : 3D Point Cloud Registration with Multi-Scale Architecture and Self-supervised Fine-tuning Compute features for 3D point cloud registration

null 42 Jul 25, 2022
[ICCV 2021 Oral] SnowflakeNet: Point Cloud Completion by Snowflake Point Deconvolution with Skip-Transformer

This repository contains the source code for the paper SnowflakeNet: Point Cloud Completion by Snowflake Point Deconvolution with Skip-Transformer (ICCV 2021 Oral). The project page is here.

AllenXiang 65 Dec 26, 2022
Registration Loss Learning for Deep Probabilistic Point Set Registration

RLLReg This repository contains a Pytorch implementation of the point set registration method RLLReg. Details about the method can be found in the 3DV

Felix Järemo Lawin 35 Nov 2, 2022
Point Cloud Registration Network

PCRNet: Point Cloud Registration Network using PointNet Encoding Source Code Author: Vinit Sarode and Xueqian Li Paper | Website | Video | Pytorch Imp

ViNiT SaRoDe 59 Nov 19, 2022
Cascading Feature Extraction for Fast Point Cloud Registration (BMVC 2021)

Cascading Feature Extraction for Fast Point Cloud Registration This repository contains the source code for the paper [Arxive link comming soon]. Meth

null 7 May 26, 2022
PyTorch implementation of NeurIPS 2021 paper: "CoFiNet: Reliable Coarse-to-fine Correspondences for Robust Point Cloud Registration"

PyTorch implementation of NeurIPS 2021 paper: "CoFiNet: Reliable Coarse-to-fine Correspondences for Robust Point Cloud Registration"

null 76 Jan 3, 2023
PointNetVLAD: Deep Point Cloud Based Retrieval for Large-Scale Place Recognition, CVPR 2018

PointNetVLAD: Deep Point Cloud Based Retrieval for Large-Scale Place Recognition PointNetVLAD: Deep Point Cloud Based Retrieval for Large-Scale Place

Mikaela Uy 294 Dec 12, 2022
Perturbed Self-Distillation: Weakly Supervised Large-Scale Point Cloud Semantic Segmentation (ICCV2021)

Perturbed Self-Distillation: Weakly Supervised Large-Scale Point Cloud Semantic Segmentation (ICCV2021) This is the implementation of PSD (ICCV 2021),

null 12 Dec 12, 2022
Not All Points Are Equal: Learning Highly Efficient Point-based Detectors for 3D LiDAR Point Clouds (CVPR 2022, Oral)

Not All Points Are Equal: Learning Highly Efficient Point-based Detectors for 3D LiDAR Point Clouds (CVPR 2022, Oral) This is the official implementat

Yifan Zhang 259 Dec 25, 2022
[PyTorch] Official implementation of CVPR2021 paper "PointDSC: Robust Point Cloud Registration using Deep Spatial Consistency". https://arxiv.org/abs/2103.05465

PointDSC repository PyTorch implementation of PointDSC for CVPR'2021 paper "PointDSC: Robust Point Cloud Registration using Deep Spatial Consistency",

null 153 Dec 14, 2022
MVP Benchmark for Multi-View Partial Point Cloud Completion and Registration

MVP Benchmark: Multi-View Partial Point Clouds for Completion and Registration [NEWS] 2021-07-12 [NEW ?? ] The submission on Codalab starts! 2021-07-1

PL 93 Dec 21, 2022
You Only Hypothesize Once: Point Cloud Registration with Rotation-equivariant Descriptors

You Only Hypothesize Once: Point Cloud Registration with Rotation-equivariant Descriptors In this paper, we propose a novel local descriptor-based fra

Haiping Wang 80 Dec 15, 2022
Point Cloud Registration using Representative Overlapping Points.

Point Cloud Registration using Representative Overlapping Points (ROPNet) Abstract 3D point cloud registration is a fundamental task in robotics and c

ZhuLifa 36 Dec 16, 2022
GeoTransformer - Geometric Transformer for Fast and Robust Point Cloud Registration

Geometric Transformer for Fast and Robust Point Cloud Registration PyTorch imple

Zheng Qin 220 Jan 5, 2023
UnpNet - Rethinking 3-D LiDAR Point Cloud Segmentation(IEEE TNNLS)

UnpNet Citation Please cite the following paper if you use this repository in your reseach. @article {PMID:34914599, Title = {Rethinking 3-D LiDAR Po

Shijie Li 4 Jul 15, 2022
An algorithm that handles large-scale aerial photo co-registration, based on SURF, RANSAC and PyTorch autograd.

An algorithm that handles large-scale aerial photo co-registration, based on SURF, RANSAC and PyTorch autograd.

Luna Yue Huang 41 Oct 29, 2022
Style-based Point Generator with Adversarial Rendering for Point Cloud Completion (CVPR 2021)

Style-based Point Generator with Adversarial Rendering for Point Cloud Completion (CVPR 2021) An efficient PyTorch library for Point Cloud Completion.

Microsoft 119 Jan 2, 2023