TonyXuQAQ / RNGDetPlusPlus

Official repo of paper RNGDet++: Road Network Graph Detection by Transformer with Instance Segmentation and Multi-scale Features Enhancement
GNU General Public License v3.0
89 stars 14 forks source link

RNGDet++

This is the official repo of paper RNGDet++: Road Network Graph Detection by Transformer with Instance Segmentation and Multi-scale Features Enhancement by Zhenhua Xu, Yuxuan Liu, Yuxiang Sun, Ming Liu and Lujia Wang.

Supplementary materials

For the demo video and supplementary document, please visit our project page.

Update

Mar/1/2023: Paper accepted by RA-L.

Dec/23/2022: Add SpaceNet dataset

Nov/28/2022: Release the initial version training code

Oct/23/2022: Update the Sat2Graph City-Scale dataset onto Google drive, since the raw data link provided by Sat2Graph is not valid any longer.

Sep/21/2022: Release the inference code

Platform info

Hardware:

GPU: 4 RTX3090
CPU: Intel(R) Xeon(R) Gold 6230 CPU @ 2.10GHz
RAM: 256G
SSD: 4T

Software:

Ubuntu 20.04.3 LTS
CUDA 11.1
Docker 20.10.7
Nvidia-driver 495.29.05

Docker

This repo is implemented in the docker container. All experiments except evaluation are conducted within docker containers. Make sure you have docker installed. Please refer to install Docker and Docker beginner tutorial for more information.

Docker image

cd docker
./build_image.bash

Docker container

In ./build_continer.bash, set RNGDet_dir as the directory of this repo.

./build_continer_cityscale.bash # to try city scale dataset released by Sat2Graph
./build_continer_spacenet.bash # to try SpaceNet dataset 

Note We keep the raw code for the city scale dataset. For the new added spacenet dataset, we modify the processing stripts to better fit RNGDet++ to it, since the spacenet dataset has smaller images covering smaller regions, which has quite different characteristics with that of the city scale dataset.

Data preparation and pretrained checkpoints

Run the follow commands to prepare the dataset and pretrained checkpoints of RNGDet and RNGDet++.

cd prepare_dataset
./preprocessing.bash

Update Oct/23/2022

The raw data download link provided by MIT is invalid now. We update the data to Google Drive.

Update Dec/24/2022

The script to download the data from Google Drive is blocked. Please manually download the data and put it into prepare_dataset. The Google Drive link could be found in the comment line in ./prepare_dataset/preprocessing.bash

Sampling

Before training, run the sampler to generate traing samples:

./bash/run_sampler.sh

Parameters:

Train

To train RNGDet, run

./bash/run_train_RNGDet.sh

To train RNGDet++, run

./bash/run_train_RNGDet++.sh

Note: Due to the randomness existing in both sampling and training, the final performance of the proposed models might be slightly different from the number reported in the paper. Please open an issue if you cannot produce the results.

Inference

To try RNGDet, run

./bash/run_test_RNGDet.sh

To try RNGDet++, run

./bash/run_test_RNGDet++.sh

Parameters:

Note: We provide the parameter setting in inference scripts of RNGDet and RNGDet++ in ./bash that achieve the best performance.

Evaluation

Go to {{ DATASET_NAME }}/metrics. For TOPO metrics, run

./topo.bash

For APLS metrics, run

./apls.bash

Remember to set the path of predicted graphs in bash scripts.

Note: Evaluation metric scripts are not runnable in docker container. Please use them outside docker.

Note: Due to the randomness of RNGDet++ and evaluation metrics, the actual evaluation results might be slight different from the reported numbers in the paper.

Contact

For any questions, please open an issue.

Ackonwledgement

We thank the following open-sourced projects:

SAT2GRAPH

DETR

Citation

@article{xu2022rngdet++,
  title={RNGDet++: Road Network Graph Detection by Transformer with Instance Segmentation and Multi-scale Features Enhancement},
  author={Xu, Zhenhua and Liu, Yuxuan and Sun, Yuxiang and Liu, Ming and Wang, Lujia},
  journal={arXiv preprint arXiv:2209.10150},
  year={2022}
}

License

GNU General Public License v3.0

Not allowed for commercial purposes. Only for academic research.