Counting 3,319 Big Data & Machine Learning Frameworks, Toolsets, and Examples...
Suggestion? Feedback? Tweet @stkim1

Last Commit
Nov. 21, 2018
Apr. 17, 2018


2018.11.04 CropFace function released!

2018.10.14 Source code released!

Real-Time Rotation-Invariant Face Detection with Progressive Calibration Networks

Progressive Calibration Networks (PCN) is an accurate rotation-invariant face detector running at real-time speed on CPU. This is an implementation for PCN.


Some detection results can be viewed in the following illustrations:

PCN is designed aiming for low time-cost. We compare PCN's speed with other rotation-invariant face detectors' on standard VGA images(640x480) with 40x40 minimum face size. The detectors run on a desktop computer with 3.4GHz CPU, GTX Titan X. The speed results together with the recall rate at 100 false positives on multi-oriented FDDB are shown in the following table. Detailed experiment settings can be found in our paper. It is worth mentioning that converting the square results to rectangles or ellipses is helpful to fit the ground-truth data. In this way, better accuracy can be achieved. But we do not convert the results here.


Set minimum size of faces to detect (size >= 20)

  • detector.SetMinFaceSize(size);

Set scaling factor of image pyramid (1.4 <= factor <= 1.6)

  • detector.SetImagePyramidScaleFactor(factor);

Set score threshold of detected faces (0 <= thresh1, thresh2, thresh3 <= 1)

  • detector.SetScoreThresh(thresh1, thresh2, thresh3);

Smooth the face boxes or not (smooth = true or false, recommend using it on video to get stabler face boxes)

  • detector.SetVideoSmooth(smooth);

See picture.cpp and video.cpp for details. If you want to reproduce the results on FDDB, please run fddb.cpp. You can rotate the images in FDDB to get FDDB-left, FDDB-right, and FDDB-down, then test PCN on them respectively.

Compile and run:

cd $PCN_ROOT/code
# You should set "CAFFEROOT" in,, and first. 
sh picture/video/fddb
sh picture/video/fddb



  • Linux
  • Caffe
  • OpenCV (2.4.10, or other compatible version)

Other Implementations


  • How to get faces with different rotation-in-plane angles before training?

    Please refer to issue 3, 7, 8, 10.


This code is distributed under the BSD 2-Clause license.

Citing PCN

If you find PCN useful in your research, please consider citing:

    Author = {Xuepeng Shi and Shiguang Shan and Meina Kan and Shuzhe Wu and Xilin Chen},
    Title = {Real-Time Rotation-Invariant Face Detection with Progressive Calibration Networks},
    Booktitle = {The IEEE Conference on Computer Vision and Pattern Recognition (CVPR)},
    Year = {2018}