GithubHelp home page GithubHelp logo

qaz734913414 / pytorch_retinaface Goto Github PK

View Code? Open in Web Editor NEW

This project forked from biubug6/pytorch_retinaface

0.0 0.0 0.0 6.18 MB

Get 79.69% in widerface hard val using mobilenet0.25.

Python 100.00%

pytorch_retinaface's Introduction

RetinaFace in PyTorch

A PyTorch implementation of RetinaFace: Single-stage Dense Face Localisation in the Wild. Model size only 1.7M, when Retinaface use mobilenet0.25 as backbone net. The official code in Mxnet can be found here.

WiderFace Val Performance in single scale When using Mobilenet0.25 as backbone net.

Style easy medium hard
Pytorch (same parameter with Mxnet) 86.85 % 85.84% 79.69%
Pytorch (original image scale) 90.58 % 87.94% 73.96%
Original Mxnet - - 79.1%

FDDB Performance When using Mobilenet0.25 as backbone net.

Dataset performace
FDDB(pytorch) 97.93%

Contents

Installation

Clone and install
  1. git clone https://github.com/biubug6/Pytorch_Retinaface.git

  2. Pytorch version 1.1.0+ and torchvision 0.3.0+ are needed.

  3. Codes are based on Python 3

Data
  1. Download the WIDERFACE dataset.

  2. Download annotations (face bounding boxes & five facial landmarks) from baidu cloud or dropbox

  3. Organise the dataset directory as follows:

  ./data/widerface/
    train/
      images/
      label.txt
    val/
      images/
      wider_val.txt

ps: wider_val.txt only include val file names but not label information.

Data1

We also provide the organized dataset we used as in the above directory structure.

Link: from baidu cloud Password: ruck

Training

We trained Mobilenet0.25 on imagenet dataset and get 46.75% in top 1. We use it as pretrain model which has been put in repository named model_best.pth.tar.

  1. Before training, you can check the mobilenet*0.25 network configuration (e.g. batch_size, min_sizes and steps etc..) in data/config.py and train.py.

  2. Train the model using WIDER FACE:

python train.py

If you do not wish to train the model, we also provide trained model in ./weights/Final_Retinaface.pth.

Evaluation

Evaluation widerface val

  1. Generate txt file
python test_widerface.py --trained_model weight_file
  1. Evaluate txt results. Demo come from Here
cd ./widerface_evaluate
python setup.py build_ext --inplace
python evaluation.py
  1. You can also use widerface official Matlab evaluate demo in Here

Evaluation FDDB

  1. Download the images FDDB to:
./data/FDDB/images/
  1. Evaluate the trained model using:
python test.py --dataset FDDB
  1. Download eval_tool to evaluate the performance.

RetinaFace-MobileNet0.25

References

@inproceedings{deng2019retinaface,
title={RetinaFace: Single-stage Dense Face Localisation in the Wild},
author={Deng, Jiankang and Guo, Jia and Yuxiang, Zhou and Jinke Yu and Irene Kotsia and Zafeiriou, Stefanos},
booktitle={arxiv},
year={2019}

pytorch_retinaface's People

Contributors

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