/CrashToNotCrash_code

Code for the paper "Crash To Not Crash: Learn to Identify Dangerous Vehicles Using a Simulator" presented in AAAI 2019 (Oral)

Primary LanguagePython

Crash to Not Crash: Learn to Identify Dangerous Vehicles using a Simulator

Getting Started

Installation

  • Install tensorflow
  • Clone this repo:
git clone https://github.com/gnsrla12/CrashToNotCrash_code
cd gtacrash_for_distrib

Prepare Dataset

  • Download YouTubeCrash (Real accident dataset collected from YouTube):
bash ./datasets/download_dataset.sh ae_photos
  • Download GTACrash (Synthetic accident dataset collected from Grand Theft Auto V):
bash ./datasets/download_dataset.sh horse2zebra

Apply a Pre-trained Model

  • Download the pre-trained model trained on GTACrash:
bash ./pretrained_models/download_model.sh style_cezanne
  • Now, let's measure performance of our model on the YouTube test dataset:
python ./scripts/test_script.py

The test results will be printed. ROC-AUC should output 0.915411. (Note that the measured accuracy is when threshold of the predictor is fixed at 0.5, and that is not an appropriate metric for the binary classification task)

Train

  • Train a model on the GTACrash dataset:
python ./scripts/train_gta_script.py
  • Train a model on the YouTubeCrash dataset:
python ./scripts/train_yt_script.py

The trained model will be saved to: ./checkpoints/

Visualize

  • Finally, visualize the prediction results of the model:
python ./scripts/visualize_script.py

The visualized results will be saved to : ./visualization/