Skip to content

Latest commit

 

History

History
86 lines (66 loc) · 3.19 KB

File metadata and controls

86 lines (66 loc) · 3.19 KB

Benchmark with TNT

Environment Preparation

  1. Create a conda environment and install dependencies as specified in TNT.

  2. Install the apex module.

    git clone https://github.com/ptrblck/apex.git
    cd apex
    git checkout apex_no_distributed
    pip install -v --no-cache-dir ./
  3. Install the Argoverse 1 API.

Data Preparation

  1. Download TFD/TFD-Example into ./dataset/v2x-seq-tfd with ${DATA_ROOT}

    # Download TFD-Example into ./dataset/v2x-seq-tfd
    bash tools/dataset_example_download.sh
    
    # export DATA_ROOT, change the DATA_ROOT to TFD-Example data root
    export DATA_ROOT=${PWD}'/dataset/v2x-seq-tfd/V2X-Seq-TFD-Example'
  2. Merge Multiple Maps into One Map

    # Merge Multiple Maps into One Map
    python tools/data_converter/maps_merge.py --data_root ${DATA_ROOT}
  3. Preprocess Cooperative-view Trajectories

    # Preprocess Cooperative-view Trajectories --split train/val
    python tools/trajectory_fusion/fusion_for_prediction.py --data_root ${DATA_ROOT} --split train
    python tools/data_converter/tfd_converter.py --data_root ${DATA_ROOT} --split train
    python tools/trajectory_fusion/fusion_for_prediction.py --data_root ${DATA_ROOT} --split val
    python tools/data_converter/tfd_converter.py --data_root ${DATA_ROOT} --split val
  4. DATA Preprocess

    # Preprocess Raw Data
    cd projects/TNT_plugin
    python core/util/preprocessor/tfd_preprocess.py --root ${DATA_ROOT}/cooperative-vehicle-infrastructure/fusion_for_prediction
    
    python core/util/preprocessor/tfd_preprocess.py --root ${DATA_ROOT}/cooperative-vehicle-infrastructure/vehicle-trajectories
    
    python core/util/preprocessor/tfd_preprocess.py --root ${DATA_ROOT}/single-vehicle/trajectories
    
    python core/util/preprocessor/tfd_preprocess.py --root ${DATA_ROOT}/single-infrastructure/trajectories

Training

  1. Train the PP-VIC with TNT for Online task

    cd projects/TNT_plugin
    bash tnt_train.sh ${GPU_ID} ${DATA_ROOT}/cooperative-vehicle-infrastructure/fusion_for_prediction/interm_data
  2. Train the TNT for Offline task

    cd projects/TNT_plugin
    
    # Pretrained with infrastructure trajectories
    bash tnt_pretrain.sh ${GPU_ID} ${DATA_ROOT}/single-infrastructure/trajectories/interm_data
    
    # Finetune with vehicle trajectories and pretrained model
    bash tnt_finetune.sh ${GPU_ID} ${DATA_ROOT}/cooperative-vehicle-infrastructure/vehicle-trajectories/interm_data ${PTH}

Evaluation

  1. Evaluate the Trained PP-VIC with TNT for Online task. We have provided the trained online.pth.

    cd projects/TNT_plugin
    bash tnt_eval.sh ${GPU_ID} ${DATA_ROOT}/cooperative-vehicle-infrastructure/fusion_for_prediction/interm_data ${PTH}
  2. Evaluate the TNT for Offline task. We have provided the trained offline.pth.

    cd projects/TNT_plugin
    bash tnt_eval.sh ${GPU_ID} ${DATA_ROOT}/cooperative-vehicle-infrastructure/vehicle-trajectories/interm_data ${PTH}