- Install tensorflow
- Clone this repo:
git clone https://github.com/gnsrla12/crash_to_not_crash
cd crash_to_not_crash
- Download YouTubeCrash (Real accident dataset collected from YouTube):
python ./datasets/download_ytcrash.py
- Download GTACrash (Synthetic accident dataset collected from Grand Theft Auto V):
python ./datasets/download_gtacrash.py
You can skip downloading GTACrash if you just want to apply pretrained model to YouTubeCrash.
- Download the pre-trained model trained on GTACrash with refined labels:
python ./checkpoints/download_model.py
- 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)
- Finally, visualize the prediction results of the pretrained model:
python ./scripts/visualize_script.py
The visualized results will be saved to : ./visualization/
- Train a model on the GTACrash dataset with refined labels (Trained model overwrites the existing pre-trained model):
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/