Code Monkey home page Code Monkey logo

taiwotman / smart-traffic Goto Github PK

View Code? Open in Web Editor NEW
38.0 2.0 24.0 159.44 MB

A system and method for the prediction of vehicle traffic congestion on a given roadway within a region. In particular, the computer implemented method of the present disclosure utilize real time traffic images from traffic cameras for the input of data and utilizes computer processing and machine learning to model a predictive level of congestion within a category of low congestion, medium congestion, or high congestion. By implementing machine learning in the comparison of exemplary images and administrator review, the computer processing system and method steps can predict a more efficient real-time congestion prediction over time.

Home Page: https://hub.docker.com/r/taiwotman/smart-traffic

License: Other

Python 24.82% CSS 22.90% JavaScript 7.20% HTML 43.22% Dockerfile 1.86%
congestion prediction traffic highway tensorflow-experiments tensorflow machine-learning

smart-traffic's Introduction

Predicting Short-Term Traffic Flow Congestion On Urban Motorway Networks

DESCRIPTION

A system and method for the prediction of vehicle traffic congestion on a given roadway within a region. In particular, the computer implemented method of the present disclosure utilize real time traffic images from traffic cameras for the input of data and utilizes computer processing and machine learning to model a predictive level of congestion within a category of low congestion, medium congestion, or high congestion. By implementing machine learning in the comparison of exemplary images and administrator review, the computer processing system and method steps can predict a more efficient real-time congestion over time.

Dependencies

Python Tensorflow Flask Urllib3 Numpy WTForms Werkzeug

REPOSITORY

RELEASE VERSION 1.1.0

  • Create Flask REST API using (real-time) traffic image data for prediction.

  • Implement search query based on region

  • Make Jinja template to display parameters on index.page

  • On Index page, display traffic images with URL and add dropdown selections with regions

  • Clean template

  • Add Prediction features

SET UP

LOCAL ENVIRONMENT

1. Clone git repository and cd into the directory

 git clone https://github.com/taiwotman/Smart-Traffic.git

2. Set up virtualenv with directory venv

 virtualenv venv

3. Activate venv using:

 source venv/bin/activate

4. Pip install requirements:

 pip install -r requirements.txt

5. Run command

 python run.py

Sample Test Case

6. To implement the following test, use the development branch.

7. Run the following python command with the traffic congestion image(supports only jpeg/jpg format) as argument. For example:

 python run.py test_image/Aut10_010.jpg

8. Sample output:

 high congestion (score = 0.70454)

AUTHORIZATION HEADER

In json_parser

headers= {
                "Authorization": "************",
                "Connection": "keep-alive" 
          }

DOCKER

docker build -t taiwotman/smart-traffic:latest .

docker run --rm -p 80:5000 taiwotman/smart-traffic:latest 

Open on browser

AWS EKS

kubectl apply -f aws_eks/deployment.yaml 

smart-traffic-service deployment.apps/smart-traffic created

http://localhost:8080/api/v1/namespaces/default/services/smart-traffic-service/proxy

Delete cluster

eksctl delete cluster --region=us-east-2 --name=smart-cluster

GCP

 gcloud app deploy

PS: deploy might take few minutes

Likely issues

  1. if error on starting, reinitialize project using:

    gcloud app init

  2. ERROR: (gcloud.app.deploy) INVALID_ARGUMENT: unable to resolve source

    Go to storage bucket and delete app storage. Then redeploy app.

  3. Latency - Takes an average of 1 min to return predictions on the local environment.

  4. No results return- Obtain authorization key

ACKNOWLEDGEMENTS

So much gratitude to New South Wales Transport Agency for the open live traffic data API and Google for the Tensorflow. Without opensource contributions this work would not have been derived.

WANT TO BE CONTRIBUTOR?

  1. Fork repository

    and/or

  2. Send a message.

FOR ACADEMIC PURPOSE; kindly, cite our related work:

T. Adetiloye, A. Awasthi (2019). Multimodal Big Data Fusion for Traffic Congestion Prediction. In: Seng K., Ang L., Liew AC., Gao J. (eds) Multimodal Analytics for Next-Generation Big Data Technologies and Applications(pg. 319-335). doi: https://doi.org/10.1007/978-3-319-97598-6_13. Springer, Cham.

T. Adetiloye, A. Awasthi (2018). Traffic Condition Monitoring Using Social Media Analytics. In: Roy, S., Samui, P., Deo, R., Ntalampiras, S. (eds) Big Data in Engineering Applications. Studies in Big Data, vol 44. Springer, Singapore. https://doi.org/10.1007/978-981-10-8476-8_13

T. Adetiloye, A. Awasthi(2017). Predicting Short-Term Congested Traffic Flow on Urban Motorway Networks. In P. Samui, S.S Roy, V.E. Balas(Eds.), Handbook of Neural Computation(pg. 145–165). doi: https://doi.org/10.1016/B978-0-12-811318-9.00008-9. Academic Press.

LICENSE

T. Adetiloye (2021). Predicting Short-Term Traffic Flow Congestion On Urban Motorway Networks (Patent No US11,195,412 B2). U.S. Patent and Trademark Office. https://rb.gy/yaonm9

smart-traffic's People

Contributors

karthikaskumar avatar taiwotman avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar

smart-traffic's Issues

Need help

Excuse, could you detail the process of training?
Here are some photo I use to predict, as you could see, it is some wrong。
Capture
I think may it is the problem of train set.
So please, please, please give me a hand. : )

Training Dataset and Script

Hi @taiwotman , I am working on a similar project and would love to contribute to this project. Would you able to provide training dataset and script that your DL model is trained on? It would be really helpful for my project.

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.