{"id":16199732,"url":"https://github.com/zhiyiyo/face-mask-detector","last_synced_at":"2026-02-28T11:06:52.020Z","repository":{"id":112585279,"uuid":"545324264","full_name":"zhiyiYo/Face-Mask-Detector","owner":"zhiyiYo","description":"A face mask detector based on STM32F103ZET6 and Yolov4.","archived":false,"fork":false,"pushed_at":"2023-03-28T03:40:25.000Z","size":15452,"stargazers_count":19,"open_issues_count":0,"forks_count":1,"subscribers_count":2,"default_branch":"master","last_synced_at":"2025-03-17T04:05:54.185Z","etag":null,"topics":["facemask-detection","pyqt5","stm32","yolov4"],"latest_commit_sha":null,"homepage":"","language":"C","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"gpl-3.0","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/zhiyiYo.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","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,"publiccode":null,"codemeta":null}},"created_at":"2022-10-04T06:59:01.000Z","updated_at":"2025-03-03T15:34:04.000Z","dependencies_parsed_at":null,"dependency_job_id":"f2104f02-87a0-4104-99a0-625c727639ec","html_url":"https://github.com/zhiyiYo/Face-Mask-Detector","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhiyiYo%2FFace-Mask-Detector","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhiyiYo%2FFace-Mask-Detector/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhiyiYo%2FFace-Mask-Detector/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/zhiyiYo%2FFace-Mask-Detector/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/zhiyiYo","download_url":"https://codeload.github.com/zhiyiYo/Face-Mask-Detector/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":244364685,"owners_count":20441458,"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":["facemask-detection","pyqt5","stm32","yolov4"],"created_at":"2024-10-10T09:27:39.290Z","updated_at":"2026-02-28T11:06:46.979Z","avatar_url":"https://github.com/zhiyiYo.png","language":"C","funding_links":[],"categories":[],"sub_categories":[],"readme":"# Face-Mask-Detector\nA face mask detector based on STM32F103ZET6 and Yolov4.\n\n\n## Interface\n![app](./doc/image/screenshot.png)\n\n\n## Compile and Load\nYou should install `arm-none-eabi-gcc` to compile this project.\n\n```sh\ncd stm32\nmake update\n```\n\n\n## Build Environment\n1. Create virtual environment:\n\n    ```shell\n    conda create -n Face_Mask_Detector python=3.8\n    conda activate Face_Mask_Detector\n    pip install -r requirements.txt\n    ```\n\n2. Install [PyTorch](https://pytorch.org/), refer to the [blog](https://blog.csdn.net/qq_23013309/article/details/103965619) for details.\n\n\n## Train\n1. Download face mask dataset from [kaggle](https://www.kaggle.com/datasets/zhiyiyo/face-mask-dataset) and unzip it.\n\n2. Download pre-trained `CSPDarknet53.pth` model from [Google Drive](https://drive.google.com/file/d/12oV8QL937S1JWFQhzLNPoqyYc_bi0lWT/view?usp=sharing).\n\n3. Modify the value of `root` in `train.py`, please ensure that the directory structure of the `root` folder is as follows:\n\n    ```txt\n    root\n    ├───Annotations\n    ├───ImageSets\n    │   ├───Layout\n    │   ├───Main\n    │   └───Segmentation\n    ├───JPEGImages\n    ├───SegmentationClass\n    └───SegmentationObject\n    ```\n\n4. start training:\n\n    ```sh\n    conda activate Face_Mask_Detector\n    python train.py\n    ```\n\n## Evaluation\n### one model\n1. Modify the value of `root` and `model_path` in `eval.py`.\n2. Calculate mAP:\n\n    ```sh\n    conda activate Face_Mask_Detector\n    python eval.py\n    ```\n\n### multi models\n1. Modify the value of `root` and `model_dir` in `evals.py`.\n2. Calculate and plot mAP:\n\n    ```shell\n    conda activate Face_Mask_Detector\n    python evals.py\n    ```\n\n### mAP curve\n![map curve](./doc/image/mAP_%E6%9B%B2%E7%BA%BF.png)\n\n\n## Detection\n1. Modify the `model_path` and `image_path` in `demo.py`.\n\n2. Display detection results:\n\n    ```shell\n    conda activate Face_Mask_Detector\n    python demo.py\n    ```\n\n\n\n## License\nFace-Mask-Detector is licensed under [GPLv3](./LICENSE).\n\nCopyright © 2021 by zhiyiYo.","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhiyiyo%2Fface-mask-detector","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fzhiyiyo%2Fface-mask-detector","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fzhiyiyo%2Fface-mask-detector/lists"}