car-accident-yolo
Science Score: 44.0%
This score indicates how likely this project is to be science-related based on various indicators:
-
✓CITATION.cff file
Found CITATION.cff file -
✓codemeta.json file
Found codemeta.json file -
✓.zenodo.json file
Found .zenodo.json file -
○DOI references
-
○Academic publication links
-
○Academic email domains
-
○Institutional organization owner
-
○JOSS paper metadata
-
○Scientific vocabulary similarity
Low similarity (14.6%) to scientific vocabulary
Repository
Basic Info
- Host: GitHub
- Owner: M-ArslanArshad
- License: other
- Language: Python
- Default Branch: main
- Size: 3.56 MB
Statistics
- Stars: 0
- Watchers: 0
- Forks: 0
- Open Issues: 5
- Releases: 0
Metadata Files
README.md
🚗 Car Accident Detection and Deformation Classification Using YOLOv5
This project uses YOLOv5 to detect car accidents from images and classify the severity of damage into five categories based on visual deformation. The model is trained on a custom annotated dataset of real-world car accidents.
📂 Dataset Structure
The dataset contains two main folders: images/ and labels/, each with train/ and val/ subfolders:
dataset/
├── images/
│ ├── train/
│ └── val/
├── labels/
│ ├── train/
│ └── val/
Each .txt label file follows YOLO format:
<class_id> <x_center> <y_center> <width> <height> (all normalized)
Example:
4 0.560967 0.598094 0.829009 0.629283
🏷️ Class Labels
| Class ID | Description | Estimated Deformity | |----------|--------------------------|----------------------| | 0 | No Accident | 0% | | 1 | Minor Accident | ~30% | | 2 | Moderate Accident | ~50% | | 3 | Severe Accident | ~70% | | 4 | Totaled Vehicle | ~100% (on fire, flipped, crushed) |
🛠️ Model Training
- Base Model: YOLOv5 (
s,m,las needed) - Framework: PyTorch
- Training Image Size: 640x640
- Batch Size: 16
- Best Weights:
weights/best.pt
🔧 Training Command
bash
python train.py --img 640 --batch 16 --epochs 100 \
--data dataset.yaml --weights yolov5s.pt --name accident_detector
🔍 Inference Example
bash
python detect.py --weights weights/best.pt --img 640 --source data/test_image.jpg
Output will be saved in the runs/detect/ folder.
📈 Results
Sample detections and training performance plots are included in the results/ directory. Add your visuals here to showcase model performance.
📦 Dataset Collection
The dataset was collected using frames extracted from publicly available online videos (YouTube, Facebook, etc.). A Python script was used to extract frames, followed by manual annotation of bounding boxes and classification into five deformity levels based on visual inspection. please download the dataset : https://www.kaggle.com/datasets/marslanarshad/car-accidents-and-deformation-datasetannotated after downloading dataset please update the paths in custom.yaml:
📚 Requirements
bash
pip install -r requirements.txt
Dependencies include: - torch - torchvision - opencv-python - numpy - matplotlib - PyYAML
📁 Repo Contents
weights/last.pt– Trained YOLOv5 weightsdataset.yaml– Training configimages/,labels/– Dataset directoriesdetect.py,train.py– Inference and training scriptsresults/– Inference outputsREADME.md– Project documentation
📜 License
Open for academic and non-commercial use. If you reuse this dataset or model, please give credit to the original source.
👤 Author
Developed by Muhammad Arslan Arshad
Custom YOLOv5 model for accident detection and deformation severity classification.
Owner
- Name: Muhammad Arslan Arshad
- Login: M-ArslanArshad
- Kind: user
- Location: Lahore ,Pakistan
- Company: University of Engineering and Technology, Lahore
- Repositories: 1
- Profile: https://github.com/M-ArslanArshad
AI/ML enthusiast
Citation (CITATION.cff)
cff-version: 1.2.0
preferred-citation:
type: software
message: If you use YOLOv5, please cite it as below.
authors:
- family-names: Jocher
given-names: Glenn
orcid: "https://orcid.org/0000-0001-5950-6979"
title: "YOLOv5 by Ultralytics"
version: 7.0
doi: 10.5281/zenodo.3908559
date-released: 2020-5-29
license: AGPL-3.0
url: "https://github.com/ultralytics/yolov5"
GitHub Events
Total
- Delete event: 1
- Issue comment event: 9
- Push event: 2
- Pull request event: 6
- Create event: 7
Last Year
- Delete event: 1
- Issue comment event: 9
- Push event: 2
- Pull request event: 6
- Create event: 7
Dependencies
- actions/checkout v3 composite
- actions/setup-python v4 composite
- slackapi/slack-github-action v1.24.0 composite
- actions/checkout v3 composite
- github/codeql-action/analyze v2 composite
- github/codeql-action/autobuild v2 composite
- github/codeql-action/init v2 composite
- actions/checkout v3 composite
- docker/build-push-action v4 composite
- docker/login-action v2 composite
- docker/setup-buildx-action v2 composite
- docker/setup-qemu-action v2 composite
- actions/first-interaction v1 composite
- actions/checkout v3 composite
- nick-invision/retry v2 composite
- actions/stale v8 composite
- actions/checkout v3 composite
- actions/setup-node v3 composite
- dephraiim/translate-readme main composite
- pytorch/pytorch 2.0.0-cuda11.7-cudnn8-runtime build
- gcr.io/google-appengine/python latest build
- oidsha256 *
- size1562 *
- oidsha256 *
- size187 *