Git Product home page Git Product logo

road-conditions's Introduction

Road Conditions

Automatically scrape images from public road condition cameras provided by https://511on.ca, and use a convolutional neural network to classify the condition of all roads with cameras. Displays the results on a webpage on a map with coloured markers, photos, and tags.

Scripts

Training

Training is done by scripts/train.py, which uses PyTorch to train a CNN. The training images are stored in assets/images/training, testing images are stored in assets/images/testing. There are no image files in the testing, or training directory (due to GitHub's storage limits). Training will not work until these folders are populated. There is a pretrained model in the assets folder.

Classification

Classification is performed by the scripts/classify.py script. This script will classify any images in the assets/predict folder with a filename of epochTime-lat-long.jpg, and rename classified images to be id.jpg. The classification of each image is stored in assets/jsons/cameras.json.

Image Scraping

Images are scraped by the python file scripts/get-images.py, and stored in the assets/images directory as a JPEG image with the name epochTime-lat-long.jpg. The script waits two seconds between grabbing images to prevent being rate limited. The web server by default only runs image scraping twice daily.

Server

Written in NodeJS, using express. Controls all of the python scripts, and relays the information to the web interface through rest APIs. Currently, there is no database, instead relevant data is stored in json files in the assets folder. The server checks if the model needs to be retrained hourly, and calls for new images & re-classification twice per day.

Web

Web Interface

Written in HTML, CSS and JavaScript, with Bootstrap and Leaflet. Communicates with the web server via REST APIs to get the status of all camera nodes. Displays all of the nodes with coloured markers on a leaflet openstreetmap. There is also a modal which allows the user to report incorrect classifications (which get queued by the web server for when the model is automatically retrained).

road-conditions's People

Contributors

jslightham avatar

Watchers

Kostas Georgiou avatar  avatar

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.