Home

Awesome

Sparse4D

【2024/06】Our follow-up project, SparseDrive (an end-to-end planning model based on the sparse framework), has been released!!! arxiv & github.

【2024/01/22】The code repository for Sparse4D has been migrated to HorizonRobotics/Sparse4D, and the code for Sparse4Dv3 has also been open-sourced in the new code repository!!! Everyone is welcome to use it.

【2023/11/21】 The paper of Sparse4Dv3 has been published.

Sparse4Dv3 is about to be released, featuring stronger detection performance and end-to-end tracking capabilities.

State-of-the-Art Performance of Sparse4Dv2 in the nuScenes Benchmark for Online Models.

Overall Architecture

Sparse4D v2

<img src="resources/sparse4dv2_framework.png" width="1000" >

Sparse4D v1

<img src="resources/sparse4d_framework.png" width="1000" > <!-- [video demo](https://github.com/linxuewu/Sparse4D/releases/download/v0.0/video.avi) -->

nuScenes Benchmark

Validation

These experiments were conducted using 8 RTX 3090 GPUs with 24 GB memory.

modelbackbonepretrainimg sizeEpochTraningFPSNDSmAPconfigckptlog
Sparse4D-T4Res101FCOS3D640x1600242Day5H2.90.54380.4409cfgckptlog
Sparse4Dv2Res50ImageNet256x70410015H20.30.53840.4392cfgckptlog
Sparse4Dv2Res101nuImage512x14081002Day8.40.59390.5051---

Test

modelbackboneimg sizeNDSmAPmATEmASEmAOEmAVEmAAE
Sparse4D-T4Vov-99640x16000.5950.5110.5330.2630.3690.3170.124
Sparse4Dv2Vov-99640x16000.6380.5560.4620.2380.3280.2640.115

Quick Start

Install requirements.

pip install -r requirements.txt
cd projects/mmdet3d_plugin/ops
python setup.py develop

Download nuScenes dataset, pretrain checkpoint(fcos3d.pth ResNet101), pkl files(nuscenes_infos_trainval_with_inds.pkl) and init anchor centers(nuscenes_kmeans900.npy). Adjust the directory structure as follows:

Sparse4D
├── data
│   ├── nuscenes
│   │   ├── maps
│   │   ├── lidarseg
│   │   ├── samples
│   │   ├── sweeps
│   │   ├── v1.0-mini
│   │   ├── v1.0-test
|   |   └── v1.0-trainval
│   ├── nuscenes_cam
│   │   ├── nuscenes_infos_test.pkl
│   │   ├── nuscenes_infos_train.pkl
│   │   ├── nuscenes_infos_val.pkl
│   │   └── nuscenes_infos_trainval_with_inds.pkl
├── projects
│   ├── configs
│   │   ├── default_runtime.py
│   │   ├── sparse4d_r101_H1.py
│   │   ├── sparse4d_r101_H4.py
│   │   └── ...
│   └── mmdet3d_plugin
│       ├── apis
│       ├── core
│       ├── datasets
│       └── models
├── tools
│   ├── dist_test.sh
│   ├── dist_train.sh
│   ├── test.py
│   └── train.py
├── local_test.sh
├── local_train.sh
├── fcos3d.pth
└── nuscenes_kmeans900.npy

Train with config_name.py.

bash local_train.sh config_name

Test checkpoint_file with config_name.py.

bash local_test.sh config_name checkpoint_file 

Citation

@misc{2305.14018,
Author = {Xuewu Lin and Tianwei Lin and Zixiang Pei and Lichao Huang and Zhizhong Su},
Title = {Sparse4D v2: Recurrent Temporal Fusion with Sparse Model},
Year = {2023},
Eprint = {arXiv:2305.14018},
}

@misc{2211.10581,
  Author = {Xuewu Lin and Tianwei Lin and Zixiang Pei and Lichao Huang and Zhizhong Su},
  Title = {Sparse4D: Multi-view 3D Object Detection with Sparse Spatial-Temporal Fusion},
  Year = {2022},
  Eprint = {arXiv:2211.10581},
}

Acknowledgement