The user specifies a region of interest (ROI) using a bounding box. The code will automatically retrieve this ROI's road network from OpenStreetMap. For each road segment, the code will download a street view image by calling the Mapillary API. The code will then call the image segmentation model, Road Information Collector (RIC), for inferring road characteristics. The output will be fed into the Road Risk Evaluator (RRE), a neural network, which will predict the risk level for each road segment for the ROI.
Python > 3.6 is required
git clone https://github.com/open-mmlab/mmdetection.git
Download the trained model from here and put it in the model folder like this
model/sv1/sv1.pth
Install mmdetection following the instructions here
pip install -r requirements.txt
python inferX.py \
-t '{mapillary_client_token}' \
-p '{place_mame}' \
-b '{north west south east}' \
-c 'configs/sv1.py' -ckp 'model/sv1/sv1.pth' \
-f yes
- mapillary_client_token: Get your Mapillary Client Token from here
- place_mame: give a name for the region you are interested in
- {north west south east}: defining a bounding box of interest, in longitude and latitude
Download the trained RRE model from here and save it in the model folder
model/RRE.sav
python predict.py -p {place_mame} -b '{north west south east}' -m 'model/RRE.sav'
You can change the -p and -b values for different regions. Road risk prediction will be saved at
data/{place_mame}/Predictions_final.geojson