LightLoc is a fast and efficient framework for outdoor LiDAR-based localization. This repository provides the implementation of the LightLoc method, as described in our paper.
-
python 3.8
-
pytorch 1.11
-
cuda 11.3
To set up the environment, run:
source install.sh
LightLoc currently supports the following datasets:
Organize the dataset directories as follows:
- Oxford
data_root
├── 2019-01-11-14-02-26-radar-oxford-10k
│ ├── velodyne_left
│ │ ├── xxx.bin
│ │ ├── xxx.bin
│ │ ├── …
│ ├── velodyne_left_calibrateFalse.h5
│ ├── velodyne_left_False.h5
├── …
- NCLT
data_root
├── 2012-01-22
│ ├── velodyne_left
│ │ ├── xxx.bin
│ │ ├── xxx.bin
│ │ ├── …
├── velodyne_sync
│ │ ├── xxx.bin
│ │ ├── xxx.bin
│ │ ├── …
│ ├── velodyne_left_False.h5
├── …
Note:
- h5 ground truth files are provided in the groundtruth.
- We use nclt_process.py to preprocess velodyne_sync to speed up data reading.
python nclt_process.py
- Train classifier
python train.py --sample_cls=True --generate_clusters=True --batch_size=512 --epochs=50 --level_cluster=25
- Train regressor
python train.py --sample_cls=False --generate_clusters=False --batch_size=256 --epochs=25 --rsd=True --level_cluster=25
Note: To use the QEOxford dataset, uncomment line 81 in lidarloc.py.
- Train classifier
python train.py --sample_cls=True --generate_clusters=True --batch_size=512 --epochs=50 --level_cluster=100 --training_buffer_size=120000 --voxel_size=0.3
- Train regressor
python train.py --sample_cls=False --generate_clusters=False --batch_size=256 --epochs=30 --rsd=True --prune_ratio=0.15 --level_cluster=100 --voxel_size=0.3
python test.py
python test.py --voxel_size=0.3
Note: For results matching Table 3 in the paper, exclude lines 4300–4500 from the 2012-05-26 trajectory.
Pretrained models (backbone and scene-specific prediction heads) are available for download here.
If you find this codebase useful in your research, please cite our work:
@inproceedings{li2025lightloc,
title={LightLoc: Learning Outdoor LiDAR Localization at Light Speed},
author={Li, Wen and Liu, Chen and Yu, Shangshu and Liu, Dunqiang and Zhou, Yin and Shen, Siqi and Wen, Chenglu and Wang, Cheng},
booktitle={Proceedings of the Computer Vision and Pattern Recognition Conference},
pages={6680--6689},
year={2025}
}
This code builds on previous LiDAR localization pipelines, namely SGLoc and DiffLoc. Please consider citing:
@inproceedings{li2024diffloc,
title={DiffLoc: Diffusion Model for Outdoor LiDAR Localization},
author={Li, Wen and Yang, Yuyang and Yu, Shangshu and Hu, Guosheng and Wen, Chenglu and Cheng, Ming and Wang, Cheng},
booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
pages={15045--15054},
year={2024}
}
@inproceedings{li2023sgloc,
title={SGLoc: Scene Geometry Encoding for Outdoor LiDAR Localization},
author={Li, Wen and Yu, Shangshu and Wang, Cheng and Hu, Guosheng and Shen, Siqi and Wen, Chenglu},
booktitle={Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition},
pages={9286--9295},
year={2023}
}