S-NeRF: Neural Radiance Fields for Street Views,
Ziyang Xie, Junge Zhang, Wenye Li, Feihu Zhang, Li Zhang
ICLR 2023
S-NeRF++: Autonomous Driving Simulation via Neural Reconstruction and Generation,
Yurui Chen, Junge Zhang, Ziyang Xie, Wenye Li, Feihu Zhang, Jiachen Lu, Li Zhang
TPAMI 2025
We introduce S-NeRF, a robust system to synthesizing large unbounded street views for autonomous driving using Neural Radiance Fields (NeRFs). This project aims to enhance the realism and accuracy of street view synthesis and improve the robustness of NeRFs for real-world applications. (e.g. autonomous driving simulation, robotics, and augmented reality)
[8/06/24] We released the code for S-NeRF++: Autonomous Driving Simulation via Neural Reconstruction and Generation. A comprehensive driving simulation system based on neural reconstruction.
-
Large-scale Street View Synthesis: S-NeRF is able to synthesize large-scale street views with high fidelity and accuracy.
-
Improved Realism and Accuracy: S-NeRF significantly improves the realism and accuracy of specular reflections and street view synthesis.
-
Robust Geometry and Reprojection: By utilizing noisy and sparse LiDAR points, S-NeRF learns a robust geometry and reprojection based confidence to address the depth outliers.
-
Foreground Moving Vehicles: S-NeRF extends its capabilities for reconstructing moving vehicles, a task that is impracticable for conventional NeRFs.
- Env Installation
- Pose Preparation Scripts
- Depth & Flow Preparation Scripts
- Code for training and testing
- Foreground Vehicle Reconstruction Foreground-branch
Create a conda environment:
conda create -n S-NeRF python=3.8
conda activate S-NeRF
Install predependents:
pip install "git+https://github.com/facebookresearch/pytorch3d.git@stable"
Install the required packages:
pip install -r requiremnets.txt
- Prepare Dataset according to the following file tree
s-nerf/data/
βββ nuScenes/
β βββ mini/
β βββ trainval/
βββ waymo/
βββ scenes/
- Put scene name and its token in
scene_dict.json
{
"scene-0916": "325cef682f064c55a255f2625c533b75",
...
}
- Prepare the poses, images and depth in S-NeRF format
- nuScenes
python scripts/nuscenes_preprocess.py
--version [v1.0-mini / v1.0-trainval] \
--dataroot ./data/<YOUR DATASET ROOT> \
- Waymo
python scripts/waymo_preprocess.py
- Prepare the depth data
Put the first smaple token of the scene in./data/depth/sample_tokens.txt
Then follow the Depth Preparation Instruction
cd s-nerf
python train.py --config [CONFIG FILE]
For the foreground vehicle reconstruction, please refer to branch foreground.
# Clone the repo.
git clone https://github.com/fudan-zvg/S-NeRF.git
cd S-NeRF/s-nerf++
# Make a conda environment.
conda create --name snerfpp python=3.9
conda activate snerfpp
# Install requirements.
pip install -r requirements.txt
git clone https://github.com/NVlabs/nvdiffrast
pip install ./nvdiffrast
git clone https://github.com/ashawkey/raytracing
pip install ./raytracing
pip install torch_scatter ./zipnerf/gridencoder
# install kaolin, adapt the CUDA version to yourself, default cu117
pip install kaolin==0.15.0 -f https://nvidia-kaolin.s3.us-east-2.amazonaws.com/torch-2.0.1_cu117.html
The pretrained relighting and inpainting models can be downloaded here. Put the inpaint
directory in the main directory ./
Some of the reconstructed or generated foreground assets can be downloaded here here. Put the TEXTure_ckpt
directory in the main directory ./
The NeRF training and data process are to be released.
A processed waymo scene dataset and its trained checkpoint can be downloaded here. Put the dataset
in the ./
and ckpt
in ./zipnerf/
You can run the following code to start simulation based on trained NeRF ckpts (background scenes) and foreground assets.
# Two cars will be randomly inserted into each scene. Simulate 10 images for each scene
python config_run.py --config configs/car.yaml --n_image 10 --gpu 0
You will find the simulation data in ./annotation
directory as follows:
annotation
βββ <sequence_id>
βββ <run timestamps>
βββ bbox
β βββ frame_id.txt
βββ depth
β βββ frame_id.png
βββ image
β βββ frame_id.png
βββ semantic
β βββ frame_id.png
βββ vis
β βββ frame_id.png
βββ bev_results.npy
βββ intrinsic.npy
βββ target_poses.npy
Our bbox format is following kitti-format Waymo dataset. The camera parameters of each frame are saved in intrinsic.npy
and target_poses.npy
. The semantic labels are following Cityscape 19 classes.
- Data preparation
- Nuscenes pipeline
- Foreground generation
If you find this work useful, please cite:
@inproceedings{xie2023snerf,
author = {Xie, Ziyang and Zhang, Junge and Li, Wenye and Zhang, Feihu and Zhang, Li},
title = {S-NeRF: Neural Radiance Fields for Street Views},
booktitle = {International Conference on Learning Representations (ICLR)},
year = {2023}
}
@article{chen2025snerf,
title={S-NeRF++: Autonomous Driving Simulation via Neural Reconstruction and Generation},
author={Chen, Yurui and Zhang, Junge and Xie, Ziyang and Li, Wenye and Zhang, Feihu and Lu, Jiachen and Zhang, Li},
journal={IEEE Transactions on Pattern Analysis and Machine Intelligence (TPAMI)},
year={2025}
}