Git Product home page Git Product logo

helmet-detection's Introduction

Helmet Detection Algorithm

This repository contains code for training and using a helmet detection algorithm using YOLOv7.

Dataset

The dataset used for training the algorithm is not included in this repository. You can use your own dataset or download a helmet detection dataset from https://www.kaggle.com/datasets/andrewmvd/helmet-detection

Setup

To set up the environment for running the algorithm, follow these steps:

  1. Clone this repository: git clone https://github.com/Jawabreh0/Helmet-Detection.

  2. Navigate to the cloned repository: cd Helmet-Detection.

  3. Download the YOLOv7 weights: wget https://github.com/WongKinYiu/yolov7/releases/download/v0.1/yolov7.pt.

  4. Download the YOLOv7x weights: wget https://github.com/WongKinYiu/yolov7/releases/download/v0.1/yolov7x.pt.

  5. Install the required packages: pip install -r requirements.txt.

Training

To train the algorithm, run the following command:

python train.py --data data.yaml --cfg models/custom_yolov7.yaml --weights yolov7.pt

You can adjust the batch size, number of epochs, and other parameters by modifying the command above.

Inference

To detect helmets in an image, run the following command:

python detect.py --weights runs/train/exp/weights/best.pt --img 640 --conf 0.4 --source path/to/image.jpg

This will output an image with bounding boxes around the detected helmets.

Results

The trained model achieved an average precision of 0.85 on the test set.

License

This project is licensed under the MIT License

helmet-detection's People

Contributors

jawabreh0 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.