Code Monkey home page Code Monkey logo

toponet's Introduction

TopoNet: A New Baseline for Scene Topology Reasoning

Graph-based Topology Reasoning for Driving Scenes

arXiv OpenLane-V2 LICENSE

method


This repository contains the source code of TopoNet, Graph-based Topology Reasoning for Driving Scenes.

TopoNet is the first end-to-end framework capable of abstracting traffic knowledge beyond conventional perception tasks, i.e., reasoning connections between centerlines and traffic elements from sensor inputs. It unifies heterogeneous feature learning and enhances feature interactions via the graph neural network architecture and the knowledge graph design.

Instead of recognizing lanes, we adhere that modeling the lane topology is appropriate to construct road components within the perception framework, to facilitate the ultimate driving comfort. This is in accordance with the UniAD philosophy.

Table of Contents

News

  • Pinned: The leaderboard for Lane Topology Challenge is open for regular submissions year around. This Challenge would be back in 2024's edition.
  • [2023/11] πŸ”₯The code and model of OpenLane-V2 subset-B is released!
  • [2023/08] The code and model of TopoNet is released!
  • [2023/04] TopoNet paper is available on arXiv.
  • [2023/01] Introducing Autonomous Driving Challenge for Lane Topology at CVPR 2023.

Main Results

Results on OpenLane-V2 subset-A val

We provide results on Openlane-V2 subset-A val set.

Method Backbone Epoch DETl TOPll DETt TOPlt OLS
STSU ResNet-50 24 12.7 0.5 43.0 15.1 25.4
VectorMapNet ResNet-50 24 11.1 0.4 41.7 6.2 20.8
MapTR ResNet-50 24 8.3 0.2 43.5 5.8 20.0
MapTR* ResNet-50 24 17.7 1.1 43.5 10.4 26.0
TopoNet ResNet-50 24 28.6 4.1 48.6 20.3 35.6

πŸ”₯: Based on the updated v1.1 OpenLane-V2 devkit and metrics, we have reassessed the performance of TopoNet and other SOTA models. For more details please see issue #76 of OpenLane-V2.

Method Backbone Epoch DETl TOPll DETt TOPlt OLS
STSU ResNet-50 24 12.7 2.9 43.0 19.8 29.3
VectorMapNet ResNet-50 24 11.1 2.7 41.7 9.2 24.9
MapTR ResNet-50 24 8.3 2.3 43.5 8.9 24.2
MapTR* ResNet-50 24 17.7 5.9 43.5 15.1 31.0
TopoNet ResNet-50 24 28.6 10.9 48.6 23.8 39.8

*: evaluation based on matching results on Chamfer distance.
The result of TopoNet is from this repo.

Results on OpenLane-V2 subset-B val

Method Backbone Epoch DETl TOPll DETt TOPlt OLS
TopoNet ResNet-50 24 24.4 6.7 52.6 16.7 36.0

The result is based on the updated v1.1 OpenLane-V2 devkit and metrics.
The result of TopoNet is from this repo.

Model Zoo

Model Dataset Backbone Epoch OLS Memory Config Download
TopoNet-R50 subset-A ResNet-50 24 39.8 12.3G config ckpt / log
TopoNet-R50 subset-B ResNet-50 24 36.0 8.2G config ckpt / log

Prerequisites

  • Linux
  • Python 3.8.x
  • NVIDIA GPU + CUDA 11.1
  • PyTorch 1.9.1

Installation

We recommend using conda to run the code.

conda create -n toponet python=3.8 -y
conda activate toponet

# (optional) If you have CUDA installed on your computer, skip this step.
conda install cudatoolkit=11.1.1 -c conda-forge

pip install torch==1.9.1+cu111 torchvision==0.10.1+cu111 -f https://download.pytorch.org/whl/torch_stable.html

Install mm-series packages.

pip install mmcv-full==1.5.2 -f https://download.openmmlab.com/mmcv/dist/cu111/torch1.9.0/index.html
pip install mmdet==2.26.0
pip install mmsegmentation==0.29.1
pip install mmdet3d==1.0.0rc6

Install other required packages.

pip install -r requirements.txt

Prepare Dataset

Following OpenLane-V2 repo to download the data and run the preprocessing code.

