Giter Site home page Giter Site logo

hwanji / safety-helmet-wearing-dataset Goto Github PK

View Code? Open in Web Editor NEW

This project forked from njvisionpower/safety-helmet-wearing-dataset

1.0 1.0 0.0 3.49 MB

Safety helmet wearing detect dataset, with pretrained model

License: MIT License

Python 100.00%

safety-helmet-wearing-dataset's Introduction

SafetyHelmetWearing-Dataset(安全帽佩戴检测数据集)

Safety helmet (hardhat) wearing detect dataset(安全帽佩戴检测数据集, SHWD). We also provide pretrained models.

Introduction

SHWD provide the dataset used for both safety helmet wearing and human head detection. It includes 7581 images with 9044 human safety helmet wearing objects(positive) and 111514 normal head objects(not wearing or negative). The positive objects got from goolge or baidu, and we manually labeld with LabelImg. Some of negative objects got from SCUT-HEAD. We fixed some bugs for original SCUT-HEAD and make the data can be directly loaded as normal Pascal VOC format. Also we provide some pretrained models with MXNet GluonCV.

Dataset and model download

Dataset

BaiduDrive GoogleDrive

Model

BaiduDrive GoogleDrive

Benchmark

model darknet mobile1.0 mobile0.25
map 88.5 86.3 75.0

How to use dataset

We annotate the data as Pascal VOC format:

---VOC2028    
    ---Annotations    
    ---ImageSets    
    ---JPEGImages   

Two object class names for the task, "hat" for positive object and "person" for negative object.

How to run

Dependency

Make sure you install MXNet, GluonCV, OpenCV

Test with pretrained models

Two way to inference.

First way

Download models from link BaiduDrive.

Run "python test_yolo.py" with default settings, or change options:  
--network: darknet/mobile1.0/mobile0.25 network, default darknet53;  
--threshold: confidence that filter object;  
--gpu: use gpu or cpu, default gpu;  
--short: short side input size for original image.

Second way, inference with mxnet symbol

Download symbol models from BaiduDrive, (or GoogleDrive), then inference with symbol:

python test_symbol.py

Notice

1. This repo provide 3 yolo models with different size, default darknet53.
2. Parameter "short" means the input size of short side for original image, you can try larger value if want to detect dense objects or big size image.
3. Hyper-parameter threshold means the confidence for detect, change it for different task.

How to train

You can see function "get_dataset" in the file "train_yolo.py" to set dataset path. An example, download dataset and unzip to the path such as "D:\VOCdevkit\VOC2028", train/val dataset can set as:

train_dataset = VOCLike(root='D:\VOCdevkit', splits=[(2028, 'trainval')])
val_dataset = VOCLike(root='D:\VOCdevkit', splits=[(2028, 'test')])

Then check train_yolo.py to set options and train, such as:

python train_yolo.py --batch-size 4 -j 4 --warmup-epochs 3

Notice

1. One common problem when train yolo is gradient explosion, try more epoches to warmup or use smaller learning rate.
2. Much time spent on dataset loading with CPU, set "-j" number bigger if you have multi-core CPU and will improve train speed.
3. If train on Windows, sometimes program may blocked, see https://discuss.gluon.ai/t/topic/9388/11, if train on Linux make sure you have enough share memory.

Demo

safety-helmet-wearing-dataset's People

Contributors

njvisionpower avatar

Stargazers

 avatar

Watchers

 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.