README.md 2.34 KB
Newer Older
Duncan D.'s avatar
Duncan D. committed
1 2
# rounD_risk

Duncan Deveaux's avatar
Duncan Deveaux committed
3 4
Estimation of the relationship between the variation of TTC in an area and the amount of associated risk.

5
# Files description
Duncan Deveaux's avatar
Duncan Deveaux committed
6

Duncan Deveaux's avatar
Duncan Deveaux committed
7
  * To use the provided code, `ROUND_PATH = "path/to/round/data/"` should be replaced with the path to your local copy of the rounD dataset in the [tools/consts.py](tools/consts.py) file.
Duncan Deveaux's avatar
Duncan Deveaux committed
8 9 10 11

The provided TTC analysis code is a tool to assess the variation of TTC in roundabouts of the rounD dataset, as well as risk, and investigate on correlation between these two units.
The provided files should be run in the following order:

12 13 14 15 16 17 18
  * [parse_exits.py](parse_exits.py): Parses the recordings of a given location ID to extract training data to train a model to assess roundabout exit probability of vehicles.
  * [parse.py](parse.py): Parses the recordings of a given location ID to augment the tracks with TTC data.
  
  
Once the data has been generated, it can be analyzed and visualized with the following scripts:
  
  * [analysis_exits.py](analysis.py): Trains a model to assess exit probability of a vehicle from the roundabout of given location ID.
Duncan Deveaux's avatar
Duncan Deveaux committed
19
  * [analysis.py](analysis.py): Uses the TTC-augmented tracks generated by the [parse.py](parse.py) file to study correlation between TTC variation and risk.
Duncan Deveaux's avatar
Duncan Deveaux committed
20

21 22 23 24

# Quickstart

```console
Duncan Deveaux's avatar
Duncan Deveaux committed
25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40
$ python3 parse_exits.py --location=[INSERT YOUR LOCATION HERE]
This will generate the training data for roundabout exit probability model training.
Pickle files will be generated in the exit_parse/ directory.

$ python3 parse.py --probability_weighting --location=[INSERT YOUR LOCATION HERE]
The probability_weighting option is important, as it will allow the parse.py script to use the exit probability model to generate probability-weighted risk.
Pickle files will be generated in the ttc_parse/ directory.

$ python3 analysis_exits.py --location=[INSERT YOUR LOCATION HERE]
Will show visualization of the training data for the roundabout exit probability model.
Will train the model and give its accuracy.

$ python3 analysis.py --location=[INSERT YOUR LOCATION HERE] --ttclimit=7.5 --cvtime=60.0
Will show correlation analysis between TTC CV and risk.
--ttclimit is the maximum TTC value in seconds that will be considered for computing the CV.
--cvtime is time in terms of TTC data values that will be used to compute the CV. (e.g. compute the CV of TTC values over the last 60 seconds of TTC values).
41
```