cd TopoNet
mkdir data && cd data

ln -s {PATH to OpenLane-V2 repo}/data/OpenLane-V2

After setup, the hierarchy of folder data is described below:

data/OpenLane-V2
β”œβ”€β”€ train
|   └── ...
β”œβ”€β”€ val
|   └── ...
β”œβ”€β”€ test
|   └── ...
β”œβ”€β”€ data_dict_subset_A_train.pkl
β”œβ”€β”€ data_dict_subset_A_val.pkl
β”œβ”€β”€ data_dict_subset_B_train.pkl
β”œβ”€β”€ data_dict_subset_B_val.pkl
β”œβ”€β”€ ...

Train and Evaluate

Train

We recommend using 8 GPUs for training. If a different number of GPUs is utilized, you can enhance performance by configuring the --autoscale-lr option. The training logs will be saved to work_dirs/toponet.

cd TopoNet
mkdir -p work_dirs/toponet

./tools/dist_train.sh 8 [--autoscale-lr]

Evaluate

You can set --show to visualize the results.

./tools/dist_test.sh 8 [--show]

License

All assets and code are under the Apache 2.0 license unless specified otherwise.

Citation

If this work is helpful for your research, please consider citing the following BibTeX entry.

@article{li2023toponet,
  title={Graph-based Topology Reasoning for Driving Scenes},
  author={Li, Tianyu and Chen, Li and Wang, Huijie and Li, Yang and Yang, Jiazhi and Geng, Xiangwei and Jiang, Shengyin and Wang, Yuting and Xu, Hang and Xu, Chunjing and Yan, Junchi and Luo, Ping and Li, Hongyang},
  journal={arXiv preprint arXiv:2304.05277},
  year={2023}
}

@inproceedings{wang2023openlanev2,
  title={OpenLane-V2: A Topology Reasoning Benchmark for Unified 3D HD Mapping}, 
  author={Wang, Huijie and Li, Tianyu and Li, Yang and Chen, Li and Sima, Chonghao and Liu, Zhenbo and Wang, Bangjun and Jia, Peijin and Wang, Yuting and Jiang, Shengyin and Wen, Feng and Xu, Hang and Luo, Ping and Yan, Junchi and Zhang, Wei and Li, Hongyang},
  booktitle={NeurIPS},
  year={2023}
}

Related resources

We acknowledge all the open-source contributors for the following projects to make this work possible:

toponet's People

Contributors

faikit avatar hli2020 avatar ilnehc avatar sephyli avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

toponet's Issues

About the performance

Hi, thanks for releasing the code!
But the performance in Table is different from the log output:
From log file:
Epoch(val) [24][601] OpenLane-V2 Score: 0.3483, DET_l: 0.28414633870124817, DET_t: 0.4501965641975403, TOP_ll: 0.0415, TOP_lt: 0.2072
From Table:
| TopoNet | ResNet-50 | 24 | 28.5 | 4.1 | 48.1 | 20.8 | 35.6 |

visualization

Hello, thanks for the config and model you provided. I followed your tutorial for visualization, but I didn’t see the topological relationship between the lane centerline and traffic elements. I can see the topological relationship between lane centerlines normally

How to save all test visualization results?

Hello! TopoNet is a great job! When I was running./tools/dist_test.sh 1 --show, I found that only a few visualizations of 10001, 10002, 10003 were saved, I was wondering how to save the visualizations of all the data?

data_dict_subset_A_train.pkl missing

Thank you for your work. Here I have a little question that I follow the command to process dataset using "python OpenLane-V2/preprocess.py", but I don't get the .pkl file(eg. data_dict_subset_A_train.pkl), what's wrong? How can I get the .pkl file?

The resolution of input images

Hi, huge congratulations to your great work!
I have read the paper carefully, but do not understand the resolution of the input images. In the paper, you say that the input resolution is 20481550 and the front view image is cropped to 15501550, and then they are resized by a factor 0.5.

So, the input resolution for the front view is 775*775, and the other views are 1024 * 775? Since their input resolutions are different, so they are input to the backbones separately? Or the front view is padded in the same resolution as the other views and input to the backbone in a single batch?

Anyway, what are the resolutions of the various view images input to the backbone?

