CenterFace(size of 7.3MB) is a practical anchor-free face detection and alignment method for edge devices.

CenterFace

Introduce

CenterFace(size of 7.3MB) is a practical anchor-free face detection and alignment method for edge devices.

image

Recent Update

  • 2019.09.13 CenterFace is released.

Environment

  • OpenCV 4.1.0
  • Numpy
  • Python3.6+

Accuracy

  • Results on val set of WIDER FACE:
Model Version Easy Set Medium Set Hard Set
FaceBoxes 0.840 0.766 0.395
FaceBoxes3.2× 0.798 0.802 0.715
RetinaFace-mnet 0.896 0.871 0.681
LFFD-v1 0.910 0.881 0.780
LFFD-v2 0.837 0.835 0.729
CenterFace 0.935 0.924 0.875
CenterFace-small 0.931 0.924 0.870
  • Results on test set of WIDER FACE:
Model Version Easy Set Medium Set Hard Set
FaceBoxes 0.839 0.763 0.396
FaceBoxes3.2× 0.791 0.794 0.715
RetinaFace-mnet 0.896 0.871 0.681
LFFD-v1 0.910 0.881 0.780
LFFD-v2 0.837 0.835 0.729
CenterFace 0.932 0.921 0.873
  • RetinaFace-mnet is short for RetinaFace-MobileNet-0.25 from excellent work insightface.
  • LFFD-v1 is from prefect work LFFD.
  • CenterFace/CenterFace-small evaluation is under MULTI-SCALE, FLIP.
  • For SIO(Single Inference on the Original) evaluation schema, CenterFace also produces 92.2% (Easy), 91.1% (Medium) and 78.2% (Hard) for validation set.
  • Results on FDDB:
Model Version Disc ROC curves score
RetinaFace-mnet [email protected]
LFFD-v1 [email protected]
LFFD-v2 [email protected]
CenterFace [email protected]
CenterFace-small [email protected]

Inference Latency

  • Latency on NVIDIA RTX 2080TI:
Resolution-> 640×480 1280×720(704) 1920×1080(1056)
RetinaFace-mnet 5.40ms 6.31ms 10.26ms
LFFD-v1 7.24ms 14.58ms 28.36ms
CenterFace 5.5ms 6.4ms 8.7ms
CenterFace-small 4.4ms 5.7ms 7.3ms

Results: Face as Point

image

image

image

Discussion

Welcome to join in QQ Group(229042802) for more discussion, including but not limited to face detection, face anti-spoofing and so on.

Author

Citation

If you benefit from our work in your research and product, please consider to cite the following related papers:

