/LitePIPNet

The Lite Facial Landmark Preprocessing Toolkit

Primary LanguagePython

LitePIPNet Facial Landmark Detection

This repository contains the implementation of PIPNet, a robust approach for facial landmark detection using a deep learning model based on ResNet architectures.

Key Achievements

Exceptional Model Performance on the 300W Dataset

Features

  • Utilizes ResNet as the backbone for the PIPNet model.

  • Supports training, testing, and real-time demo modes.

  • Includes a 300W dataset loader and loss computation.

  • Implements a face detector for real-time landmark detection in videos.

  • Designed for easy customization and scalability to accommodate research and development needs.

Requirements

conda create -n PyTorch python=3.8
conda activate PyTorch
conda install pytorch torchvision torchaudio cudatoolkit=10.2 -c pytorch-lts
pip install opencv-python==4.5.5.64
pip install PyYAML
pip install tqdm

Usage

Datasets: 300W

  • Download the datasets from official sources. The folder structure should look like this:
  • afw

  • helen

  • ibug

  • lfpw

Run the below command for dataset preparation

$ python -c 'from utils.util import DataGenerator; gen = DataGenerator("../Datasets_path/"); gen.run()'

Training

To train the model, run:

  • Configure your dataset path in main.py for training
$ python main.py --train

Testing

For testing the model, use:

  • Configure your dataset path in main.py for testing
$ python main.py --test

Real-Time Demo

To run the real-time facial landmark detection:

$ python main.py --demo


### Results
| Backbone   | Epochs | Test NME |                                                                 Pretrained weights |
|:----------:|:------:|---------:|-----------------------------------------------------------------------------------:|
| MobileOne  |   soon  |     soon |  [model]() |
| MobileOne  |   soon  |     soon |  [model]() |
| MobileOne  |   soon  |     soon |  [model]() |

##### Reference
* https://github.com/jhb86253817/PIPNet