Giter Club home page Giter Club logo

yolo3-keras-breath_mask's Introduction

yolo3-keras-breath_mask

基于YOLOV3的人体口罩佩戴检测

由于2020年新型冠状病毒,针对公共场合检测人员是否佩戴口罩,故用YOLOV3完成一个人体口罩佩戴检测。

效果展示

have_mask_sample

环境

工欲善其事必先利其器

  • Python: 3.7.4
  • Tensorflow-GPU 1.14.0
  • Keras: 2.2.4

数据集

[口罩检测数据集]

训练

准备数据集

按照VOC数据集的格式来准备数据集,及图片以及xml标签

VOCdevkit
	-VOC2007
		├─ImageSets    # 存放数据集列表文件,由voc2yolo3.py文件生成
		├─Annotations  # 存放图片标签,xml 格式
		├─JPEGImages   # 存放数据集中图片文件
		└─voc2yolo3.py # 用来生成数据集列表文件

将你准备的数据集文件放入JPEGImages以及ImageSets文件中,然后运行python voc2yolo3.py来生成ImageSets中的数据列表文件

生成YOLOV3所需数据

在根目录下,运行 python voc_annotation.py,程序将在根目录下生成用于训练所需的数据列表,运行前记得修改voc_annotation.py中的classes

YOLOv3训练

训练步骤

  • 1.下载yolov3的权重文件yolov3_weights

  • 2.执行如下命令将darknet下的yolov3配置文件转换成keras适用的h5文件。

    python convert.py yolov3.cfg yolov3.weights model_data/yolo.h5

  • 3.在根目录下,运行 train.py 进行训练。可以根据情况修改 train.py 中的参数。

测试

  • 1.单张图片测试,需修改yolo.py文件中模型的位置,替换成你训练好的模型。然后在根目录下,运行python predict_img.py进行测试。

  • 2.自己电脑摄像头实时检测,在根目录下运行python predict_video.py

yolo3-keras-breath_mask's People

Contributors

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