elhoangvu / PCN-iOS

Implementations of PCN face detection is ported to iOS using caffe. PCN (caffe version) is get from: https://github.com/Jack-CV/FaceKit

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

PCN-iOS

Real-Time Rotation-Invariant Face Detection

Implementations of PCN face detection is ported to iOS using caffe. PCN (caffe version) is get from: https://github.com/Jack-CV/FaceKit

Links

Results (on iPhone 6S+)

  • iPhone 6S+
  • Camera capture preset: 640x480 (1280x720 or larger sizes)
  • Below talbe is a record about quick PCN benchmarks on iPhone 6S+.
Min face size Number of faces FPS ~
45 1 93-108 FPS
45 2 57-58 FPS
45 3 34-37 FPS
45 4 22-23 FPS
45 5 21-22 FPS

Usage

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.

Note

You can replace caffe-ios by another caffe-ios implementation to reduce speed, performance, stability,...
The current caffe-ios lib is used with CPU_ONLY mode only because iOS platform don't support CUDA.

Issues

  • Some faces are difficult to detect (this was greatly improved on the previous commit).

More infos

  • XCode 10.1
  • Objective-C
  • C++
  • OpenCV@2
  • Caffe iOS
  • Real-Time Rotation-Invariant Face Detection

Thank authors: Jack-CV (PCN), lsy17096535 (caffe-iOS)

Citing PCN

@inproceedings{shiCVPR18pcn,
    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}
}

About

Implementations of PCN face detection is ported to iOS using caffe. PCN (caffe version) is get from: https://github.com/Jack-CV/FaceKit


Languages

Language:C++ 91.2%Language:C 5.9%Language:Cuda 2.4%Language:Python 0.3%Language:Objective-C 0.1%Language:Shell 0.0%Language:CMake 0.0%Language:Objective-C++ 0.0%