CenterFace Documentation

repository·master·Indexed 23 days ago

https://github.com/star-clouds/centerface

An anchor-free face detection and alignment method optimized for edge devices. CenterFace treats faces as points to balance high accuracy and low inference latency, offering a standard model (7.3MB) and a lightweight CenterFace-small version (2.3MB). The project provides implementations for MNN, NCNN, OpenCV C++, TensorRT, and Python.

Tokens
1.1K
Snippets
5
Records
14
Agent score
79%

What's inside CenterFace

  1. Overview of CenterFace

    master
    CenterFace is a practical, anchor-free face detection and alignment method designed specifically for edge devices. It has a small model size of approximately 7.3MB and treats faces as points for joint detection and alignment.
  2. Overview of CenterFace face detection

    master

    CenterFace is an anchor-free face detection and alignment algorithm designed for practical use on edge devices. It treats faces as points rather than using traditional anchor boxes.

    There are two primary model versions:

    • CenterFace: A model with a size of 7.3M.
    • CenterFace-small: A lightweight version with a size of 2.3M that maintains performance comparable to the standard CenterFace model.
  3. Compare CenterFace accuracy and performance

    master

    CenterFace and CenterFace-small demonstrate high accuracy on the WIDER FACE dataset and low inference latency on NVIDIA hardware.

    Accuracy (WIDER FACE val set):

    • CenterFace: Easy (0.935), Medium (0.924), Hard (0.875)
    • CenterFace-small: Easy (0.931), Medium (0.924), Hard (0.870)

    Inference Latency (NVIDIA RTX 2080TI):

    • CenterFace (640×480): 5.5ms
    • CenterFace-small (640×480): 4.4ms
    • CenterFace (1920×1080): 8.7ms
    • CenterFace-small (1920×1080): 7.3ms

    Note: For single-scale inference (SIO) on the val set, CenterFace achieves: 92.2% (Easy), 91.1% (Medium), and 78.2% (Hard).

  4. Requirements for CenterFace NCNN

    master

    To build and run the C++ version of CenterFace with NCNN, you need the following dependencies installed on your system:

    • ncnn: The core inference framework.
    • opencv (optional): Required if you wish to use OpenCV-related features or if the specific build configuration depends on it.
  5. Compile and run the CenterFace MNN project

    master

    Follow these steps to build the project using CMake and run the demo executable:

    1. Navigate to the project directory: cd CenterFace/prj-mnn
    2. Create a build directory and compile: mkdir build && cd build && cmake .. && make -j3
    3. Run the demo by providing the path to the MNN models and the target image path: ./demo <model_directory> <image_path>
    cd CenterFace/prj-mnn
    mkdir build && cd build && cmake .. && make -j3
    ./demo ../../models/mnn  your_image_path
  6. Build and run the CenterFace NCNN demo

    master

    Follow these steps to build the project using CMake and run the provided demo executable. Ensure you are in the prj-ncnn directory before starting.

    cd CenterFace/prj-ncnn
    mkdir build && cd build && cmake && make
    ./demo ../../models/ncnn  your_image_path
  7. Build and run the CenterFace C++ demo

    master

    To build the project and run the demonstration, follow these steps from the prj-opencv-cpp directory:

    1. Create a build directory and compile using CMake and Make.
    2. Run the ./demo executable, providing the path to your ONNX models and the path to the image you wish to process.
    cd CenterFace/prj-opencv-cpp
    mkdir build && cd build && cmake && make
    ./demo ../../models/onnx  your_image_path