{"id":21235978,"url":"https://github.com/lddl/road-anomaly-detection","last_synced_at":"2026-05-09T16:05:24.914Z","repository":{"id":245459609,"uuid":"818312693","full_name":"LdDl/road-anomaly-detection","owner":"LdDl","description":"Software for registering anomaly situations on roads","archived":false,"fork":false,"pushed_at":"2024-06-26T11:12:47.000Z","size":903,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"master","last_synced_at":"2025-01-21T18:49:14.090Z","etag":null,"topics":["anomaly-detection","computer-vision","multi-object-tracking","object-detection","opencv","road-accidents","yolov7","yolov8"],"latest_commit_sha":null,"homepage":"","language":"Rust","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/LdDl.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.md","code_of_conduct":null,"threat_model":null,"audit":null,"citation":"CITATION.cff","codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null,"publiccode":null,"codemeta":null}},"created_at":"2024-06-21T15:06:27.000Z","updated_at":"2024-06-26T11:12:50.000Z","dependencies_parsed_at":"2024-06-22T07:58:46.647Z","dependency_job_id":null,"html_url":"https://github.com/LdDl/road-anomaly-detection","commit_stats":null,"previous_names":["lddl/road-anomaly-detection"],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LdDl%2Froad-anomaly-detection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LdDl%2Froad-anomaly-detection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LdDl%2Froad-anomaly-detection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/LdDl%2Froad-anomaly-detection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/LdDl","download_url":"https://codeload.github.com/LdDl/road-anomaly-detection/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":243676717,"owners_count":20329432,"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":["anomaly-detection","computer-vision","multi-object-tracking","object-detection","opencv","road-accidents","yolov7","yolov8"],"created_at":"2024-11-21T00:05:28.352Z","updated_at":"2025-10-15T05:13:05.777Z","avatar_url":"https://github.com/LdDl.png","language":"Rust","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Yet another toy utility for registering anomaly situations on roads\n\nIn W.I.P. stage\n\n## Table of Contents\n- [Video showcase](#video-showcase)\n- [About](#about)\n- [How does it work?](#how-does-it-work?)\n- [Installation and usage](#installation-and-usage)\n- [Future works](#future-works)\n- [References](#references)\n- [Support](#support)\n\n## Video showcase\n@w.i.p.\n\n## About\nThis project is aimed to register road traffic accidents, foreign object and other anomaly situations on roads. It is pretty simple and uses just YOLO (both [traditional](https://github.com/AlexeyAB/darknet) and [Ultralytics version](https://github.com/ultralytics/ultralytics) could be used). Some advanced techniques like 3D-CNN, LSTM's and others could be used, but I do not have that much time so PR's are very welcome.\n\nI do have also utility for monitoring road traffic flow parameters [here](https://github.com/LdDl/rust-road-traffic)\n\n## How does it work?\nDiagram could speak more than a thousand words. I'm not digging into the Background Subtraction / Object Detection or MOT (Multi-object tracking) topic since it is not a main target of this project.\n\n\u003cimg src=\"docs/anomaly_detection.drawio.svg\" width=\"720\"\u003e\n\nDiagram is prepared via https://app.diagrams.net/. Source is [here](docs/anomaly_detection.drawio).\n\n## Screenshots\n\nimshow() output:\n\n\u003cimg src=\"docs/screenshot_1.png\" width=\"720\"\u003e\n\nSubscribe channel on the server:\n\n\u003cimg src=\"docs/screenshot_2.png\" width=\"720\"\u003e\n\nWait until event has come:\n\n\u003cimg src=\"docs/screenshot_3-1.png\" height=\"240\" width=\"1080\"\u003e\n\n## Installation and usage\n\n**Important notice**: it has been tested on Ubuntu 22.04.3 LTS only!\n\nIt is needed to compile it via Rust programming language compiler (here is docs: https://www.rust-lang.org/learn/get-started) currently. If further I'll make a Dockerfile for CPU atleast and may be for GPU/CUDA.\n\nCompilation from source code:\n```shell\ngit clone https://github.com/LdDl/road-anomaly-detection\ncd road-anomaly-detection\ncargo build --release\n```\n\nPrepare neural network for detecting anomaly events.\n\nPrepare configuration file. Example could be found here - [data/conf.toml](data/conf.toml). In my example I use YOLOv8 trained on just two classes: \"moderate_accident\", \"severe_accident\".\n\nRun:\n```\nexport ROAD_ANOMALY_CONFIG=$(pwd)/data/conf.toml\n./target/release/road-anomaly-detector $ROAD_ANOMALY_CONFIG\n```\n\nWhen events published into to the reciever server than you can expect following JSON structure:\n```json\n{\n    \"id\": \"Event identifier represented as UUID v4\",\n    \"event_registered_at\": UTC UnixTimestamp when event has been registered,\n    \"event_image\": \"base64 representation of an image\",\n    \"object_id\": \"Detection identifier. Most of time would be represented as UUID v4\",\n    \"object_registered_at\": UTC UnixTimestamp when detection has been registered,\n    \"object_lifetime\": Number of second while the detection was considered \"relevant\",\n    \"object_bbox\": {\n        \"x\": X-coordinate of the left top of the detection,\n        \"y\": Y-coordinate of the left top of the detection,\n        \"width\": Width of the corresponding detection bounding box,\n        \"height\": Height of the corresponding detection bounding box\n    },\n    \"object_poi\": {\n        \"x\": X-coordinate of the center of the detection bounding box,\n        \"y\": Y-coordinate of the center of the detection bounding box\n    },\n    \"object_classname\": \"Label for the class\",\n    \"object_confidence\": Confidence that detection is classified as corresponding class label,\n    \"zone_id\": \"Unique identifier for zone of interests\",\n    \"equipment_id\": \"Optional application name (could be considered as equipment identifier for embedded devices)\"\n}\n```\n\n## Future works\n* Make REST API to extract and to mutate configuration;\n* Make MJPEG export;\n* Make publishing to custom REST API via POST request;\n* Prepare some pre-trained neural networks;\n\n## References\n* MOG2 - https://docs.opencv.org/4.x/d1/dc5/tutorial_background_subtraction.html\n* MOT (Multi-object tracking) in Rust programming language - https://github.com/LdDl/mot-rs\n* OpenCV's bindings - https://github.com/twistedfall/opencv-rust\n* Object detection in Rust programming language via YOLO - https://github.com/LdDl/object-detection-opencv-rust\n* YOLO v3 paper - https://arxiv.org/abs/1804.02767, Joseph Redmon, Ali Farhadi\n* YOLO v4 paper - https://arxiv.org/abs/2004.10934, Alexey Bochkovskiy, Chien-Yao Wang, Hong-Yuan Mark Liao\n* YOLO v7 paper - https://arxiv.org/abs/2207.02696, Chien-Yao Wang, Alexey Bochkovskiy, Hong-Yuan Mark Liao\n* Original Darknet YOLO repository - https://github.com/pjreddie/darknet\n* Most popular fork of Darknet YOLO - https://github.com/AlexeyAB/darknet\n* Developers of YOLOv8 - https://github.com/ultralytics/ultralytics. If you are aware of some original papers for YOLOv8 architecture, please contact me to mention it in this README.\n\nVideo example has been taken from [here](https://www.youtube.com/watch?v=z60Y20kJSmc)\n\nPlease cite this repository if you are using it\n\n## Support\nIf you have troubles or questions please [open an issue](https://github.com/LdDl/road-anomaly-detection/issues/new).","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flddl%2Froad-anomaly-detection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Flddl%2Froad-anomaly-detection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Flddl%2Froad-anomaly-detection/lists"}