{"id":14958921,"url":"https://github.com/taiwotman/smart-traffic","last_synced_at":"2025-05-02T13:30:32.728Z","repository":{"id":42078085,"uuid":"123148281","full_name":"taiwotman/Smart-Traffic","owner":"taiwotman","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 prediction over time.","archived":false,"fork":false,"pushed_at":"2022-12-11T13:34:40.000Z","size":163270,"stargazers_count":46,"open_issues_count":0,"forks_count":24,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-04-07T02:09:00.936Z","etag":null,"topics":["congestion","highway","machine-learning","prediction","tensorflow","tensorflow-experiments","traffic"],"latest_commit_sha":null,"homepage":"https://hub.docker.com/r/taiwotman/smart-traffic","language":"HTML","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"other","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/taiwotman.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-02-27T15:25:08.000Z","updated_at":"2025-03-30T06:35:09.000Z","dependencies_parsed_at":"2023-01-27T00:15:29.147Z","dependency_job_id":null,"html_url":"https://github.com/taiwotman/Smart-Traffic","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taiwotman%2FSmart-Traffic","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taiwotman%2FSmart-Traffic/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taiwotman%2FSmart-Traffic/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/taiwotman%2FSmart-Traffic/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/taiwotman","download_url":"https://codeload.github.com/taiwotman/Smart-Traffic/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":252045995,"owners_count":21685932,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["congestion","highway","machine-learning","prediction","tensorflow","tensorflow-experiments","traffic"],"created_at":"2024-09-24T13:18:32.158Z","updated_at":"2025-05-02T13:30:27.719Z","avatar_url":"https://github.com/taiwotman.png","language":"HTML","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Predicting Short-Term Traffic Flow Congestion On Urban Motorway Networks\n\n## DESCRIPTION \n\u003cp align=\"center\"\u003e \n \u003cimg width=\"200\" height=\"200\" src=\"https://github.com/taiwotman/TensorflowPredictCongestionTypes/blob/master/miscellanous/smart-traffic.png\"\u003e\u003c/p\u003e\n \u003cp align=\"center\"\u003e\n\u003cimg width=\"200\" height=\"200\" src=\"https://github.com/taiwotman/TensorflowPredictCongestionTypes/blob/master/miscellanous/high-congestion.png\"\u003e\n \u003cimg width=\"200\" height=\"200\" src=\"https://github.com/taiwotman/TensorflowPredictCongestionTypes/blob/master/miscellanous/medium-congestion.png\"\u003e\n \u003cimg width=\"200\" height=\"200\" src=\"https://github.com/taiwotman/TensorflowPredictCongestionTypes/blob/master/miscellanous/low-congestion.png\"\u003e\n\u003c/p\u003e\n\n\u003cp align=\"justify\"\u003e\nA 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.\n\u003c/p\u003e\n\n* Read the [WhitePaper](https://github.com/taiwotman/Smart-Traffic/blob/master/miscellanous/Whitepaper.pdf)\n* View the [Slide Deck](https://docs.google.com/presentation/d/1ecyTVmE2eLL8S8tCIGs8JBKw0EEAsHAqw2U0Yq0A_Ns/edit?usp=sharing)\n\n### Dependencies\n![Python](https://img.shields.io/badge/Python-v3.7-blue.svg?logo=python\u0026longCache=true\u0026logoColor=white\u0026colorB=5e81ac\u0026style=flat-square\u0026colorA=4c566a)\n![Tensorflow](https://img.shields.io/badge/Tensorflow-v2.5.0rc0-blue.svg?longCache=true\u0026logo=python\u0026style=flat-square\u0026logoColor=white\u0026colorB=5e81ac\u0026colorA=4c566a)\n![Flask](https://img.shields.io/badge/Flask-v2.0.2-blue.svg?longCache=true\u0026logo=flask\u0026style=flat-square\u0026logoColor=white\u0026colorB=5e81ac\u0026colorA=4c566a)\n![Urllib3](https://img.shields.io/badge/Urllib3-v1.24.3-blue.svg?longCache=true\u0026logo=python\u0026style=flat-square\u0026logoColor=white\u0026colorB=5e81ac\u0026colorA=4c566a)\n![Numpy](https://img.shields.io/badge/Numpy-v1.13.3-blue.svg?longCache=true\u0026logo=python\u0026style=flat-square\u0026logoColor=white\u0026colorB=5e81ac\u0026colorA=4c566a)\n![WTForms](https://img.shields.io/badge/WTForms-v2.1-blue.svg?longCache=true\u0026logo=python\u0026style=flat-square\u0026logoColor=white\u0026colorB=5e81ac\u0026colorA=4c566a)\n![Werkzeug](https://img.shields.io/badge/Werkzeug-v0.7-blue.svg?longCache=true\u0026logo=python\u0026style=flat-square\u0026logoColor=white\u0026colorB=5e81ac\u0026colorA=4c566a)\n\n\n\n### REPOSITORY\n\n**RELEASE VERSION  1.1.0**\n\n- Create Flask REST API using (real-time) traffic image  data for prediction.\n\n- Implement search query based on region\n      \n- Make Jinja template to display parameters on index.page \n\n- On Index page, display traffic images with URL and add dropdown selections with regions\n\n- Clean template\n      \n- Add Prediction features\n\n\n## SET UP\n### LOCAL ENVIRONMENT\n\n**1. Clone git repository and `cd` into the directory**\n\n     git clone https://github.com/taiwotman/Smart-Traffic.git\n\n**2. Set up [virtualenv](https://virtualenv.pypa.io/en/stable/) with directory _venv_** \n\n     virtualenv venv\n\n**3. Activate _venv_ using:**\n\n     source venv/bin/activate\n\n**4. Pip install requirements:**\n\n     pip install -r requirements.txt\n \n**5. Run command**\n     \n     python run.py\n\n__Sample Test Case__\n\n\u003cp align=\"center\"\u003e\n \u003cimg width=\"500\" height=\"500\" src=\"https://github.com/taiwotman/Smart-Traffic/blob/master/miscellanous/Architecture%20of%20real-time%20prediction.png\"\u003e\n\u003c/p\u003e\n\n**6. To implement the following test, use the [development branch](https://github.com/taiwotman/Smart-Traffic/tree/development).**\n\n**7. Run the following python command with the  traffic congestion image(supports only jpeg/jpg format) as argument. For example:**\n\n     python run.py test_image/Aut10_010.jpg\n     \n**8. Sample output:**\n\n     high congestion (score = 0.70454)\n\n\n\n### AUTHORIZATION HEADER\n\n***In json_parser***\n\n    headers= {\n                    \"Authorization\": \"************\",\n                    \"Connection\": \"keep-alive\" \n              }\n      \n### DOCKER\n\n    docker build -t taiwotman/smart-traffic:latest .\n\n    docker run --rm -p 80:5000 taiwotman/smart-traffic:latest \n\nOpen on [browser](https://localhost:80)\n\n### AWS EKS\n\n    kubectl apply -f aws_eks/deployment.yaml \n\nsmart-traffic-service  deployment.apps/smart-traffic created\n\nhttp://localhost:8080/api/v1/namespaces/default/services/smart-traffic-service/proxy\n\nDelete cluster\n\n    eksctl delete cluster --region=us-east-2 --name=smart-cluster\n\n\n### GCP\n\n     gcloud app deploy\n\n**PS:** _deploy might take few minutes_\n\n### Likely issues\n\n1. if error on starting, reinitialize project using:\n\n     gcloud app init\n\n2. ERROR: (gcloud.app.deploy) INVALID_ARGUMENT: unable to resolve source\n\n   Go to storage bucket and delete app storage. Then redeploy app.\n   \n3. Latency -  Takes an average of 1 min to return predictions on the local environment.\n\n4. No results return- Obtain authorization key\n\n### ACKNOWLEDGEMENTS\n\nSo much gratitude to [New South Wales Transport Agency](www.transport.nsw.gov.au) for the open live traffic data API\nand Google for the [Tensorflow](https://www.tensorflow.org/). \nWithout opensource contributions this work would not have been derived.\n\n\n### WANT TO BE CONTRIBUTOR?\n\n1. Fork repository\n\n     and/or\n\n2. Send a [message](https://taiwotman.github.io/#contact).\n\n**FOR ACADEMIC PURPOSE; kindly, cite our related work:**\n\n T. Adetiloye, A. Awasthi  (2019). Multimodal Big Data Fusion for Traffic Congestion Prediction. \n     In: Seng K., Ang L., Liew   AC., Gao J. (eds) Multimodal Analytics for Next-Generation Big Data Technologies \n     and Applications(pg. 319-335). doi: https://doi.org/10.1007/978-3-319-97598-6_13. Springer, Cham.\n \n T. Adetiloye, A. Awasthi  (2018).  Traffic Condition Monitoring Using Social Media Analytics. \n     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\n \n T. Adetiloye, A. Awasthi(2017). Predicting Short-Term Congested Traffic Flow on Urban Motorway Networks. \n     In P. Samui, S.S Roy, V.E. Balas(Eds.), Handbook of Neural Computation(pg. 145–165).\n     doi: https://doi.org/10.1016/B978-0-12-811318-9.00008-9. Academic Press.\n\n### LICENSE\n\n 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\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaiwotman%2Fsmart-traffic","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Ftaiwotman%2Fsmart-traffic","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Ftaiwotman%2Fsmart-traffic/lists"}