{"id":20046743,"url":"https://github.com/harshit-saraswat/face-mask-detection","last_synced_at":"2026-04-20T04:05:04.855Z","repository":{"id":228032184,"uuid":"282233119","full_name":"harshit-saraswat/Face-Mask-Detection","owner":"harshit-saraswat","description":"This is a Computer Vision Project for detection if user is wearing face mask or not","archived":false,"fork":false,"pushed_at":"2020-08-09T15:50:04.000Z","size":17192,"stargazers_count":1,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-03-02T08:14:37.249Z","etag":null,"topics":["cnn","computer-vision","deep-learning","face-detection","face-mask-detection","machine-learning","ml","python","transfer-learning"],"latest_commit_sha":null,"homepage":"","language":"Python","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":null,"status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/harshit-saraswat.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":null,"code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2020-07-24T13:55:10.000Z","updated_at":"2022-03-30T03:05:14.000Z","dependencies_parsed_at":"2024-03-16T14:44:20.209Z","dependency_job_id":"2af5daa2-bc9a-447a-9e51-260f460397ee","html_url":"https://github.com/harshit-saraswat/Face-Mask-Detection","commit_stats":null,"previous_names":["harshit-saraswat/face-mask-detection"],"tags_count":0,"template":false,"template_full_name":null,"purl":"pkg:github/harshit-saraswat/Face-Mask-Detection","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harshit-saraswat%2FFace-Mask-Detection","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harshit-saraswat%2FFace-Mask-Detection/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harshit-saraswat%2FFace-Mask-Detection/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harshit-saraswat%2FFace-Mask-Detection/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/harshit-saraswat","download_url":"https://codeload.github.com/harshit-saraswat/Face-Mask-Detection/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/harshit-saraswat%2FFace-Mask-Detection/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273846970,"owners_count":25178628,"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","status":"online","status_checked_at":"2025-09-05T02:00:09.113Z","response_time":402,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"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":["cnn","computer-vision","deep-learning","face-detection","face-mask-detection","machine-learning","ml","python","transfer-learning"],"created_at":"2024-11-13T11:29:04.209Z","updated_at":"2025-10-25T06:47:32.111Z","avatar_url":"https://github.com/harshit-saraswat.png","language":"Python","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Face-Mask-Detection\nThis is a Computer Vision Project for detection if user is wearing face mask or not.\n\nThis is a Computer Vision Project which served as one part of my Final Year Project- \u003cstrong\u003e Implementation of Face Detection and Object Tracking Techniques to Develop Covid19 Utilities for Face Mask Detection and Social Distancing Violations Detection \u003c/strong\u003e\n\nThe project features use of Transfer Learning to save time.\n\n# Dataset Used:\nFor the dataset we used [Prajna](https://github.com/prajnasb)'s Face Mask Detection Dataset and Experiments.\n\nHere dataset looked like this:-\n\n## With Mask:\n\u003cimg alt=\"prajna-withmask-image\" src=\"images/prajnaWithMask.png\"\u003e\n\n## Without Mask:\n\u003cimg alt=\"prajna-withmask-image\" src=\"images/prajnaWithoutMask.png\"\u003e\n\nAs we can see what she did is to scrape images online and then augment those images by putting a face mask png on top of original images and then using these images.\n\nSince this isn't a good methodology, I scraped a few more images and added to her dataset. The images I scraped included images of people with mask as well in different color masks too.\n\n## Data Preparation:\nFor preparing the data I first enhanced the images and then used a face detection algorithm to crop out only face part from the images inorder to reduce the image noise and to make sure the model focusses only on the face part and nothing else.\n\nAlso it should be noted that, we could've gone with grayscale images but I used a Resnet50 based architecture from Google's Teachable Machine 2.0 for model creation and it works with colored images better in this case. Though we could have tried other models for better results.\n\nAfter preparation my dataset looks like this:-\n\n### Final Dataset With Mask:\n\u003cimg alt=\"final-withmask-image\" src=\"images/myWithMask.png\"\u003e\n\n### Final Dataset Without Mask:\n\u003cimg alt=\"final-withoutmask-image\" src=\"images/myWithoutMask.png\"\u003e\n\n# Methodology Used\n## Face Mask Detection Use Case:\n\u003cimg alt=\"usecase-image\" src=\"images/Face Mask Detection Usecase.png\"\u003e\n\n## Face Mask Detection Architecture:\n\u003cimg alt=\"architecture-image\" src=\"images/Face Mask Detection.png\"\u003e\n\n## Face Mask Detection Flow Chart:\n\u003cimg alt=\"flowchart-image\" src=\"images/Face Mask Detection Flow Chart.png\"\u003e\n\n## Face Mask Detection Module Heirarchy Diagram:\n\u003cimg alt=\"module-hierarchy-image\" src=\"images/Face Mask Module Hierarchy.png\"\u003e\n\n# Model Results: \n## Face Mask Detection Model Training Summary:\n\u003cimg alt=\"model-training-image\" src=\"images/FaceMask.png\"\u003e\n\n## Face Mask Detection Model Classification Report:\n\u003cimg alt=\"model-report-image\" src=\"images/Face Mask Report.png\"\u003e\n\n# Outputs:\n## No Mask Output: \n\u003cimg alt=\"no-mask-image\" src=\"images/No Mask.jpg\"\u003e\n\n## With Mask Output: \n\u003cimg alt=\"with-mask-image\" src=\"images/With Mask.jpg\"\u003e\n\n## Failures:\n\u003cimg alt=\"failures-image\" src=\"images/Failures Face Mask.jpg\"\u003e\n\n# To Do:\n\n1. Add Pipelines\n2. Model Retraining Support\n3. UI Interface\n4. Accuracy/Precision/Recall Improvement\n5. Deployment\n6. Requirements and project documentation\n\n# Inspiration:\nIn this time of pandemic struck world, I had to do my part as an AI/ML engineer to develop something which can actually be used. Though this project is far from over, but it's the start of something. Later I was able to mentor a team in a hackathon on a similar problem statement as my final year project and this starting guide/code helped them a lot, so it's probably a win - win situation.\n\n# Acknowledgements:\nA special thanks to [Adrian Rosebrock](https://github.com/jrosebr1) and his blog at [PyImageSearch](https://www.pyimagesearch.com/) for helping out with this project.\n\nAlso thanks to many other github contributors who've worked on similar projects. Thanks for your repos and guidance.\n\nAlso a shoutout to [Prajna](https://github.com/prajnasb) for your experiments!\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharshit-saraswat%2Fface-mask-detection","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fharshit-saraswat%2Fface-mask-detection","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fharshit-saraswat%2Fface-mask-detection/lists"}