Coder Social home page Coder Social logo

gdbbq / retinadetector Goto Github PK

View Code? Open in Web Editor NEW

This project forked from bleakie/retinadetector

0.0 0.0 0.0 2.9 MB

基于RetinaFace的目标检测方法,适用于人脸、缺陷、小目标、行人等

License: Apache License 2.0

Makefile 0.05% Python 96.98% C++ 0.03% Cuda 0.95% C 1.96% Shell 0.02%

retinadetector's Introduction

RetinaDetection Object Detector

Introduction

RetinaDetector是基于RetinaFace修改的检测方法,原论文is a practical single-stage SOTA face detector which is initially described in arXiv technical report

Data

  1. Organise the dataset directory as follows:
  data/retinaface/
    train/
      images/
      label.txt
    val/
      images/
      label.txt
    test/
      images/
      label.txt

Install

  1. Install MXNet with GPU support.
  2. Install Deformable Convolution V2 operator from Deformable-ConvNets if you use the DCN based backbone.
  3. Type make to build cxx tools.

Training

Please check train.py for training.

  1. Copy rcnn/sample_config.py to rcnn/config.py

为了获得更好的训练效果,可针对性的修改一些参数,如下:

config.TRAIN.MIN_BOX_SIZE = 10 #最小bbox
config.FACE_LANDMARK = False #使用landmark
config.USE_BLUR = False
config.BBOX_MASK_THRESH = 0
config.COLOR_MODE = 2 #增强
config.COLOR_JITTERING = 0.125

无效人脸的过滤,如下:

if (x2 - x1) < config.TRAIN.MIN_BOX_SIZE or (y2 - y1) < config.TRAIN.MIN_BOX_SIZE:
   continue
if self._split.startswith('train'):
   blur[ix] = values[19]
   if blur[ix] < 0.25:
      continue
if config.BBOX_MASK_THRESH > 0:
   if (x2 - x1) < config.BBOX_MASK_THRESH or (y2 - y1) < config.BBOX_MASK_THRESH:
      boxes_mask.append(np.array([x1, y1, x2, y2], np.float))
      continue
   if self._split.startswith('train'):
      if blur[ix] < 0.35:
         boxes_mask.append(np.array([x1, y1, x2, y2], np.float))
         continue
  1. Download pretrained models and put them into model/.

    ImageNet ResNet50 (baidu cloud and dropbox).

    ImageNet ResNet152 (baidu cloud and dropbox).

  2. Start training with sh train_model.sh.
    Before training, you can check the resnet network configuration (e.g. pretrained model path, anchor setting and learning rate policy etc..) in rcnn/config.py.

Testing

Please check test.py for testing.

Result

  1. 缺陷检测

MASK1

  1. 人脸检测+人脸对齐

MASK1

Models

人脸检测模型,比原版误检更低,角度较大和模糊超过0.6的face会自动忽略,更适合人脸识别的应用:click here.

ToDo

由于缺陷检测数据涉及私密性,缺陷检测的模型暂时不会释放

References

@inproceedings{[email protected],
year={2019}
}

retinadetector's People

Contributors

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