{"id":23102835,"url":"https://github.com/dataxujing/diou_yolo_v3","last_synced_at":"2025-09-21T16:27:18.372Z","repository":{"id":112305136,"uuid":"229074069","full_name":"DataXujing/DIoU_YOLO_V3","owner":"DataXujing","description":":chart_with_upwards_trend::chart_with_upwards_trend::chart_with_upwards_trend:【口罩佩戴检测数据训练 | 开源口罩检测数据集和预训练模型】Train D/CIoU_YOLO_V3 by darknet for object detection","archived":false,"fork":false,"pushed_at":"2020-04-03T02:55:09.000Z","size":28876,"stargazers_count":58,"open_issues_count":4,"forks_count":17,"subscribers_count":2,"default_branch":"FaceMask","last_synced_at":"2025-08-16T15:41:12.770Z","etag":null,"topics":["c","ciou","cv","darknet","diou","object-detection","yolov3"],"latest_commit_sha":null,"homepage":"","language":"Jupyter Notebook","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/DataXujing.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":"2019-12-19T14:42:19.000Z","updated_at":"2024-07-30T06:50:48.000Z","dependencies_parsed_at":"2023-05-12T14:31:01.989Z","dependency_job_id":null,"html_url":"https://github.com/DataXujing/DIoU_YOLO_V3","commit_stats":null,"previous_names":[],"tags_count":1,"template":false,"template_full_name":null,"purl":"pkg:github/DataXujing/DIoU_YOLO_V3","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DataXujing%2FDIoU_YOLO_V3","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DataXujing%2FDIoU_YOLO_V3/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DataXujing%2FDIoU_YOLO_V3/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DataXujing%2FDIoU_YOLO_V3/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/DataXujing","download_url":"https://codeload.github.com/DataXujing/DIoU_YOLO_V3/tar.gz/refs/heads/FaceMask","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/DataXujing%2FDIoU_YOLO_V3/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":273986614,"owners_count":25202704,"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-06T02:00:13.247Z","response_time":2576,"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":["c","ciou","cv","darknet","diou","object-detection","yolov3"],"created_at":"2024-12-17T00:00:32.698Z","updated_at":"2025-09-21T16:27:13.328Z","avatar_url":"https://github.com/DataXujing.png","language":"Jupyter Notebook","funding_links":[],"categories":[],"sub_categories":[],"readme":"## [DIoU-Darknet](https://github.com/Zzh-tju/DIoU-darknet) 口罩佩戴检测\n\n## 提供整理的开源口罩佩戴检测数据集的下载！！！\n\n+ 预训练的模型： \u003chttps://github.com/DataXujing/DIoU_YOLO_V3/releases/tag/Mask_model\u003e 可下载在网上找图像或视频测试！\n+ 训练数据下载地址：百度云盘链接： \u003chttps://pan.baidu.com/s/1J8SwsZ9F5XFbUlHpEVQK3A\u003e  提取码：h9sl\n\n## 检测效果 **好于**[AIZOO](https://aizoo.com/face-mask-detection.html) \u003chttps://aizoo.com/face-mask-detection.html\u003e\n\n## 检测效果 **好于**[百度开源口罩检测](https://www.paddlepaddle.org.cn/hub/scene/maskdetect) \u003chttps://www.paddlepaddle.org.cn/hub/scene/maskdetect\u003e\n\n\u003e YOLOv3 with DIoU and CIoU losses implemented in Darknet\n\n[[arxiv](https://arxiv.org/abs/1911.08287)] [[pdf](https://arxiv.org/pdf/1911.08287.pdf)]\n\n**Xu Jing**\n\n**DEMO**\n\n![](test_res/predictions.jpg)\n![](test_res/predictions3.jpg)\n![](test_res/predictions4.jpg)\n![](test_res/predictions5.jpg)\n![](test_res/predictions6.jpg)\n![](test_res/predictions7.jpg)\n![](test_res/predictions8.jpg)\n![](test_res/predictions9.jpg)\n![](test_res/predictions10.jpg)\n\n相同图片基于AIZOO开源的检测效果:\n\n![](test_res/AIZoo1.jpg)\n![](test_res/AIZ002.jpg)\n![](test_res/AIZoo3.jpg)\n\n\n\n配置和训练过程以darknet版YOLO v3和Gaussian YOLO v3的配置训练过程相似，这里以Ubuntu为例，关于Windows下的配置和生成过程，具体可以联系[**DataXujing**](https://github.com/DataXujing)\n\n### 1.修改Makefile并make\n\n```shell\nGPU=1 #如果使用GPU设置为1，CPU设置为0\nCUDNN=1  #如果使用CUDNN设置为1，否则为0\nOPENCV=1 #如果调用摄像头，还需要设置OPENCV为1，否则为0\nOPENMP=1  #如果使用OPENMP设置为1，否则为0\nDEBUG=0  #如果使用DEBUG设置为1，否则为0\n```\n\n```shell\nmake\n```\n\n\n### 2.数据来源\n\n+ 1. [AIZOO](https://aizoo.com/face-mask-detection.html)\u003chttps://aizoo.com/face-mask-detection.html\u003e\n\n+ 2. 知乎：阿扣是谁哇 \u003chttps://zhuanlan.zhihu.com/p/103922982?utm_source=wechat_session\u003e\n\n+ 3. 个人爬取的部分数据及标注，标注工具使用了[LabelImg](https://github.com/tzutalin/labelImg)\n\n数据整理成VOC格式的数据，最终数据为8565张图像，由于存储空间问题，如果开发者需要改数据，请通过个人GitHub主页公布的邮箱索要。\n\n将数据存放在`data/myData`下\n\n### 3.配置文件\n\n+ (1).Losses\n\n目前支持的损失：`[iou|giou|diou|ciou|mse]`\n\n```\niou_loss=ciou\n```\n+ (2).Normalizers\n\nLocation和Claffication损失之间的Normalize,`cls_normalizer` 和`iou_normalizer` 默认都是`1.0`,但在DIoU探索中发现，下面的配置比较好：\n\n```\niou_loss=diou\ncls_normalizer=1\niou_normalizer=1.0\n```\n```\niou_loss=ciou\ncls_normalizer=1\niou_normalizer=0.5\n```\n\n+ (3).DIoU-NMS\n\n\n在`nms_kind`参数下设置，目前支持`[greedynms|diounms]`\n\n```\nnms_kind=greedynms\n```\n```\nnms_kind=diounms\n```\n\n对于YOLOv3来说, DIoU-NMS中引入beta1参数： `DIoU = IoU - R_DIoU ^ {beta1}`,是的NMS表现不错。DIoU发现，对于YOLOv3\n\n```\nbeta1=0.6\n```\n\nDIoU-NMS是比较好的(bet1=1.0也优于greedy-NMS)。但对于SSD和Faster R-CNN而言，`beta1=1.0`就很不错了。\n\n\n+ (4).learning rate\n\n    - `learning_rate`的设置原则 `NEW_RATE = ORIGINAL_RATE * 1/NUMBER_OF_GPUS` ；  \n\n    - `burn_in` 的设置原则 `NEW_BURN_IN = ORIGINAL_BURN_IN * NUMBER_OF_GPUS`\n\n因此对于1个GPU的情形：\n\n```\n    learning_rate=0.001\n    burn_in=1000\n```\n\n对于2个GPU的情形:\n\n```\n    learning_rate=0.0005\n    burn_in=2000\n```\n\n对于4个GPU的情形:\n\n```\n    learning_rate=0.00025\n    burn_in=4000\n```\n\n+ (5).其他配置\n\n其他配置和YOLOv3相似！\n\n\n### 4.训练\n\n```\n./darknet detector train cfg/myData-diou.data cfg/myData-diou.cfg darknet53.conv.74 #-gpus 0,1\n```\n\n### 5.Evaluation\n\n\n./darknet detector test  cfg/myData-ciou.data cfg/myData-ciou.cfg backup/ciou/myData-ciou_14000.weights data/test1.jpg\n\n\n### Reference\n\n```\n@inproceedings{zheng2020distance,\n  author    = {Zhaohui Zheng, Ping Wang, Wei Liu, Jinze Li, Rongguang Ye, Dongwei Ren},\n  title     = {Distance-IoU Loss: Faster and Better Learning for Bounding Box Regression},\n  booktitle = {The AAAI Conference on Artificial Intelligence (AAAI)},\n   year      = {2020},\n}\n```\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdataxujing%2Fdiou_yolo_v3","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdataxujing%2Fdiou_yolo_v3","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdataxujing%2Fdiou_yolo_v3/lists"}