Giter VIP home page Giter VIP logo

blazeface-tensorflow's Introduction

Face Detection From Scratch using the BlazeFace Architecture

In this repository you can find the code to test and train a face detection model based on the BlazeFace architecture.

This model can run on even low-end hardware like a 2 core CPU. You can learn more about the architecture and the process to train the network in this post.

You can test the model in your computer using:

python webcam.py

The model is saved in the weights folder. You need TensorFlow 2.0, cv2, numpy and imutils installed.

Create dataset

To train this model you need to create a dataset:

  1. Firstly, download the WIDER FACE training dataset here and the FDDB dataset here.

  2. Create a folder named face_dataset and put inside the folder originalPics from the FDDB dataset and the folders from WIDER_train/images fromm the WIDER FACE training dataset.

  3. Create a folder named created_dataset

Training

To train the network we run:

python training.py --epochs=500

500 epochs are enough to converge, if you want to keep training use:

python training.py --epochs=100 --continue_training

To test the trained model:

python test_model.py

This is only going to show the first 8 images, If you want to test more images you can use the Jupyter Notebook or create a new one and copy the code from the test_model.py file.

iOS Apps

This model is also available as an iOS app written in Swift, actually, as 2 iOS apps. The first app uses TensorFlow lite to load and run the model, and the second app uses CoreML.

You can check the post about the TensorFlow Lite version here, and the CoreML version here.

blazeface-tensorflow's People

Contributors

vincent1bt avatar

Stargazers

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