Giter Site home page Giter Site logo

datapartnership / integrated-framework-for-road-safety Goto Github PK

View Code? Open in Web Editor NEW
2.0 2.0 0.0 422 KB

Provides a road safety scan using machine learning to derive characteristics from street view images and predict road risk

Python 100.00%
mapillary mapbox waze datapartnership

integrated-framework-for-road-safety's Introduction

How it works

Integrated Framework for Road Safety

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.

Installation

Python > 3.6 is required

Download mmdetection into the current folder

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

Install other requirements

pip install -r requirements.txt

Infer road characteristics for a selected region

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

Predict risk level

Download the trained RRE model from here and save it in the model folder

model/RRE.sav

Run RRE model to predict road risk

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

integrated-framework-for-road-safety's People

Contributors

aidevcode avatar g4brielvs avatar jssggg avatar

Stargazers

 avatar  avatar

Watchers

 avatar  avatar

integrated-framework-for-road-safety's Issues

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.