Datasets:

ArXiv:
OpenPloc / README.md
Eaton2026's picture
Add files using upload-large-folder tool
ac43bc2 verified
# OpenPloc
**Open Point cloud Localization** — A unified framework for point-based place recognition and pose regression.
<img src="assets/figs/fig_gf.png" alt="gf" width="500" height="170">
## Installation
```shell
uv venv
source .venv/bin/activate
uv sync
uv pip install cuml-cu12 # depends on cuda version, required by some methods
```
## How to Run
### 1. Environment Setup
```shell
# Create virtual environment
uv venv
source .venv/bin/activate # Linux/macOS
# or Windows: .venv\Scripts\activate
# Install dependencies
uv sync
uv pip install cuml-cu12 # select based on CUDA version, required by some methods
```
### 2. Data Preparation
Place datasets under the `data/` directory, or modify `dataset_root` in config files. Example KITTI directory structure:
```
{dataset_root}/
├── 00/
│ ├── velodyne/*.bin
│ ├── poses.txt
│ ├── times.txt
│ └── calib.txt
├── 01/
│ └── ...
```
### 3. Modify Configuration
Edit `config/exps/{method}/{dataset}.py` and set `dataset_root` to your data path. All method configs are in `config/exps/`; shared dataset definitions are in `config/datasets/`. Configs use relative paths under `data/` by default; adjust as needed.
### 4. Run Experiments
**TGFz7 + MCD 聚类参数**:见 [`methods/tgfz7_mcd/README.md`](methods/tgfz7_mcd/README.md)(改参数只需编辑 `methods/tgfz7_mcd/presets.py`)。
```shell
# Run boxgraph on KITTI-00, retrieve first 5 queries
python main.py -c boxgraph.kitti00 --num_queries 5
# Run with all queries
python main.py -c boxgraph.kitti00
# Specify full config path
python main.py -c config.boxgraph.kitti00
# Other common options
python main.py -c boxgraph.kitti00 --overwrite # force re-encode database
python main.py -c boxgraph.kitti00 -p 4 # 4 processes for retrieval
python main.py -c boxgraph.kitti00 --save_dir ./results # save results to directory
python main.py -c boxgraph.kitti00 --visualize # visualize map and query distribution
```
## Usage (Legacy)
```shell
# Example 1: retrieve the first 5 items
python main.py -c boxgraph.kitti00 --num_queries 5
# Example 2: retrieve all items
python main.py -c boxgraph.kitti00
```
## Benchmark
### Algorithm
| Method | Reference | Publication |
|-------------|------------------------------------------------------|-------------|
| M2DP | [link](https://ieeexplore.ieee.org/document/7759060) | IROS 2016 |
| ScanContext | [link](https://ieeexplore.ieee.org/document/8593953) | IROS 2018 |
| GosMatch | [link](https://ieeexplore.ieee.org/document/9341299) | IROS 2020 |
| SGPR | [link](http://arxiv.org/abs/2008.11459) | IROS 2020 |
| PosePN | [link](https://doi.org/10.1016/j.patcog.2022.108685) | Pattern Recognition 2022 |
| PosePN++ | [link](https://doi.org/10.1016/j.patcog.2022.108685) | Pattern Recognition 2022 |
| PoseSOE | [link](https://doi.org/10.1016/j.patcog.2022.108685) | Pattern Recognition 2022 |
| PoseMinkLoc | [link](https://doi.org/10.1016/j.patcog.2022.108685) | Pattern Recognition 2022 |
| BoxGraph | [link](http://arxiv.org/abs/2206.15154) | ICRA 2022 |
| RING | [link](https://arxiv.org/abs/2204.07992) | IROS 2022 |
| EgoNN | [link](https://arxiv.org/abs/2110.12486) | RA-L 2022 |
| BEVPlace | [link](https://ieeexplore.ieee.org/document/10377026) | ICCV 2023 |
| HypLiLoc | [link](https://arxiv.org/abs/2304.00932) | CVPR 2023 |
| SGLoc | [link](https://openaccess.thecvf.com/content/CVPR2023/html/Li_SGLoc_Scene_Geometry_Encoding_for_Outdoor_LiDAR_Localization_CVPR_2023_paper.html) | CVPR 2023 |
| NIDALoc | [link](https://ieeexplore.ieee.org/document/10296854) | IEEE TITS 2024 |
| DiffLoc | [link](https://openaccess.thecvf.com/content/CVPR2024/html/Li_DiffLoc_Diffusion_Model_for_Outdoor_LiDAR_Localization_CVPR_2024_paper.html) | CVPR 2024 |
| LightLoc | [link](https://arxiv.org/abs/2503.17814) | CVPR 2025 |
| GTRLoc | [link](https://openreview.net/forum?id=2Y2m0DZBfL) | NeurIPS 2025|
| FlashMix | [link](https://arxiv.org/abs/2410.00702) | WACV 2025 |
| PELoc | [link](https://dl.acm.org/doi/10.1145/3664644.3664771) | ACM MM 2025 |
### Dataset
| Dataset | Link |
|---------------|------------------------------------------------------|
| SemanticKITTI | [link](https://semantic-kitti.org/) |
| Oxford RobotCar | [link](https://oxford-robotics-institute.github.io/radar-robotcar-dataset/) |
| NCLT | [link](https://robots.engin.umich.edu/nclt/) |
| MulRan | [link](https://sites.google.com/view/mulran-pr) |
## Data Preparation
Create a new config file `config/{method}/{dataset}.py` with the following format:
```python
# 1. query data and map data
datasets = {
'map': {
'type': 'Kitti', # dataset registered name, see datasets.kitti.__init__
'dataset_root': '/path/to/dataset/sequences',
'sequence_name': '00',
'split': 'all',
'sampling_distance': 20.,
},
'query': {
'type': 'Kitti',
'dataset_root': '/path/to/dataset/sequences',
'sequence_name': '00',
'split': 'all',
'sampling_distance': 5.,
}
}
# 2. method
method = {
'type': 'BoxGraph', # method registered name, see methods.boxgraph
}
# 3. tracers for metrics
tracers = [
{'type': 'KittiRangeRecall2DoF', 'K': 1, 'radius': 5.},
{'type': 'KittiRangeRecall2DoF', 'K': 5, 'radius': 5.},
]
```
Run: `python main.py -c {method}.{dataset}`
## PELoc (Predictive Method with Training)
PELoc is a pose regression method that requires data generation (including LTI) and training before evaluation.
1. **Generate data** (converts OpenPloc format + LTI trajectories):
```bash
python -m methods.peloc.generate_dataset --configs peloc.oxford --output_dir data/peloc/oxford
```
2. **Train** (from `methods/peloc/PELoc`):
```bash
cd methods/peloc/PELoc && accelerate launch --num_processes 1 train.py --config config/oploc_oxford.yaml
```
Edit `config/oploc_oxford.yaml` to set `data_root` to your `data/peloc/oxford` path.
3. **Evaluate**: Set `weights` in `config/peloc/oxford.py` to your checkpoint, then `python main.py -c peloc.oxford`.
See [methods/peloc/README.md](methods/peloc/README.md) for details.
## Customization
### Customize Dataset
- First, the return of `CustomizedDataset.__getitem__` should have the format
```python
{
'pc': pointcloud_xyz,
'pose': ...,
'label': semantic_label
}
```
- Second, each experimental configuration should contain two part, i.e., (map_dataset, query_dataset).
- Third, the dataset should be implemented as the submodule of the module `datasets`, where the class `Dataset` should be implemented in the `__init__.py` of the submodule and registered by `datasets.builder.DATASETS`.
- Finally, overwrite the `__str__` method of the implemented data class to distinguish the generated database
### Customize Method
- First, each method should be implemented as a file of the module `methods`, where the class `Method` should be implemented and registered by `methods.builder.METHODS`.
- Second, implement four APIs for the method, etc., `encode, save_db, load_db, retrieve`
- Finally, overwrite the `__str__` method of the implemented method class to distinguish the generated database
### Customize Metric
- First, each metric should be implemented as a file of the module `tracers`, where the class `Tracer` should be implemented and registered by `tracers.builder.TRACERS`.
- Second, implement one APIs for the method, etc., `evaluate`
- Finally, overwrite the `__str__` method of the implemented tracer class
## Acknowledgments
We thank the authors of the following works for their contributions. SGLoc (Li et al., CVPR 2023) and DiffLoc (Li et al., CVPR 2024) introduce scene geometry encoding and diffusion-based pose generation for outdoor LiDAR localization; DiffLoc builds upon [RangeVit](https://github.com/valeoai/rangevit) and [PoseDiffusion](https://github.com/facebookresearch/PoseDiffusion). LightLoc (CVPR 2025) enables fast training via sample classification guidance. GTRLoc (NeurIPS 2025) uses geospatial text regularization for localization. FlashMix (Goswami et al., WACV 2025) achieves fast map-free localization via feature mixing and contrastive learning; it builds upon [SpTr](https://github.com/dvlab-research/SparseTransformer) and [SALSA](https://github.com/raktimgg/SALSA). BEVPlace (Luo et al., ICCV 2023) and EgoNN (Komorowski et al., RA-L 2022) provide BEV-based place recognition and 6DoF relocalization. BoxGraph (ICRA 2022), RING (Lu et al., IROS 2022), ScanContext (IROS 2018), M2DP (IROS 2016), and GosMatch (IROS 2020) offer learning-free or handcrafted descriptors. HypLiLoc (CVPR 2023) uses hyperbolic fusion for LiDAR pose regression. PosePN (Yu et al., Pattern Recognition 2022) introduces universal encoding and memory-aware regression for LiDAR localization; PosePN++, PoseSOE, and PoseMinkLoc are variants in the same framework. NIDALoc (Yu et al., IEEE TITS 2024) proposes neurobiologically inspired deep LiDAR localization. PELoc (Chen et al., ACM MM 2025) proposes pose enhancement and LTI data augmentation for single-trajectory LiDAR localization. We thank all open-source contributors for their code and datasets.