README.md

January 15, 2026 ยท View on GitHub

License Python PyTorch PRs Welcome

Welcome to OccStudio, a unified framework for 3D Occupancy Prediction. This project unifies our previous works, including ALOcc, CausalOcc, and GDFusion, along with multiple classic methods into a single, standardized codebase to support research in autonomous driving, embodied AI, and other intelligent systems.

The framework is designed to handle both Semantic Occupancy and Occupancy Flow prediction, supporting a wide variety of input modalities, feature encoding methods, temporal fusion strategies, image backbones, etc. Our goal is to provide a flexible foundation to accelerate research in Spatial Intelligence across academia and industry.

๐ŸŒŸ Highlights

  • ๐Ÿ† A Unified Framework: Provides a common codebase for multiple occupancy prediction methods, including ALOcc, CausalOcc, GDFusion, BEVDetOcc, FB-Occ, etc.
  • ๐Ÿ”ง Flexible and Configurable Architecture: Supports multiple input modalities (e.g., images, depth), various types of 3D feature encoding (e.g., Volume-based, BEV-based), different temporal fusion methods (e.g., SoloFusion, GDFusion), and different image backbones (e.g., Resnet, InterImage, Swin-Transformer), all of which are switchable via configuration.
  • ๐Ÿ“š Dataset Support: Provides full support for large-scale datasets like nuScenes and Waymo, and allows for seamlessly switching between different occupancy annotation formats (e.g., Occ3D, SurroundOcc, OpenOccupancy) for robust experimentation.

๐Ÿ“‹ Table of Contents

๐Ÿ›  Model Zoo

OccStudio currently supports the following models:

MethodTaskPublication
ALOccSemantic Occupancy & FlowICCV 2025
GDFusionSemantic OccupancyCVPR 2025
BEVDetOccSemantic Occupancy-
FB-OccSemantic OccupancyICCV 2023
SparseOccSemantic OccupancyECCV 2024

๐Ÿš€ Get Started

1. Installation

We recommend using Conda for environment management.

# Clone this repository (replace OccStudio with your actual repo name)
git clone https://github.com/cdb342/OccStudio
cd OccStudio

# Create and activate the conda environment
conda create -n OccStudio python=3.8 -y
conda activate OccStudio

# Install PyTorch dependencies (for CUDA 11.8)
pip install torch==2.0.1+cu118 torchvision==0.15.2+cu118 -f https://download.pytorch.org/whl/torch_stable.html

# Install MMCV dependencies
git clone https://github.com/open-mmlab/mmcv
cd mmcv
git checkout 1.x # Use the stable 1.x branch
MMCV_WITH_OPS=1 pip install -e . -v
cd ..

# Install MMDetection and MMSegmentation
pip install mmdet==2.28.2 mmsegmentation==0.30.0

# Install the OccStudio framework itself
pip install -v -e .

# Install other dependencies
pip install torchmetrics timm dcnv4 ninja spconv transformers IPython einops numba
pip install numpy==1.23.4 # Pin numpy version for compatibility

# (Optional for SparseOcc)
cd mmdet3d/models/sparseocc/csrc
pip install -v -e .

2. Data Preparation

nuScenes

  1. Download the full nuScenes dataset from the official website.
  2. Download the Occ3D nuScenes annotations from the project page.
  3. (Optional) Download other community annotations for extended experiments:

Please organize the data into the following directory structure:

โ”œโ”€โ”€ data
โ”‚   โ”œโ”€โ”€ nuscenes
โ”‚   โ”‚   โ”œโ”€โ”€ maps, samples, sweeps, v1.0-test, v1.0-trainval
โ”‚   โ”‚   โ”œโ”€โ”€ gts                 # Occ3D annotations
โ”‚   โ”‚   โ”œโ”€โ”€ gts_surroundocc     # (Optional) SurroundOcc annotations
โ”‚   โ”‚   โ”œโ”€โ”€ openocc_v2          # (Optional) OpenOcc annotations
โ”‚   โ”‚   โ”œโ”€โ”€ openocc_v2_ray_mask # (Optional) OpenOcc ray mask
โ”‚   โ”‚   โ””โ”€โ”€ nuScenes-Occupancy-v0.1 # (Optional) OpenOccupancy annotations

Finally, run the preprocessing scripts:

# 1. Extract semantic segmentation labels from LiDAR
python tools/nusc_process/extract_sem_point.py

# 2. Create formatted info files for the dataloader
PYTHONPATH=$(pwd):$PYTHONPATH python tools/create_data_bevdet.py

Alternatively, you can download the pre-processed segmentation labels, train.pkl and val.pkl files from our Hugging Face Hub, and organize their path as:

ALOcc/
โ”œโ”€โ”€ data/
โ”‚   โ”œโ”€โ”€ lidar_seg
โ”‚   โ”œโ”€โ”€ nuscenes/
โ”‚   โ”‚   โ”œโ”€โ”€ train.pkl
โ”‚   โ”‚   โ”œโ”€โ”€ val.pkl
โ”‚   โ”‚   ...
..

