Git Product home page Git Product logo

stanislasbertrand / retinaface-tf2 Goto Github PK

View Code? Open in Web Editor NEW
250.0 5.0 20.0 4.77 MB

RetinaFace (RetinaFace: Single-stage Dense Face Localisation in the Wild, published in 2019) reimplemented in Tensorflow 2.0, with pretrained weights available !

License: MIT License

Python 93.29% Makefile 0.06% C++ 0.03% Cuda 0.96% C 1.97% Cython 3.69%
face-detection retinaface tf2 tensorflow2 tensorflow deep-learning insightface

retinaface-tf2's Introduction

RetinaFace-tf2

RetinaFace (RetinaFace: Single-stage Dense Face Localisation in the Wild, published in 2019) reimplemented in Tensorflow 2.0, with pretrained weights available. Resnet50 backbone.

Original paper -> arXiv
Original Mxnet implementation -> Insightface

Table of contents

  1. Installation
  2. Usage
  3. Benchmark
  4. Evaluation
  5. Acknowledgements

example output : testing on a random internet selfie


INSTALLATION

To install dependencies, run :

pip install -r requirements.txt

Then build the rcnn module by running :

make

USAGE

Run :

python detect.py --sample_img="./sample-images/WC_FR.jpeg"

Python usage :

from src.retinafacetf2.retinaface import RetinaFace
import cv2

detector = RetinaFace(False, 0.4)
img = cv2.imread("./sample-images/WC_FR.jpeg")
faces, landmarks = detector.detect(img, 0.9)

BENCHMARK

mAP result values on the WIDERFACE validation dataset:

Model Easy Medium Hard
Original Mxnet implementation 96.5 95.6 90.4
Ours 95.6 94.6 88.5

EVALUATE ON WIDERFACE

In order to verify the models accuracy on the WiderFace dataset:

  • Run the model on the dataset and generate text files as results
python eval_widerface --widerface_data_dir = "/data/WIDER_test/images" --save_folder="./WiderFace-Evaluation/results/"
  • Evaluate the results
cd ./WiderFace-Evaluation
python setup.py build_ext --inplace
python evaluation.py -p ./results_val/ -g ./ground_truth/

ACKNOWLEDGEMENTS

This work is largely based on the original implementation by the amazing insightface team
Evaluation on widerface done with the Widerface-Evaluation repo
If you use this repo, please reference the original work :

@inproceedings{Deng2020CVPR,
title = {RetinaFace: Single-Shot Multi-Level Face Localisation in the Wild},
author = {Deng, Jiankang and Guo, Jia and Ververas, Evangelos and Kotsia, Irene and Zafeiriou, Stefanos},
booktitle = {CVPR},
year = {2020}
}

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.