Code Monkey home page Code Monkey logo

face-mask-detection's Introduction

Face Mask Detection

In this project I trained, evaluated, and used YOLOv7 on images and videos to detect faces and classify if they're wearing face masks or not, not only that, the model can tell if a face mask is not worn correctly.

Dataset

The dataset contains 853 images belonging to 3 classes:

  • with_mask
  • without_mask
  • mask_weared_incorrect

Download Dataset

Trained Model

Download Trained Model

Code

All preprocessing, training, evaluation, and inference code and details are provided in the notebook above (Face_Mask_Detection.ipynb)

Inference

To use the model on your own data, follow these steps:

  • Download the trained model from here
  • Clone YOLOv7 repository and install the requirements
git clone https://github.com/WongKinYiu/yolov7.git
pip install -r yolov7/requirements.txt
  • Run inference script and modify these parameters according to your data

--source : path to image/video

--weight : path to the trained model

--conf : confidence threshold, the trained model's optimal threshold is 0.26

--name : path to a folder to save results in

python ./yolov7/detect.py --source ./yolov7/data/test/images --weight ./runs/train/yolov7x_results8/weights/best.pt --conf 0.26 --name test_images

๐Ÿ”— Contact me

Email Linkedin

face-mask-detection's People

Contributors

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