@inproceedings{CenterFace,
title={CenterFace: Joint Face Detection and Alignment Using Face as Point},
author={Xu, Yuanyuan and Yan, Wan and Sun, Haixin and Yang, Genke and Luo, Jiliang},
booktitle={arXiv:1911.03599},
year={2019}
}
Comments
  • The Tensorrt inference does not release memory after execution

    The Tensorrt inference does not release memory after execution

    When using tensorrt model for video, it keeps eating more and more GPU memory until causing OOM.

    [TensorRT] ERROR: ../rtSafe/safeRuntime.cpp (25) - Cuda Error in allocate: 2 (out of memory)
    [TensorRT] ERROR: FAILED_ALLOCATION: std::exception
    
  • Bad Accuracy..Real world accuracy is half

    Bad Accuracy..Real world accuracy is half

    I have tested this model on my own 5000 images and the accuracy seems to be half of the claimed.

    5 faces detected in the following is a disaster. https://ibb.co/PCL0qNv

  • prj-tensorrt demo.py reshape issue

    prj-tensorrt demo.py reshape issue

    Hi, I am using this repo's code together with the zhihu tutorial provided here. https://zhuanlan.zhihu.com/p/106774468 Thank you for opensource the code in the first hand and I have some problem. Because I am using tensorrt 7.0.0.11, I use the given onnx model to regenerate the trt file. However, when I run the demo.py code provided in the prj-tensorrt folder, I get the following error ValueError: cannot reshape array of size 4177920 into shape (1,1,120,160) This error remains there after I change the onnx model to onnx_1920_1080 follow the code from the zhihu tutorial, only the size change from some other value to this 4177920. do you have any suggestion on how to solve this reshape value error? Thanks in advance.

  • Error when using different image sizes after loading model!

    Error when using different image sizes after loading model!

    Hello, I am facing an issue of getting wrong result when using your demo.py file in this folder "prj-python". Firstly, I load the model. After that, I check the results with different image sizes in a folder. The first image is ok, but then I only get very bad results with other images that have different sizes with the first one. Please help me with this problem. Thank you

  • Pycuda error during Tensorrt inference

    Pycuda error during Tensorrt inference

    I converted onnx model into trt file on jetson nano using tensorrt 5, cuda 10, python 3.6... But I'm getting the error related to pycuda. Traceback is: File "demo.py", line 30, in test_image_tensorrt() File "demo.py", line 13, in test_image_tensorrt dets, lms = centerface(frame, h, w, threshold=0.35) File "/ML/CenterFace/prj-tensorrt/centerface.py", line 21, in call return self.inference_tensorrt(img, threshold) File "/ML/CenterFace/prj-tensorrt/centerface.py", line 91, in inference_tensorrt trt_outputs = do_inference(context, bindings=bindings, inputs=inputs, outputs=outputs, stream=stream) # numpy data File "/ML/CenterFace/prj-tensorrt/centerface.py", line 60, in do_inference [cuda.memcpy_htod_async(inp.device, inp.host, stream) for inp in inputs] File "/ML/CenterFace/prj-tensorrt/centerface.py", line 60, in [cuda.memcpy_htod_async(inp.device, inp.host, stream) for inp in inputs] pycuda._driver.LogicError: cuMemcpyHtoDAsync failed: invalid argument

  • About MAP

    About MAP

    Hi, I make a test on WIDERFACE val dataset,the input size of centerface network is 1920x1088(width x height), So the map result is:

    Easy Val AP: 0.8841115597905682 Medium Val AP: 0.8755813460085787 Hard Val AP: 0.7423266548239988

    Please, What is the network input size of the author ? and how to test for the same results as the author ?

    Thanks.

  • The key points are not calculated as described in the paper?

    The key points are not calculated as described in the paper?

    why the key points are not calculated as described in the paper?

    the regression of the five facial landmarks adopts the target normalization method based on the center position however the code is based on the left-top point. facebox.landmarks[2*j] = x1 + lm[(2*j+1)*spacial_size+index] * s1

  • the tensorrt version and devices

    the tensorrt version and devices

    I can't run tensorrt demo, python: engine.cpp:1104: bool nvinfer1::rt::Engine::deserialize(const void*, std::size_t, nvinfer1::IGpuAllocator&, nvinfer1::IPluginFactory*): Assertion `size >= bsize && "Mismatch between allocated memory size and expected size of serialized engine."' failed.

    would you tell me the tensorrt version and devices?

  • About whether use BatchNorm in network head

    About whether use BatchNorm in network head

    Hi, in your published ncnn model, its network head below: 02-2 it doesn't use Batchnorm after 3x3 conv.

    but in onnx model, its network head below: 02-3 it uses Batchnorm after 3x3 conv.

    So whether to use BN after 3x3 conv?

  • the train image size

    the train image size

    I'm trying to reproduce the results of the paper, and this is result I have now.

    Easy   Val AP: 0.9136305801084846
    Medium Val AP: 0.9004443217585435
    Hard   Val AP: 0.7486346101347016
    

    i test the val dataset with 800*800,but can not reach the accuracy in papers.Do you follow the training details in the paper。 thanks.

  • Failed to execute prj-opencv-cpp

    Failed to execute prj-opencv-cpp

    When excute ./demo ../../models/onnx your_image_path will return terminate called after throwing an instance of 'cv::Exception' what(): OpenCV(4.1.1) ../modules/dnn/src/onnx/onnx_importer.cpp:57: error: (-210:Unsupported format or combination of formats) Failed to parse onnx model in function 'ONNXImporter' Do you know how to solve it? Thanks!

  • Video predictive acceleration

    Video predictive acceleration

    Hello, I need help. When I was using the PRJ-Python demo for video prediction, I found that the video played very slowly. How can I speed it up? How can I use the GPU to speed up the prediction? for example: cpu times = 0:00:00.607373 cpu times = 0:00:00.600722 cpu times = 0:00:00.605358 cpu times = 0:00:00.595381 cpu times = 0:00:00.600362 cpu times = 0:00:00.597402 cpu times = 0:00:00.600776 cpu times = 0:00:00.613360 cpu times = 0:00:00.604355 cpu times = 0:00:00.617489 cpu times = 0:00:00.601388 cpu times = 0:00:00.602388

  • how to find model_path in cpp version

    how to find model_path in cpp version

    """ int main(int argc, char** argv) {

    std::string model_path = argv[1];
    std::string image_file = argv[2];
    

    """ how can i find the model_path and image_file in CPP demo.cpp

  • CMake error: include_directories(${CMAKE_CURRENT_LIST_DIR}/cpp)d

    CMake error: include_directories(${CMAKE_CURRENT_LIST_DIR}/cpp)d

    CMake Error at C:Repos\CenterFace\prj-opencv-cpp\CMakeLists.txt:15: Parse error. Expected a newline, got identifier with text "d". demo C:\Repos\CenterFace\prj-opencv-cpp\CMakeLists.txt 15

    code: include_directories(${CMAKE_CURRENT_LIST_DIR}/cpp)d

  • Update centerface.py

    Update centerface.py

    you will find the following errors that the gpu‘s’ memory would be exhausted if you run the code in a loop so i try amend the code to make sure the program is normal

    我把初始化的一部分代码提出来了,以防循环执行该代码时,发生显存溢出的问题

