This project supplies a better face landmark detector that is suitable for embedding devices: PFLD_GhostOne which is more suitable for edge computing. In most cases, its accuracy is better than the original PFLD model, and its speed is around 55% faster than the original PFLD model.
The proposed GhostOne module is show below: More details about GhostOne can be found on this blog
Model input size is 112x112
Model | NME | OpenVino Latency(ms) | NCNN Latency(ms) | ONNX Model Size(MB) |
---|---|---|---|---|
PFLD | 0.05438 | 1.65(CPU) 2.78(GPU) | 5.4(CPU) 5.1(GPU) | 4.66 |
PFLD-GhostNet | 0.05347 | 1.79(CPU) 2.55(GPU) | 2.9(CPU) 5.3(GPU) | 3.09 |
PFLD-GhostNet-Slim | 0.05410 | 2.11(CPU) 2.54(GPU) | 2.7(CPU) 5.2(GPU) | 2.83 |
PFLD-GhostOne | 0.05207 | 1.79(CPU) 2.18(GPU) | 2.4(CPU) 5.0(GPU) | 2.71 |
The latency is the average time of running 1000 times on 11th Gen Intel(R) Core(TM) i5-11500
Model | Pretrained Model |
---|---|
PFLD | pfld_best.pth |
PFLD-GhostNet | pfld_ghostnet_best.pth |
PFLD-GhostNet-Slim | pfld_ghostnet_slim_best.pth |
PFLD-GhostOne | pfld_ghostone_best.pth |
Clone and install:
Data:
Before training, check or modify network configuration (e.g. batch_size, epoch and steps etc..) in config.py.
After modify the configuration, run train.py to start training.
Modify the model_type and model_path in pytorch2onnx.py, and then run pytorch2onnx.py to generate the xxx.onnx file. It will optimize and simplify the ONNX file.
Before test the model, modify the configuration in onnx_inference.py, include the pfld_onnx_model, test_folder, save_result_folder etc. Then run onnx_inference.py to detect and align the images in the test_folder, and save results in save_result_folder directory.