This directory is a self-contained, memory-friendly and mostly CUDA-accelerated toolbox of multiple evaluation metrics for LiDAR generative models, including:
- Perceptual metrics (our proposed):
- Fréchet Range Image Distance (FRID)
- Fréchet Sparse Volume Distance (FSVD)
- Fréchet Point-based Volume Distance (FPVD)
- Statistical metrics (proposed in Learning Representations and Generative Models for 3D Point Clouds):
- Minimum Matching Distance (MMD)
- Jensen-Shannon Divergence (JSD)
- Statistical pairwise metrics (for reconstruction only):
- Chamfer Distance (CD)
- Earth Mover's Distance (EMD)
If you find this project useful in your research, please consider citing:
@article{ran2024towards,
title={Towards Realistic Scene Generation with LiDAR Diffusion Models},
author={Ran, Haoxi and Guizilini, Vitor and Wang, Yue},
journal={arXiv preprint arXiv:2404.00815},
year={2024}
}
- scipy
- numpy
- torch
- pyyaml
- Torchsparse v1.4.0 (pip install git+https://github.com/mit-han-lab/[email protected])
- Google Sparse Hash library (apt-get install libsparsehash-dev or compile locally and update variable CPLUS_INCLUDE_PATH with directory path)
To evaluate with perceptual metrics on different types of LiDAR data, you can download all models through:
- this google drive link in the .zip file
or
- the full directory of one specific model:
64-beam LiDAR (trained on SemanticKITTI):
Metric | Model | Arch | Link | Code | Comments |
---|---|---|---|---|---|
FRID | RangeNet++ | DarkNet21-based UNet | Google Drive | ./models/rangenet/model.py | range image input (our trained model without the need of remission input) |
FSVD | MinkowskiNet | Sparse UNet | Google Drive | ./models/minkowskinet/model.py | point cloud input |
FPVD | SPVCNN | Point-Voxel Sparse UNet | Google Drive | ./models/spvcnn/model.py | point cloud input |
32-beam LiDAR (trained on nuScenes):
Metric | Model | Arch | Link | Code | Comments |
---|---|---|---|---|---|
FSVD | MinkowskiNet | Sparse UNet | Google Drive | ./models/minkowskinet/model.py | point cloud input |
FPVD | SPVCNN | Point-Voxel Sparse UNet | Google Drive | ./models/spvcnn/model.py | point cloud input |
- Place the unzipped
pretrained_weights
folder under the root python directory or modify theDEFAULT_ROOT
variable in the__init__.py
. - Prepare input data, including the synthesized samples and the reference dataset. Note: The reference data should be the point clouds projected back from range images instead of raw point clouds.
- Specify the data type (
32
or64
) and the metrics to evaluate. Options:mmd
,jsd
,frid
,fsvd
,fpvd
,cd
,emd
. - (Optional) If you want to compute
frid
,fsvd
orfpvd
metric, adjust the corresponding batch size through theMODAL2BATCHSIZE
in file__init__.py
according to your max GPU memory (default: ~24GB). - Start evaluation and all results will print out!
from .eval_utils import evaluate
data = '64' # specify data type to evaluate
metrics = ['mmd', 'jsd', 'frid', 'fsvd', 'fpvd'] # specify metrics to evaluate
# list of np.float32 array
# shape of each array: (#points, #dim=3), #dim: xyz coordinate (NOTE: no need to input remission)
reference = ...
samples = ...
evaluate(reference, samples, metrics, data)
- The implementation of MinkowskiNet and SPVCNN is borrowed from 2DPASS.
- The implementation of RangeNet++ is borrowed from the official RangeNet++ codebase.
- The implementation of Chamfer Distance is adapted from CD Pytorch Implementation and Earth Mover's Distance from MSN official repo.