How mcg-nju/sparseocc works
SparseOcc is a camera-based 3D occupancy prediction system for autonomous-driving scenes, with semantic and panoptic evaluation variants. Its principal workflow loads multi-view nuScenes data, transforms images and occupancy labels, predicts occupancy with a sparse-query model, and evaluates predictions with voxel or ray-based metrics. The README documents the model’s sparse 3D reconstruction and occupancy stages; the sampled configuration names its model, head, transformer, and data pipeline. Several runtime connections are configuration-driven and their exact call sites were not sampled, so those links are marked unverified.
Main entry points: r50_nuimg_704x256_8f.py Experiment config · nuscenes_occ_dataset.py Occupancy dataset · sparseocc_transformer.py Occupancy transformer · sparseocc.py SparseOcc model
Components 21
Data ingestion
- Occupancy dataset
loaders/nuscenes_occ_dataset.py - Ego pose data
loaders/ego_pose_dataset.py - Image loading
loaders/pipelines/loading.py - Image transforms
loaders/pipelines/transforms.py
Sparse prediction
- VoVNet backbone
models/backbones/vovnet.py - SparseOcc model
models/sparseocc.py - Occupancy head
models/sparseocc_head.py - Occupancy transformer
models/sparseocc_transformer.py - Sparse voxel decoder
models/sparse_voxel_decoder.py - Sparse BEV transformer
models/sparsebev_transformer.py - Multi-view sampling
models/sparsebev_sampling.py - Sampling CUDA op
models/csrc/wrapper.py
Evaluation
- RayIoU metric
loaders/ray_metrics.py - RayPQ metric
loaders/ray_pq.py - Voxel metrics
loaders/old_metrics.py
Runtime workflows
- Experiment config
configs/r50_nuimg_704x256_8f.py - Training entry
train.py - Validation entry
val.py - Prediction visualization
viz_prediction.py
Other components
- Researcher
- nuScenes data
Connections 22
- Researcher → Experiment config: selects settings
- nuScenes data → Occupancy dataset: provides samples
- Experiment config → Occupancy dataset: configures dataset
configs/r50_nuimg_704x256_8f.py - Experiment config → Image loading: sets pipeline
configs/r50_nuimg_704x256_8f.py - Experiment config → Image transforms: sets pipeline
configs/r50_nuimg_704x256_8f.py - Occupancy dataset → Ego pose data: uses pose data
loaders/nuscenes_occ_dataset.py - Occupancy dataset → RayIoU metric: uses metric
loaders/nuscenes_occ_dataset.py - Experiment config → SparseOcc model: selects model
configs/r50_nuimg_704x256_8f.py - Experiment config → Occupancy head: selects head
configs/r50_nuimg_704x256_8f.py - Experiment config → Occupancy transformer: selects transformer
configs/r50_nuimg_704x256_8f.py - SparseOcc model → Occupancy head: delegates prediction
models/sparseocc.py - Occupancy head → Occupancy transformer: runs transformer
models/sparseocc_head.py - Occupancy transformer → Sparse BEV transformer: reuses layers
models/sparseocc_transformer.py - Occupancy transformer → Sparse voxel decoder: uses decoder
models/sparseocc_transformer.py - Sparse BEV transformer → Multi-view sampling: uses sampling
models/sparsebev_transformer.py - Multi-view sampling → Sampling CUDA op: calls extension
models/sparsebev_sampling.py - Training entry → Experiment config: loads configuration
- Training entry → SparseOcc model: trains model
- Validation entry → RayIoU metric: evaluates predictions
- RayIoU metric → RayPQ metric: uses panoptic metric
loaders/ray_metrics.py - Validation entry → Voxel metrics: supports voxel scoring
- Researcher → Prediction visualization: inspects results