Skip to content

Tensorflow 2 BlazeFace implementation from scratch with complete training pipeline

License

Notifications You must be signed in to change notification settings

FurkanOM/tf-blazeface

Repository files navigation

BlazeFace

This is unofficial tensorflow blazeface implementation from scratch. This repo includes the entire training pipeline of blazeface. However, since the dataset used in the training process is a modified version of some datasets, it is not shared at this stage. Anchor / prior box hyperparameters were taken from the MediaPipe implementation. Loss calculation and augmentation methods were implemented as in SSD.

It's implemented and tested with tensorflow 2.0, 2.1, and 2.2

Usage

Project models created in virtual environment using miniconda. You can also create required virtual environment with conda.

To create virtual environment (tensorflow-2 gpu environment):

conda env create -f environment.yml

To train and test BlazeFace model:

python trainer.py
python predictor.py

If you have GPU issues you can use -handle-gpu flag with these commands:

python trainer.py -handle-gpu

References

  • BlazeFace: Sub-millisecond Neural Face Detection on Mobile GPUs [paper]
  • SSD: Single Shot MultiBox Detector [paper]
  • MediaPipe [code]
  • BlazeFace-PyTorch [code]