Skip to content

📈📈📈【口罩佩戴检测数据训练 | 开源口罩检测数据集和预训练模型】Train D/CIoU_YOLO_V3 by darknet for object detection

License

Notifications You must be signed in to change notification settings

CVRepo/DIoU_YOLO_V3

 
 

Repository files navigation

DIoU-Darknet 口罩佩戴检测

提供整理的开源口罩佩戴检测数据集的下载!!!

YOLOv3 with DIoU and CIoU losses implemented in Darknet

[arxiv] [pdf]

Xu Jing

DEMO

相同图片基于AIZOO开源的检测效果:

配置和训练过程以darknet版YOLO v3和Gaussian YOLO v3的配置训练过程相似,这里以Ubuntu为例,关于Windows下的配置和生成过程,具体可以联系DataXujing

1.修改Makefile并make

GPU=1 #如果使用GPU设置为1,CPU设置为0
CUDNN=1  #如果使用CUDNN设置为1,否则为0
OPENCV=1 #如果调用摄像头,还需要设置OPENCV为1,否则为0
OPENMP=1  #如果使用OPENMP设置为1,否则为0
DEBUG=0  #如果使用DEBUG设置为1,否则为0
make

2.数据来源

数据整理成VOC格式的数据,最终数据为8565张图像,由于存储空间问题,如果开发者需要改数据,请通过个人GitHub主页公布的邮箱索要。

将数据存放在data/myData

3.配置文件

  • (1).Losses

目前支持的损失:[iou|giou|diou|ciou|mse]

iou_loss=ciou
  • (2).Normalizers

Location和Claffication损失之间的Normalize,cls_normalizeriou_normalizer 默认都是1.0,但在DIoU探索中发现,下面的配置比较好:

iou_loss=diou
cls_normalizer=1
iou_normalizer=1.0
iou_loss=ciou
cls_normalizer=1
iou_normalizer=0.5
  • (3).DIoU-NMS

nms_kind参数下设置,目前支持[greedynms|diounms]

nms_kind=greedynms
nms_kind=diounms

对于YOLOv3来说, DIoU-NMS中引入beta1参数: DIoU = IoU - R_DIoU ^ {beta1},是的NMS表现不错。DIoU发现,对于YOLOv3

beta1=0.6

DIoU-NMS是比较好的(bet1=1.0也优于greedy-NMS)。但对于SSD和Faster R-CNN而言,beta1=1.0就很不错了。

  • (4).learning rate

    • learning_rate的设置原则 NEW_RATE = ORIGINAL_RATE * 1/NUMBER_OF_GPUS

    • burn_in 的设置原则 NEW_BURN_IN = ORIGINAL_BURN_IN * NUMBER_OF_GPUS

因此对于1个GPU的情形:

    learning_rate=0.001
    burn_in=1000

对于2个GPU的情形:

    learning_rate=0.0005
    burn_in=2000

对于4个GPU的情形:

    learning_rate=0.00025
    burn_in=4000
  • (5).其他配置

其他配置和YOLOv3相似!

4.训练

./darknet detector train cfg/myData-diou.data cfg/myData-diou.cfg darknet53.conv.74 #-gpus 0,1

5.Evaluation

./darknet detector test cfg/myData-ciou.data cfg/myData-ciou.cfg backup/ciou/myData-ciou_14000.weights data/test1.jpg

Reference

@inproceedings{zheng2020distance,
  author    = {Zhaohui Zheng, Ping Wang, Wei Liu, Jinze Li, Rongguang Ye, Dongwei Ren},
  title     = {Distance-IoU Loss: Faster and Better Learning for Bounding Box Regression},
  booktitle = {The AAAI Conference on Artificial Intelligence (AAAI)},
   year      = {2020},
}

About

📈📈📈【口罩佩戴检测数据训练 | 开源口罩检测数据集和预训练模型】Train D/CIoU_YOLO_V3 by darknet for object detection

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages

  • Jupyter Notebook 71.2%
  • C 18.0%
  • Python 4.0%
  • MATLAB 2.6%
  • Cuda 1.4%
  • C++ 1.0%
  • Other 1.8%