Waymo

  1. Download the Waymo Open Dataset from the official website.
  2. Download the Occ3D Waymo annotations and pkl files from here.
  3. Follow the official instructions to organize the files.

3. Pre-trained Models

For training, please download pre-trained image backbones from BEVDet GitHub, GeoMIM GitHub, or Hugging Face Hub. Place them in the ckpts/pretrain/ directory.


๐ŸŽฎ Usage

Training

Use the following script for distributed training.

# Syntax: bash tools/dist_train.sh [CONFIG_FILE] [WORK_DIR] [NUM_GPUS]
# Example: Train the ALOcc-3D model
bash tools/dist_train.sh configs/alocc/alocc_3d_256x704_bevdet_preatrain.py work_dir/alocc_3d 8

Testing

Download our pre-trained models from Hugging Face and run the testing script.

# Evaluate semantic occupancy (mIoU) or occupancy flow
# Syntax: bash tools/dist_test.sh [CONFIG_FILE] [CHECKPOINT_PATH] [NUM_GPUS]
# Example: Evaluate the ALOcc-3D model
bash tools/dist_test.sh configs/alocc/alocc_3d_256x704_bevdet_preatrain.py ckpts/alocc_3d_256x704_bevdet_preatrain.pth 8

# Evaluate semantic occupancy (RayIoU)
# Syntax: bash tools/dist_test_ray.sh [CONFIG_FILE] [CHECKPOINT_PATH] [NUM_GPUS]
# Example: Evaluate the ALOcc-3D model
bash tools/dist_test.sh configs/alocc/alocc_3d_256x704_bevdet_preatrain_wo_mask.py ckpts/alocc_3d_256x704_bevdet_preatrain_wo_mask.pth 8

Note: When performing inference with temporal fusion, please use 1 or 8 GPUs. A sampler bug may cause duplicate sample counting with other GPU configurations.

Benchmarking

We provide convenient tools to benchmark model FPS (Frames Per Second) and FLOPs.

# Benchmark FPS
# Syntax: python tools/analysis_tools/benchmark.py [CONFIG_FILE]
# Example: Benchmark the ALOcc-3D model
python tools/analysis_tools/benchmark.py configs/alocc/alocc_3d_256x704_bevdet_preatrain.py

# Calculate FLOPs
# Syntax: python tools/analysis_tools/get_flops.py [CONFIG_FILE] --modality image --shape 256 704
# Example: Calculate FLOPs for the ALOcc-3D model
python tools/analysis_tools/get_flops.py configs/alocc/alocc_3d_256x704_bevdet_preatrain.py --modality image --shape 256 704

Visualization

First, ensure you have Mayavi installed. You can install it using pip:

pip install mayavi

Before you can visualize the output, you need to run the model on the test set and save the prediction results.

Use the dist_test.sh script with the --save flag. This will store the model's output in a directory.

# Example: Evaluate the ALOcc-3D model and save the predictions
bash tools/dist_test.sh configs/alocc/alocc_3d_256x704_bevdet_preatrain.py ckpts/alocc_3d_256x704_bevdet_preatrain.pth 8 --save

The prediction results will be saved in the test/ directory, following a path structure like: test/[CONFIG_NAME]/[TIMESTAMP]/.

Once the predictions are saved, you can run the visualization script. This script requires the path to the prediction results and the path to the ground truth data.

# Syntax: python tools/visual.py [PREDICTION_PATH] [GROUND_TRUTH_PATH]
# Example:
python tools/visual.py work_dirs/alocc_3d_256x704_bevdet_preatrain/xxxxxxxx_xxxxxx/ your/path/to/ground_truth
  • Replace work_dirs/alocc_3d_256x704_bevdet_preatrain/xxxxxxxx_xxxxxx/ with the actual path to your saved prediction results from Step 2.
  • Replace your/path/to/ground_truth with the path to the corresponding ground truth dataset.

This will launch an interactive Mayavi window where you can inspect and compare the 3D occupancy predictions.

๐Ÿ“Š Main Results

Here are the performance benchmarks of models implemented in OccStudio.

