mmfn

[IROS'22] MMFN: Multi-Modal Fusion Net for End-to-End Autonomous Driving

https://github.com/kin-zhang/mmfn

Science Score: 54.0%

This score indicates how likely this project is to be science-related based on various indicators:

  • CITATION.cff file
    Found CITATION.cff file
  • codemeta.json file
    Found codemeta.json file
  • .zenodo.json file
    Found .zenodo.json file
  • DOI references
  • Academic publication links
    Links to: arxiv.org
  • Academic email domains
  • Institutional organization owner
  • JOSS paper metadata
  • Scientific vocabulary similarity
    Low similarity (15.8%) to scientific vocabulary
Last synced: 10 months ago · JSON representation ·

Repository

[IROS'22] MMFN: Multi-Modal Fusion Net for End-to-End Autonomous Driving

Basic Info
  • Host: GitHub
  • Owner: Kin-Zhang
  • License: mit
  • Language: Python
  • Default Branch: main
  • Homepage:
  • Size: 21.2 MB
Statistics
  • Stars: 106
  • Watchers: 1
  • Forks: 11
  • Open Issues: 0
  • Releases: 0
Created over 4 years ago · Last pushed over 1 year ago
Metadata Files
Readme License Citation

README.md

MMFN: Multi-Modal Fusion Net for End-to-End Autonomous Driving

official branch for IROS 2022 paper codes including collecting data, all benchmark in paper, training scripts and evaluations etc.

PWC arXiv

Quickly view

Background: How to efficiently use high-level information or sensor data in end-to-end driving. The whole architecture in MMFN from origin paper:

Scripts quick view in run_steps folder:

  • phase0_run_eval.py : collect data/ run eval in select routes files or town map
  • phase1_preprocess.py : pre-process data before training to speed up the whole training time
  • phase2_train.py: after having training data, run this one to have model parameters files. pls remember to check the config (You can try training process on Docker also)

This repo also provide experts with multi-road consideration. Refer to more experts, pls check latest carla-expert repo

0. Setup

Install anaconda Shell wget https://repo.anaconda.com/archive/Anaconda3-2020.11-Linux-x86_64.sh bash Anaconda3-2020.11-Linux-x86_64.sh source ~/.profile

Clone the repo and build the environment

Shell git clone https://github.com/Kin-Zhang/mmfn cd mmfn conda create -n mmfn python=3.7 conda activate mmfn pip3 install -r requirements.txt

For people who don't have CARLA [在内地的同学可以打开scripts换一下函数 走镜像下载更快点.. ]

```Shell chmod +x scripts/* ./scripts/setup_carla.sh

input version

10.1

auto download now ...

```

Download the vectorized lib with .so, will install based on your system version, for commercial reason, we cannot open this part of codes(C++) fully but get the lib file, with lib setting, we can still directly input the opendrive file and output the vectorized lane, pls see more usage in the code Shell ./scripts/setup_lib.sh

bashrc or zshrc setting: ```bash

<< Leaderboard setting

===> pls remeber to change this one

export CODEFOLDER=/home/kin/mmfn export CARLAROOT=/home/kin/CARLA_0.9.10.1

===> pls remeber to change this one

export SCENARIORUNNERROOT=${CODEFOLDER}/scenariorunner export LEADERBOARDROOT=${CODEFOLDER}/leaderboard export PYTHONPATH="${CARLAROOT}/PythonAPI/carla/":"${SCENARIORUNNERROOT}":"${LEADERBOARDROOT}":"${CARLAROOT}/PythonAPI/carla/dist/carla-0.9.10-py3.7-linux-x8664.egg":"${CODEFOLDER}/teamcode":${PYTHONPATH} ```

1. Dataset

The data is generated with leaderboard/expert_agent/mmfn_pilot.py in 8 CARLA towns using the routes and scenarios files provided at leaderboard/data on CARLA 0.9.10.1

The dataset is structured as follows:

- TownX_{tiny,short,long}: corresponding to different towns and routes files - TownX_X_07_01_23_26_34: contains data for an individual route - rgb_front: multi-view camera images at 400x300 resolution - lidar: 3d point cloud in .npy format - measurements: contains ego-agent's position, velocity and other metadata - radar: radar point in .npy format - maps: birdview maps image - opendrive: opendrive xodr file

How to Generate

First, please modify the config files and on .zshrc or .bashrc remember to export your CARLA_ROOT as above said, Here is config file preview: ```bash

Seed used by the TrafficManager (default: 0)

port: 2000 trafficManagerSeed: 0

============== for all route test===============

debug: False

only for debug ===> or just test the agent

routes: 'leaderboard/data/onlyonetown.xml'

towns: ['Town01', 'Town02', 'Town06', 'Town07']

routes: 'leaderboard/data/training_routes/'

scenarios: 'leaderboard/data/alltownstraffic_scenarios.json'

====================== Agent =========================

track: 'MAP' # 'SENSORS' agent: 'teamcode/expertagent/autopilot.py' defaults: - agentconfig: expert ```

Please write great port according to the CARLA server, and inside the script it will try to use Epic or vulkan mode since opengl mode will have black point on raining day, check the folder path and carla root to your path, then directly run this: [Hine: If the GPU memeory is bigger than 12G, and CPU memory with big swap space will be better.]

```bash conda activate mmfn

<< Leaderboard setting

===> pls remeber to change this one

export CODEFOLDER=/home/kin/mmfn export CARLAROOT=/home/kin/CARLA_0.9.10.1

===> pls remeber to change this one

export SCENARIORUNNERROOT=${CODEFOLDER}/scenariorunner export LEADERBOARDROOT=${CODEFOLDER}/leaderboard export PYTHONPATH="${CARLAROOT}/PythonAPI/carla/":"${SCENARIORUNNERROOT}":"${LEADERBOARDROOT}":"${CARLAROOT}/PythonAPI/carla/dist/carla-0.9.10-py3.7-linux-x8664.egg":"${CODEFOLDER}/teamcode":${PYTHONPATH}

python runsteps/phase0runeval.py port=2010 towns="['Town02', 'Town04', 'Town05', 'Town10']" resume=True ifopen_carla=True

if you have big GPU memory, you can start with these two simultaneously.

python runsteps/phase0runeval.py port=2000 towns="['Town01', 'Town03', 'Town06', 'Town07']" resume=True ifopen_carla=True ```

The dataset folder tree will like these one:

bash data └── train ├── Town06_tiny ├── Town06_00_07_01_23_40_19 ├── lidar ├── maps ├── measurements ├── opendrive ├── rgb_front └── radar ├── Town06_00_07_01_23_40_19 └── Town06_00_07_01_23_40_19

The scripts will start a CARLA with specific port number, example running like this:

Note: since official stable leaderboard have memory leak issue, check out here. Please check your memory and kill it to resume. Other notes for CARLA leaderboard check out here

2. Training

No need CARLA in these phase, please remember to modify the train.yml config file and especially ==modify the DATA PATH==

The record and visualization on training params use the wandb, please login before train, more details can be found at wandb.ai, You can disable wandb from config file using disabled

  1. To speed up the training since the data process is somehow time consuming. Save the finished data:

    bash python run_steps/phase1_preprocess_data.py

  2. DDP if you want to use multi-GPU through DDP or multi computers: nproc_per_node as using GPU,nnodes as computer number

    bash CUDA_VISIBLE_DEVICES=0,1,2,3,4,5 python -m torch.distributed.launch --nproc_per_node=4 --nnodes=1 run_steps/phase2_train_net.py

  3. Or one single GPU can just run:

bash python run_steps/phase2_train_net.py

Note for Docker: There is a Dockerfile ready for building training environment, but please remember to using -v link the datasets folder to container.

Benchmark

fork from transfuser codes, the benchmark training file and process can run as following command:

bash python team_code/benchmark/aim/train.py --device 'cuda:0' python team_code/benchmark/cilrs/train.py --device 'cuda:0' python team_code/benchmark/transfuser/train.py --device 'cuda:0'

3. Evaluate

This part is for evaluating to result or leaderboard, you can also download the modal file and try upload to leaderboard through leaderbaord branch. The whole process is the same way like generate dataset

  1. Download or Train a model file saved to log/mmfn_img or log/mmfn_vec or log/mmfn_rad. Pretrained weight can download here, check issue note it's not the best weight or maybe better than papers. Try train on your own dataset for fair comparsion.

  2. Check config/eval.yaml and inside e2e.yaml file spefice model weight path.

    ```bash routes: 'leaderboard/data/onlyonetown.xml'

    ====================== Agent =========================

    track: 'MAP' # 'SENSORS' agent: 'teamcode/e2eagent/mmfn_imgnet.py' defaults:

    • agent_config: e2e

    ======== e2e.yaml file for model path ============

    modelpath: 'log/mmfnimg' ```

  3. Running eval python script and see result json file in result Folder

    bash python run_steps/phase0_run_eval.py --config-name=eval

  4. The first one will take 1-2 mins because we are in traffic light. Be patience..

If all setting is correct, you will see eval like this one, pls remember to change route to only_one_town for debug.

And a demo video in CARLA main window view (speed up) the weight I used is mmfn_vec in dowload link:

https://github.com/Kin-Zhang/mmfn/assets/35365764/02be250c-1ab5-46a8-be99-0480df215e87

Cite Us

latex @inproceedings{zhang2022mmfn, title={MMFN: Multi-Modal-Fusion-Net for End-to-End Driving}, author={Zhang, Qingwen and Tang, Mingkai and Geng, Ruoyu and Chen, Feiyi and Xin, Ren and Wang, Lujia}, booktitle={2022 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS)}, pages={8638--8643}, year={2022}, organization={IEEE} }

Acknowledgements

This implementation is based on codes from several repositories. Thanks for these authors who kindly open-sourcing their work to the community. Please see our paper reference part to get more information on our reference

❤️: LBC, WorldOnRails, Transfuser, carla-brid-view, pylot, CARLA Leaderboard 1.0, Scenario Runner 1.0

Owner

  • Name: Kin
  • Login: Kin-Zhang
  • Kind: user
  • Location: Stockholm, Sweden
  • Company: PhD @KTH-RPL; MPhil HKUST

Learning now, wait a moment. PhD Student in @KTH-RPL

Citation (CITATION.cff)

cff-version: 1.2.0
message: "If you find this repo is useful, please cite it as below."
authors:
  - family-names: "Zhang"
    given-names: "Qingwen"
  - family-names: "Tang"
    given-names: "Mingkai"
  - family-names: "Geng"
    given-names: "Ruoyu"
  - family-names: "Chen"
    given-names: "Feiyi"
  - family-names: "Xin"
    given-names: "Ren"
  - family-names: "Wang"
    given-names: "Lujia"
title: "MMFN: Multi-Modal-Fusion-Net for End-to-End Driving"
version: 2022
date-released: 2022
url: "https://github.com/Kin-Zhang/mmfn"
preferred-citation:
  type: conference-paper
  authors:
    - family-names: "Zhang"
      given-names: "Qingwen"
    - family-names: "Tang"
      given-names: "Mingkai"
    - family-names: "Geng"
      given-names: "Ruoyu"
    - family-names: "Chen"
      given-names: "Feiyi"
    - family-names: "Xin"
      given-names: "Ren"
    - family-names: "Wang"
      given-names: "Lujia"
  title: "MMFN: Multi-Modal-Fusion-Net for End-to-End Driving"
  booktitle: "2022 IEEE/RSJ International Conference on Intelligent Robots and Systems (IROS)"
  pages: "8638-8643"
  year: 2022
  organization: "IEEE"

GitHub Events

Total
  • Issues event: 13
  • Watch event: 26
  • Issue comment event: 16
  • Push event: 2
  • Fork event: 3
Last Year
  • Issues event: 13
  • Watch event: 26
  • Issue comment event: 16
  • Push event: 2
  • Fork event: 3

Issues and Pull Requests

Last synced: 10 months ago

All Time
  • Total issues: 5
  • Total pull requests: 0
  • Average time to close issues: 16 days
  • Average time to close pull requests: N/A
  • Total issue authors: 3
  • Total pull request authors: 0
  • Average comments per issue: 1.8
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Past Year
  • Issues: 5
  • Pull requests: 0
  • Average time to close issues: 16 days
  • Average time to close pull requests: N/A
  • Issue authors: 3
  • Pull request authors: 0
  • Average comments per issue: 1.8
  • Average comments per pull request: 0
  • Merged pull requests: 0
  • Bot issues: 0
  • Bot pull requests: 0
Top Authors
Issue Authors
  • sidg2110 (5)
  • 23021211573 (2)
  • xiaofeifei-1 (1)
  • Dragonzz27 (1)
  • shayan223 (1)
  • raozhongyu (1)
  • vaibhavs-25 (1)
Pull Request Authors
  • dependabot[bot] (1)
Top Labels
Issue Labels
stale (3)
Pull Request Labels
dependencies (1)

Dependencies

Dockerfile docker
  • nvidia/cuda 11.3.1-cudnn8-devel-ubuntu18.04 build
scenario_runner/Dockerfile docker
  • ubuntu 18.04 build
leaderboard/requirements.txt pypi
  • dictor *
  • opencv-python ==4.2.0.32
  • pygame *
  • requests *
  • tabulate *
requirements.txt pypi
  • Shapely ==1.6.4.post2
  • debugpy *
  • dictor *
  • einops *
  • ephem *
  • filelock *
  • hydra-core ==1.1
  • matplotlib *
  • networkx ==2.2
  • numpy *
  • opencv-python ==4.2.0.32
  • pickle-mixin *
  • psutil *
  • py-trees ==0.8.3
  • pygame *
  • ray *
  • requests *
  • scipy *
  • six *
  • tabulate *
  • tqdm *
  • wandb *
  • xmlschema ==1.0.18
scenario_runner/Docs/requirements.txt pypi
  • markdown-include *
  • mkdocs >=1.0
  • mkdocs-redirects *
scenario_runner/requirements.txt pypi
  • Shapely ==1.6.4.post2
  • carla *
  • ephem *
  • matplotlib *
  • networkx ==2.2
  • numpy *
  • opencv-python ==4.2.0.32
  • psutil *
  • py-trees ==0.8.3
  • six *
  • tabulate *
  • xmlschema ==1.0.18
leaderboard/docs/Gemfile rubygems
  • jekyll-feed ~> 0.6 development
  • jekyll-paginate ~> 1.1.0 development
  • jekyll-sitemap >= 0 development
  • jekyll ~> 3.8.5
  • tzinfo-data >= 0
leaderboard/docs/jekyll-theme-clean-blog.gemspec rubygems
  • bundler ~> 2.0.1 development
  • rake ~> 12.0 development
  • jekyll ~> 3.8.5
.github/workflows/issue_stale.yaml actions
  • actions/stale v5 composite