batch size

Hi, I want to know if the code supports batch_size>1
TopoNet/projects/toponet/models/detectors/toponet.py L165 will check the gt_bboxes number. If batch_size>1, some images may contain gt_bboxes and the others may not contain gt_bboxes.
How should I deal with this situation?
Looking forward to your reply

Inquire geo isolation dataset

Hi, thanks for your work. Could you please share the geo isolation dataset you use in your paper at Table 1? (e.g. .json file, pkl, etc.) Thanks for your help!

export onnx error ( We don't have an op for aten::mul but it isn't a special case )

when i export toponet to onnx ,report error as below :
RuntimeError: 0INTERNAL ASSERT FAILED at "../torch/csrc/jit/ir/alias_analysis.cpp":532, please report a bug to PyTorch. We don't have an op for aten::mul but it isn't a special case. Argument types: Tensor, bool,

Any suggestions on how I can solve this problem? Thanks a lot.

Regression in box head is used twice.

Thanks for sharing the code !
Within the box_head section, the box refinement process has already been executed within the self.transformer. Consequently, the output inter_reference represents the combined result of the regression outcomes and the position of the reference points. Nevertheless, it appears that you have reapplied the refinement operation on the inter_references output. Is this a deliberate design choice or merely a minor oversight that does not significantly impact performance?

one issue of different performance

In commit 07773fc, the DET_l score changed from 22.1 to 28.5. Was that due to an update in the evaluation function or a change in your configuration? Looking forward for your reply

about paper

Hello, Thanks for your work, I have some questions about the paper.
In 4.1.2 Re-implementation of SOTA Method, you mentioned that "we supervise VectorMapNet and MapTR with centerline labels and use the element queries in their Transformer decoders as the instance queries to produce the driving scene topology." Want to know how it is done?
Looking forward to your reply!

custom dataset

Hi, thanks for this great work.

By given custom dataset's camera intrinsic and extrinsic, is it possible to inference directly without training the model?

Best regards

how to reduce batch size

Thank you for your awesome work! Here I have a little question that I met error: "RuntimeError: CUDA out of memory. Tried to allocate 2.40 GiB (GPU 6; 23.70 GiB total capacity; 20.97 GiB already allocated; 598.81 MiB free; 21.46 GiB reserved in total by PyTorch)". I think reducing the batch size can solve it. But I can't find the corresponding code to modify. Could you help me?

Best regard!

subset-B val performance of ckpt

Thank you for your great work.
Recently, I downloaded the ckpt file for subsetB and evaluated it on the subsetB-val. However, the performance is significantly different from what is provided in repo.

OpenLane-V2 Score - 0.19636668752454212
DET_l - 0.13499410450458527
DET_t - 0.1379755288362503
TOP_ll - 0.043555243510227305
TOP_lt - 0.09229333809205244
F-Score for 3D Lane - 0.10671664825889586
{'OpenLane-V2 Score': 0.19636668752454212, 'DET_l': 0.1349941, 'DET_t': 0.13797553, 'TOP_ll': 0.043555243510227305, 'TOP_lt': 0.09229333809205244}

I checked the relevant dependencies for evaluation and have not found the reason. Could you please provide some advice? Looking forward for your reply. Thank you

openlanev2 1.1.0
mmcv-full 1.5.2
mmdet 2.26.0
mmdet3d 1.0.0rc6
mmsegmentation 0.29.1
torch 1.9.1+cu111
torchvision 0.10.1+cu111

Training metric problem

Hello, thank you for your contribution to autonomous driving, I am now trying to train the code in the single card 4090. The metrics after 3 days of training are very different from your logs. Can you help me see what went wrong? Below is my training log
20240507_104134.log

The performance of traffice element

Thanks to you awesome work! But when I training with repo code, the mAP of traffic elements is very low and the visualization result is wrong.

image

2023-08-30 01:16:58,035 - mmdet - INFO - Epoch(val) [24][601] OpenLane-V2 Score: 0.1291, DET_l: 0.2889845073223114, DET_t: 2.5147695851046592e-05, TOP_ll: 0.0411, TOP_lt: 0.0006

Code release

Hello, thank you for your work, I wonder when will the code and model be released?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.