๐Ÿ† Performance on nuScenes (Models on Occ3D Are Trained with Camera Visible Mask)
ModelAnnotationBackboneInputInput SizemIoUmIoU_DIoUFPSMemoryCheckpointConfig
BEVDetOcc-SFOcc3DR-50C256x70441.934.475.16.510717๐Ÿค— HFconfig
BEVDetOcc-GFOcc3DR-50C256x70443.636.177.87.03017๐Ÿค— HFconfig
FB-OccOcc3DR-50C256x70439.834.269.910.34099๐Ÿค— HFconfig
FB-Occ-GFOcc3DR-50C256x70442.136.473.310.32879๐Ÿค— HFconfig
ALOcc-2D-miniOcc3DR-50C256x70441.435.470.030.51605๐Ÿค— HFconfig
ALOcc-2DOcc3DR-50C256x70444.838.774.38.25553๐Ÿค— HFconfig
ALOcc-3DOcc3DR-50C256x70445.539.375.36.010793๐Ÿค— HFconfig
ALOcc-3DOcc3DR-50C+D256x70454.550.685.26.013003๐Ÿค— HFconfig
ALOcc-3DOcc3DIntern-TC+D256x70455.652.485.15.813015๐Ÿค— HFconfig
ALOcc-3DOcc3DSwin-BaseC+D512x140860.057.887.81.526867๐Ÿค— HFconfig
ALOcc-3D-GFOcc3DR-50C256x70446.540.277.46.24347๐Ÿค— HFconfig
ALOcc-3D-GFOcc3DR-50C+D256x70454.951.485.96.26561๐Ÿค— HFconfig
ALOcc-2D-GFOpenOccupancyR-50C900x160017.913.728.60.813857๐Ÿค— HFconfig
ALOcc-2D-GFOpenOccupancyR-50C+D900x160024.521.634.50.813891๐Ÿค— HFconfig
ALOcc-2D-mini*SurroundOccR-50C900x160021.519.531.55.82869๐Ÿค— HFconfig
ALOcc-3D*SurroundOccR-50C900x160024.021.734.71.711117๐Ÿค— HFconfig
ALOcc-3D-GFSurroundOccR-50C900x160025.522.538.20.911857๐Ÿค— HFconfig
๐Ÿ† Performance on nuScenes (Trained w/o Camera Visible Mask)
ModelAnnotationBackboneInputInput SizemIoURayIoURayIoU1m, 2m, 4mFPSMemoryCheckpointConfig
BEVDetOcc-SFOcc3DR-50C256x70424.335.231.2, 35.9, 38.46.510717๐Ÿค— HFconfig
FB-OccOcc3DR-50C256x70431.139.033.0, 39.9, 44.010.34099๐Ÿค— HFconfig
SparseOccOcc3DR-50C256x70426.632.526.2, 33.2, 38.1-5967๐Ÿค— HFconfig
ALOcc-2D-miniOcc3DR-50C256x70433.439.332.9, 40.1, 44.830.51605๐Ÿค— HFconfig
ALOcc-2DOcc3DR-50C256x70437.443.037.1, 43.8, 48.28.25553๐Ÿค— HFconfig
ALOcc-3DOcc3DR-50C256x70438.043.737.8, 44.7, 48.86.010793๐Ÿค— HFconfig
ALOcc-3D-GFOcc3DR-50C256x70438.444.138.1, 45.1, 49.36.24347๐Ÿค— HFconfig
๐Ÿ† Performance on OpenOcc (Semantic Occupancy and Flow)
MethodAnnotationBackboneInputInput SizeOcc ScoremAVEmAVETPRayIoURayIoU1m, 2m, 4mFPSCheckpointConfig
ALOcc-Flow-2DOcc3DR-50C256x70441.90.5300.43140.334.3, 41.0, 45.57.0๐Ÿค— HFconfig
ALOcc-Flow-3DOcc3DR-50C256x70443.10.5490.45841.935.6, 42.9, 47.25.5๐Ÿค— HFconfig

๐Ÿค Contribution

We welcome contributions from the community! If you find a bug, have a feature request, or want to contribute new models/datasets to OccStudio, please feel free to open an issue or submit a pull request. You can also contact Dubing Chen via email (dobbin.chen@gmail.com).


๐Ÿ™ Acknowledgement

We gratefully acknowledge the foundational work of many excellent open-source projects, and we would like to extend our special thanks to:


๐Ÿ“œ Citation

If you find OccStudio useful in your research, please consider citing our relevant papers:

@InProceedings{chen2025rethinking,
    author    = {Chen, Dubing and Zheng, Huan and Fang, Jin and Dong, Xingping and Li, Xianfei and Liao, Wenlong and He, Tao and Peng, Pai and Shen, Jianbing},
    title     = {Rethinking Temporal Fusion with a Unified Gradient Descent View for 3D Semantic Occupancy Prediction},
    booktitle = {Proceedings of the IEEE/CVF Conference on Computer Vision and Pattern Recognition (CVPR)},
    month     = {June},
    year      = {2025},
    pages     = {1505-1515}
}

@InProceedings{chen2025alocc,
    author    = {Chen, Dubing and Fang, Jin and Han, Wencheng and Cheng, Xinjing and Yin, Junbo and Xu, Chenzhong and Khan, Fahad Shahbaz and Shen, Jianbing},
    title     = {Alocc: adaptive lifting-based 3d semantic occupancy and cost volume-based flow prediction},
    booktitle = {Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV)},
    month     = {October},
    year      = {2025},
}

@InProceedings{chen2025semantic,
    author    = {Chen, Dubing and Zheng, Huan and Zhou, Yucheng and Li, Xianfei and Liao, Wenlong and He, Tao and Peng, Pai and Shen, Jianbing},
    title     = {Semantic Causality-Aware Vision-Based 3D Occupancy Prediction},
    booktitle = {Proceedings of the IEEE/CVF International Conference on Computer Vision (ICCV)},
    month     = {October},
    year      = {2025},
}