img2pose: Face Alignment and Detection via 6DoF, Face Pose Estimation
img2pose: Face Alignment and Detection via 6DoF, Face Pose Estimation

img2pose: Face Alignment and Detection via 6DoF, Face Pose Estimation Figure 1: We estimate the 6DoF rigid transformation of a 3D face (rendered in si

Sep 24, 2022
Ultra-lightweight human body posture key point CNN model. ModelSize:2.3MB HUAWEI P40 NCNN benchmark: 6ms/img,
Ultra-lightweight human body posture key point CNN model. ModelSize:2.3MB  HUAWEI P40 NCNN benchmark: 6ms/img,

Ultralight-SimplePose Support NCNN mobile terminal deployment Based on MXNET(>=1.5.1) GLUON(>=0.7.0) framework Top-down strategy: The input image is t

Sep 14, 2022
[TIP 2021] SADRNet: Self-Aligned Dual Face Regression Networks for Robust 3D Dense Face Alignment and Reconstruction
[TIP 2021] SADRNet: Self-Aligned Dual Face Regression Networks for Robust 3D Dense Face Alignment and Reconstruction

SADRNet Paper link: SADRNet: Self-Aligned Dual Face Regression Networks for Robust 3D Dense Face Alignment and Reconstruction Requirements python

Sep 15, 2022
🍅🍅🍅YOLOv5-Lite: lighter, faster and easier to deploy. Evolved from yolov5 and the size of model is only 1.7M (int8) and 3.3M (fp16). It can reach 10+ FPS on the Raspberry Pi 4B when the input size is 320×320~
🍅🍅🍅YOLOv5-Lite: lighter, faster and easier to deploy. Evolved from yolov5 and the size of model is only 1.7M (int8) and 3.3M (fp16). It can reach 10+ FPS on the Raspberry Pi 4B when the input size is 320×320~

YOLOv5-Lite:lighter, faster and easier to deploy Perform a series of ablation experiments on yolov5 to make it lighter (smaller Flops, lower memory, a

Sep 22, 2022
BED: A Real-Time Object Detection System for Edge Devices
BED: A Real-Time Object Detection System for Edge Devices

BED: A Real-Time Object Detection System for Edge Devices About this project Thi

May 4, 2022
A very simple tool for situations where optimization with onnx-simplifier would exceed the Protocol Buffers upper file size limit of 2GB, or simply to separate onnx files to any size you want.
A very simple tool for situations where optimization with onnx-simplifier would exceed the Protocol Buffers upper file size limit of 2GB, or simply to separate onnx files to any size you want.

sne4onnx A very simple tool for situations where optimization with onnx-simplifier would exceed the Protocol Buffers upper file size limit of 2GB, or

Aug 30, 2022
DAFNe: A One-Stage Anchor-Free Deep Model for Oriented Object Detection
DAFNe: A One-Stage Anchor-Free Deep Model for Oriented Object Detection

DAFNe: A One-Stage Anchor-Free Deep Model for Oriented Object Detection Code for our Paper DAFNe: A One-Stage Anchor-Free Deep Model for Oriented Obje

Sep 16, 2022
Face Detection and Alignment using Multi-task Cascaded Convolutional Networks (MTCNN)
Face Detection and Alignment using Multi-task Cascaded Convolutional Networks (MTCNN)

Face-Detection-with-MTCNN Face detection is a computer vision problem that involves finding faces in photos. It is a trivial problem for humans to sol

Jan 25, 2022
A DNN inference latency prediction toolkit for accurately modeling and predicting the latency on diverse edge devices.

Note: This is an alpha (preview) version which is still under refining. nn-Meter is a novel and efficient system to accurately predict the inference l

Sep 9, 2022
Edge-oriented Convolution Block for Real-time Super Resolution on Mobile Devices, ACM Multimedia 2021

Codes for ECBSR Edge-oriented Convolution Block for Real-time Super Resolution on Mobile Devices Xindong Zhang, Hui Zeng, Lei Zhang ACM Multimedia 202

Sep 21, 2022
A high-performance anchor-free YOLO. Exceeding yolov3~v5 with ONNX, TensorRT, NCNN, and Openvino supported.
A high-performance anchor-free YOLO. Exceeding yolov3~v5 with ONNX, TensorRT, NCNN, and Openvino supported.

YOLOX is an anchor-free version of YOLO, with a simpler design but better performance! It aims to bridge the gap between research and industrial communities. For more details, please refer to our report on Arxiv.

Sep 20, 2022
YOLOX is a high-performance anchor-free YOLO, exceeding yolov3~v5 with ONNX, TensorRT, ncnn, and OpenVINO supported.
YOLOX is a high-performance anchor-free YOLO, exceeding yolov3~v5 with ONNX, TensorRT, ncnn, and OpenVINO supported.

Introduction YOLOX is an anchor-free version of YOLO, with a simpler design but better performance! It aims to bridge the gap between research and ind

Sep 18, 2022
Code for CVPR 2021 paper: Anchor-Free Person Search
Code for CVPR 2021 paper: Anchor-Free Person Search

Introduction This is the implementationn for Anchor-Free Person Search in CVPR2021 License This project is released under the Apache 2.0 license. Inst

Aug 31, 2022
Code for CVPR2021 paper "Learning Salient Boundary Feature for Anchor-free Temporal Action Localization"
 Code for CVPR2021 paper

AFSD: Learning Salient Boundary Feature for Anchor-free Temporal Action Localization This is an official implementation in PyTorch of AFSD. Our paper

Sep 15, 2022
The official implementation of the CVPR 2021 paper FAPIS: a Few-shot Anchor-free Part-based Instance Segmenter
The official implementation of the CVPR 2021 paper FAPIS: a Few-shot Anchor-free Part-based Instance Segmenter

FAPIS The official implementation of the CVPR 2021 paper FAPIS: a Few-shot Anchor-free Part-based Instance Segmenter Introduction This repo is primari

Sep 20, 2022
Yoloxkeypointsegment - An anchor-free version of YOLO, with a simpler design but better performance

Introduction 关键点版本:已完成 全景分割版本:已完成 实例分割版本:已完成 YOLOX is an anchor-free version of

Sep 20, 2022
A Transformer-Based Feature Segmentation and Region Alignment Method For UAV-View Geo-Localization
A Transformer-Based Feature Segmentation and Region Alignment Method For UAV-View Geo-Localization

University1652-Baseline [Paper] [Slide] [Explore Drone-view Data] [Explore Satellite-view Data] [Explore Street-view Data] [Video Sample] [中文介绍] This

Sep 8, 2022
:fire: 2D and 3D Face alignment library build using pytorch
:fire: 2D and 3D Face alignment library build using pytorch

Face Recognition Detect facial landmarks from Python using the world's most accurate face alignment network, capable of detecting points in both 2D an

Sep 19, 2022
Adaout is a practical and flexible regularization method with high generalization and interpretability

Adaout Adaout is a practical and flexible regularization method with high generalization and interpretability. Requirements python 3.6 (Anaconda versi

Feb 9, 2022