An open source library for face detection in images. The face detection speed can reach 1000FPS.

Overview

libfacedetection

This is an open source library for CNN-based face detection in images. The CNN model has been converted to static variables in C source files. The source code does not depend on any other libraries. What you need is just a C++ compiler. You can compile the source code under Windows, Linux, ARM and any platform with a C++ compiler.

SIMD instructions are used to speed up the detection. You can enable AVX2 if you use Intel CPU or NEON for ARM.

The model files are provided in src/facedetectcnn-data.cpp (C++ arrays) & the model (ONNX) from OpenCV Zoo. You can try our scripts (C++ & Python) in opencv_dnn/ with the ONNX model. View the network architecture here.

examples/detect-image.cpp and examples/detect-camera.cpp show how to use the library.

The library was trained by libfacedetection.train.

Examples

How to use the code

You can copy the files in directory src/ into your project, and compile them as the other files in your project. The source code is written in standard C/C++. It should be compiled at any platform which supports C/C++.

Some tips:

  • Please add facedetection_export.h file in the position where you copy your facedetectcnn.h files, add #define FACEDETECTION_EXPORT to facedetection_export.h file. See: issues #222
  • Please add -O3 to turn on optimizations when you compile the source code using g++.
  • Please choose 'Maximize Speed/-O2' when you compile the source code using Microsoft Visual Studio.
  • You can enable OpenMP to speedup. But the best solution is to call the detection function in different threads.

You can also compile the source code to a static or dynamic library, and then use it in your project.

How to compile

CNN-based Face Detection on Intel CPU

Method Time FPS Time FPS
X64 X64 X64 X64
Single-thread Single-thread Multi-thread Multi-thread
cnn (CPU, 640x480) 58.06ms. 17.22 12.93ms 77.34
cnn (CPU, 320x240) 13.77ms 72.60 3.19ms 313.14
cnn (CPU, 160x120) 3.26ms 306.81 0.77ms 1293.99
cnn (CPU, 128x96) 1.41ms 711.69 0.49ms 2027.74
  • Minimal face size ~10x10
  • Intel(R) Core(TM) i7-1065G7 CPU @ 1.3GHz

CNN-based Face Detection on ARM Linux (Raspberry Pi 4 B)

Method Time FPS Time FPS
Single-thread Single-thread Multi-thread Multi-thread
cnn (CPU, 640x480) 492.99ms 2.03 149.66ms 6.68
cnn (CPU, 320x240) 116.43ms 8.59 34.19ms 29.25
cnn (CPU, 160x120) 27.91ms 35.83 8.43ms 118.64
cnn (CPU, 128x96) 17.94ms 55.74 5.24ms 190.82
  • Minimal face size ~10x10
  • Raspberry Pi 4 B, Broadcom BCM2835, Cortex-A72 (ARMv8) 64-bit SoC @ 1.5GHz

Performance on WIDER Face

Run on default settings: scales=[1.], confidence_threshold=0.3, floating point:

AP_easy=0.856, AP_medium=0.842, AP_hard=0.727

Author

Contributors

All contributors who contribute at GitHub.com are listed here.

The contributors who were not listed at GitHub.com:

  • Jia Wu (吴佳)
  • Dong Xu (徐栋)
  • Shengyin Wu (伍圣寅)

Acknowledgment

The work was partly supported by the Science Foundation of Shenzhen (Grant No. 20170504160426188).

Citation

We published a paper on face detection to evaluate different methods. This project has also been evaluated in the paper.

@article{facedetect-yu,
 author={Yuantao Feng and Shiqi Yu and Hanyang Peng and Yan-ran Li and Jianguo Zhang}
 title={Detect Faces Efficiently: A Survey and Evaluations},
 journal={IEEE Transactions on Biometrics, Behavior, and Identity Science},
 year={2021}
 }

The paper can be open accessed at https://ieeexplore.ieee.org/document/9580485

The loss used in training is EIoU, a novel extended IoU. More details can be found in:

@article{eiou,
 author={Peng, Hanyang and Yu, Shiqi},
 journal={IEEE Transactions on Image Processing}, 
 title={A Systematic IoU-Related Method: Beyond Simplified Regression for Better Localization}, 
 year={2021},
 volume={30},
 pages={5032-5044},
 doi={10.1109/TIP.2021.3077144}
 }

The paper can be open accessed at https://ieeexplore.ieee.org/document/9429909.

Comments
  • Performance far below result with Raspberry Pi 3 B+

    Performance far below result with Raspberry Pi 3 B+

    于老师您好!

    我在用Raspberry Pi 3 B+做调试,看到项目README的结论,这款设备在320x240的图片下,单核性能是8.1fps,多核性能是23.74fps。但是我这边在320x240的实际测试结果,多核只有4.2fps,远远低于前面给出的结论。方便的话,请帮我找找原因,谢谢!

    //下面是一些环境参数

    1. os: 2020-02-13-raspbian-buster-lite
    2. gcc version: 8.3.0 (Raspbian 8.3.0-6+rpi1) (本地编译)
    3. cmake options: AVX512 = OFF AVX2 = OFF NEON = ON OpenMP = TRUE DEMO = ON add_compile_options(-mfpu=neon) (不加编译不通过)
    4. opencv: 3.2.0

    //cmake的输出 -- The C compiler identification is GNU 8.3.0 -- The CXX compiler identification is GNU 8.3.0 -- Check for working C compiler: /usr/bin/cc -- Check for working C compiler: /usr/bin/cc -- works -- Detecting C compiler ABI info -- Detecting C compiler ABI info - done -- Detecting C compile features -- Detecting C compile features - done -- Check for working CXX compiler: /usr/bin/c++ -- Check for working CXX compiler: /usr/bin/c++ -- works -- Detecting CXX compiler ABI info -- Detecting CXX compiler ABI info - done -- Detecting CXX compile features -- Detecting CXX compile features - done fatal: No names found, cannot describe anything. BUILD_VERSION:v0.0.1 Using ENON -- Found OpenMP_C: -fopenmp (found version "4.5") -- Found OpenMP_CXX: -fopenmp (found version "4.5") -- Found OpenMP: TRUE (found version "4.5")
    -- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY -- Performing Test COMPILER_HAS_HIDDEN_VISIBILITY - Success -- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY -- Performing Test COMPILER_HAS_HIDDEN_INLINE_VISIBILITY - Success -- Performing Test COMPILER_HAS_DEPRECATED_ATTR -- Performing Test COMPILER_HAS_DEPRECATED_ATTR - Success -- Found OpenCV: /usr (found version "3.2.0") AVX512 = OFF AVX2 = OFF NEON = ON OpenMP = TRUE DEMO = ON -- Configuring done -- Generating done -- Build files have been written to: /home/pi/dev/libfacedetection/build

    //benchmark的运行结果 pi@raspberrypi:~/dev/libfacedetection/build $ ./benchmark 320_0.jpg There are 4 threads, 4 processors. cnn facedetection average time = 238.36ms | 4.20 FPS

    opened by iamliuyin 19
  • 运行速度比预期慢很多

    运行速度比预期慢很多

    于老师,您好!

    我在windows系统运行图片人脸检测,912*524分辨率的png图片,可以正常完整运行,但是facedetect_cnn 这个函数耗时1903ms,我知道这是不合理的,但是我没有找到原因。电脑配置不差。使用默认的cmakeLists编译的facedetection_export.h,使用detect-image.cpp的示例代码做了一点修改,把图片地址写在代码里的。请问是会是什么原因导致?
    
    opened by johniao 17
  • face detection with thermal images?

    face detection with thermal images?

    Do you have any activity for using your algorithm for detecting face on thermal images? It is very interesting now especially by Corona, where automatical facial temperature detection

    opened by Thanh-Binh 11
  • 读取位置 0xFFFFFFFFFFFFFFFF 时发生访问冲突

    读取位置 0xFFFFFFFFFFFFFFFF 时发生访问冲突

    您好,我用VS2013在x86和x64环境下没有错误提示,但运行示例时libfacedetectcnn-example都出现以下错误提示,请大家帮忙指点: 一直错误提示: 0x000000013F659557 处的第一机会异常(在 LibFaceDetection.exe 中): 0xC0000005: 读取位置 0xFFFFFFFFFFFFFFFF 时发生访问冲突。

    代码停留在: _mm256_store_si256((__m256i*)sumarray, sum_int32x8);

    没有更改过源文件。

    TIM截图20190916100744

    opened by yuanYangSee 11
  • Just ported to android and NOT run as fast as it told,can anyone figure out what is wrong with it?

    Just ported to android and NOT run as fast as it told,can anyone figure out what is wrong with it?

    I ported libfacedetection with jni and build with ndk19, then ran on a Nokia 7 plus android phone which cpu is Qualcomm 660. The face rect is given correctly but took almost 700ms to get the result without couting the convert time of bitmap to rgb. Barely can it run 2fps... And last time I check ,NEON was enabled. Can anyone help me with it ?

    opened by dpmaycry 11
  • Can not alloc memory for data.

    Can not alloc memory for data.

    I use your library in java with jni. And this error happens if i'm run "facedetect_frontal" function about 350-400 times. Can you tell me what mean this error ? How i can resolve it ? Thank you. ` #include "faceSwap_OurNativeLib.h" #include "facedetect-dll.h" #include <opencv2/opencv.hpp> #include #include #include using namespace std; using namespace cv; #define DETECT_BUFFER_SIZE 0x20000

    JNIEXPORT jintArray JNICALL Java_faceswap_OurNativeLib_getPointsAndRec (JNIEnv * env, jobject obj, jlong matAddr, jfloat scale, jint min_neighbors,jint minObjectWidth,jint maxObjectWidth,jint dolandmark) { jintArray rezult = nullptr; Mat * inputMat = (Mat*)matAddr; Mat gray; cvtColor(*inputMat, gray, CV_BGR2GRAY); int * pResults = NULL; //pBuffer is used in the detection functions. //If you call functions in multiple threads, please create one buffer for each thread! unsigned char * pBuffer = (unsigned char *)malloc(DETECT_BUFFER_SIZE); if (!pBuffer) { fprintf(stderr, "Can not alloc buffer.\n"); rezult = env->NewIntArray(1); return rezult; }

    ///////////////////////////////////////////
    // frontal face detection / 68 landmark detection
    // it's fast, but cannot detect side view faces
    //////////////////////////////////////////
    //!!! The input image must be a gray one (single-channel)
    //!!! DO NOT RELEASE pResults !!!
    pResults = facedetect_frontal(pBuffer, (unsigned char*)(gray.ptr(0)), gray.cols, gray.rows, (int)gray.step,
    	scale, min_neighbors, minObjectWidth, maxObjectWidth, dolandmark);
    
    
    if ((*pResults) <= 0)
    {
    	fprintf(stderr, "Nofaces.\n");
    	rezult = env->NewIntArray(1);
    	return rezult;
    }
    
    rezult = env->NewIntArray((*pResults) * 140);
    if (rezult == nullptr)
    {
    	fprintf(stderr, "Can not alloc rezult memory.\n");
    	rezult = env->NewIntArray(1);
    	return rezult;
    }
    //jint bodyOfrezult[140];
    //for (int i = 0; i < (pResults ? *pResults : 0); i++)
    //{
    //	short * p = ((short*)(pResults + 1)) + 142 * i;
    //	for (int k = 0; k < 4; k++)
    //	{
    //		bodyOfrezult[k] = p[k];
    //	}
    //	if (dolandmark)
    //	{
    //		for (int j = 4; j < 140; j++)
    //		{
    //			bodyOfrezult[j] = ((int)p[2 + j]);
    //		}
    //		env->SetIntArrayRegion(rezult, i * 140, 140 , bodyOfrezult);
    //	}
    //}
    free(pBuffer);
    gray.release();
    return rezult;
    

    }

    `

    opened by ussernamenikita 11
  • 🔥🔥🔥  [Guide]  How to use this lib in iOS

    🔥🔥🔥 [Guide] How to use this lib in iOS

    This lib is very useful! I try it in iOS and successful run.

    1. download or clone this lib in your computer;
    2. create New Xcode project;
    3. add this lib's src to your project;
    4. add the system lib libc++.tbd and other you need framework(eg. ACFoundation.framework etc.);
    5. download opencv2.framework and add it in your project;
    6. follow the example file to write the code.

    !!!

    1. modify facedetectcnn.h
    //#define _ENABLE_AVX2 //Please enable it if X64 CPU
    #define _ENABLE_NEON //Please enable it if ARM CPU
    
    1. modify .m to .mm
    2. import lib in your .mm
    #import <opencv2/opencv.hpp>
    #import <opencv2/imgcodecs/ios.h>
    #import "ViewController.h"
    #import "facedetectcnn.h"
    

    you must import the opencv2/opencv.hpp first !!!

    MyCode:

    #import <opencv2/opencv.hpp>
    #import <opencv2/imgcodecs/ios.h>
    #import "ViewController.h"
    #import "facedetectcnn.h"
    
    //define the buffer size. Do not change the size!
    #define DETECT_BUFFER_SIZE 0x20000
    using namespace cv;
    
    @implementation ViewController
    
    - (UIImage *)loadImageAndDectect:(const char *)image_file{
        Mat img = imread(image_file);
        if (img.empty()) {
            fprintf(stderr, "Can not load the image file %s.\n", image_file);
            return nil;
        }
        
        int *pResults = NULL;
        unsigned char * pBuffer = (unsigned char *)malloc(DETECT_BUFFER_SIZE);
        if (!pBuffer) {
            fprintf(stderr, "Can not alloc buffer.\n");
            return nil;
        }
        pResults = facedetect_cnn(pBuffer, (unsigned char *)(img.ptr(0)), img.cols, img.rows, (int)img.step);
        printf("%d faces detected.\n", (pResults ? *pResults : 0));
        Mat result_cnn = img.clone();;
        //print the detection results
        for(int i = 0; i < (pResults ? *pResults : 0); i++)
        {
            short * p = ((short*)(pResults+1))+142*i;
            int x = p[0];
            int y = p[1];
            int w = p[2];
            int h = p[3];
            int neighbors = p[4];
            int angle = p[5];
            
            printf("face_rect=[%d, %d, %d, %d], neighbors=%d, angle=%d\n", x,y,w,h,neighbors, angle);
            rectangle(result_cnn, cv::Rect(x, y, w, h), Scalar(0, 255, 0), 2);
        }
        
        free(pBuffer);
        
        return MatToUIImage(result_cnn);
    }
    
    
    - (void)viewDidLoad {
        [super viewDidLoad];
        // Do any additional setup after loading the view, typically from a nib.
        
        UIImageView *imageView = [[UIImageView alloc] initWithFrame:[UIScreen mainScreen].bounds];
        imageView.contentMode = UIViewContentModeScaleAspectFit;
        [self.view addSubview:imageView];
        
        NSString *path = [[NSBundle mainBundle] pathForResource:@"test" ofType:@".jpg"];
        
        imageView.image = [self loadImageAndDectect:[path UTF8String]];
    }
    
    
    @end
    

    IMG_0428 IMG_0429 IMG_0430

    opened by zycslog 10
  • CMakeLists.txt doesn't work

    CMakeLists.txt doesn't work

    lvmc@X450LD:~/Projects/libfacedetection/build$ make -j4
    [ 16%] Building CXX object CMakeFiles/demo.dir/src/facedetectcnn.cpp.o
    /home/lvmc/Projects/libfacedetection/src/facedetectcnn.cpp: In function ‘float dotProductFloatChGeneral(float*, float*, int, int)’:
    /home/lvmc/Projects/libfacedetection/src/facedetectcnn.cpp:115:39: warning: AVX vector return without AVX enabled changes the ABI [-Wpsabi]
         __m256 sumvec = _mm256_setzero_ps();
                                           ^
    In file included from /usr/lib/gcc/x86_64-linux-gnu/7/include/immintrin.h:41:0,
                     from /home/lvmc/Projects/libfacedetection/src/facedetectcnn.h:54,
                     from /home/lvmc/Projects/libfacedetection/src/facedetectcnn.cpp:39:
    /usr/lib/gcc/x86_64-linux-gnu/7/include/avxintrin.h:1227:1: error: inlining failed in call to always_inline ‘__m256 _mm256_setzero_ps()’: target specific option mismatch
     _mm256_setzero_ps (void)
     ^~~~~~~~~~~~~~~~~
    /home/lvmc/Projects/libfacedetection/src/facedetectcnn.cpp:115:38: note: called from here
         __m256 sumvec = _mm256_setzero_ps();
                         ~~~~~~~~~~~~~~~~~^~
    In file included from /usr/lib/gcc/x86_64-linux-gnu/7/include/immintrin.h:85:0,
                     from /home/lvmc/Projects/libfacedetection/src/facedetectcnn.h:54,
                     from /home/lvmc/Projects/libfacedetection/src/facedetectcnn.cpp:39:
    /usr/lib/gcc/x86_64-linux-gnu/7/include/fmaintrin.h:63:1: error: inlining failed in call to always_inline ‘__m256 _mm256_fmadd_ps(__m256, __m256, __m256)’: target specific option mismatch
     _mm256_fmadd_ps (__m256 __A, __m256 __B, __m256 __C)
     ^~~~~~~~~~~~~~~
    /home/lvmc/Projects/libfacedetection/src/facedetectcnn.cpp:127:33: note: called from here
             sumvec = _mm256_fmadd_ps(avec, bvec, sumvec);
                      ~~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~~~~~
    In file included from /usr/lib/gcc/x86_64-linux-gnu/7/include/immintrin.h:41:0,
                     from /home/lvmc/Projects/libfacedetection/src/facedetectcnn.h:54,
                     from /home/lvmc/Projects/libfacedetection/src/facedetectcnn.cpp:39:
    /usr/lib/gcc/x86_64-linux-gnu/7/include/avxintrin.h:871:1: error: inlining failed in call to always_inline ‘__m256 _mm256_load_ps(const float*)’: target specific option mismatch
     _mm256_load_ps (float const *__P)
     ^~~~~~~~~~~~~~
    /home/lvmc/Projects/libfacedetection/src/facedetectcnn.cpp:120:14: note: called from here
             bvec = _mm256_load_ps(p2 + i);
             ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
    In file included from /usr/lib/gcc/x86_64-linux-gnu/7/include/immintrin.h:41:0,
                     from /home/lvmc/Projects/libfacedetection/src/facedetectcnn.h:54,
                     from /home/lvmc/Projects/libfacedetection/src/facedetectcnn.cpp:39:
    /usr/lib/gcc/x86_64-linux-gnu/7/include/avxintrin.h:871:1: error: inlining failed in call to always_inline ‘__m256 _mm256_load_ps(const float*)’: target specific option mismatch
     _mm256_load_ps (float const *__P)
     ^~~~~~~~~~~~~~
    /home/lvmc/Projects/libfacedetection/src/facedetectcnn.cpp:119:14: note: called from here
             avec = _mm256_load_ps(p1 + i);
             ~~~~~^~~~~~~~~~~~~~~~~~~~~~~~
    In file included from /usr/lib/gcc/x86_64-linux-gnu/7/include/immintrin.h:41:0,
                     from /home/lvmc/Projects/libfacedetection/src/facedetectcnn.h:54,
                     from /home/lvmc/Projects/libfacedetection/src/facedetectcnn.cpp:39:
    /usr/lib/gcc/x86_64-linux-gnu/7/include/avxintrin.h:269:1: error: inlining failed in call to always_inline ‘__m256 _mm256_hadd_ps(__m256, __m256)’: target specific option mismatch
     _mm256_hadd_ps (__m256 __X, __m256 __Y)
     ^~~~~~~~~~~~~~
    /home/lvmc/Projects/libfacedetection/src/facedetectcnn.cpp:131:28: note: called from here
         sumvec = _mm256_hadd_ps(sumvec, sumvec);
                  ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
    In file included from /usr/lib/gcc/x86_64-linux-gnu/7/include/immintrin.h:41:0,
                     from /home/lvmc/Projects/libfacedetection/src/facedetectcnn.h:54,
                     from /home/lvmc/Projects/libfacedetection/src/facedetectcnn.cpp:39:
    /usr/lib/gcc/x86_64-linux-gnu/7/include/avxintrin.h:269:1: error: inlining failed in call to always_inline ‘__m256 _mm256_hadd_ps(__m256, __m256)’: target specific option mismatch
     _mm256_hadd_ps (__m256 __X, __m256 __Y)
     ^~~~~~~~~~~~~~
    /home/lvmc/Projects/libfacedetection/src/facedetectcnn.cpp:132:28: note: called from here
         sumvec = _mm256_hadd_ps(sumvec, sumvec);
                  ~~~~~~~~~~~~~~^~~~~~~~~~~~~~~~
    CMakeFiles/demo.dir/build.make:134: recipe for target 'CMakeFiles/demo.dir/src/facedetectcnn.cpp.o' failed
    make[2]: *** [CMakeFiles/demo.dir/src/facedetectcnn.cpp.o] Error 1
    CMakeFiles/Makefile2:67: recipe for target 'CMakeFiles/demo.dir/all' failed
    make[1]: *** [CMakeFiles/demo.dir/all] Error 2
    Makefile:83: recipe for target 'all' failed
    make: *** [all] Error 2
    
    opened by Grabber 9
  • undefined reference to `facedetect_cnn(unsigned char*, unsigned char*, int, int, int)'

    undefined reference to `facedetect_cnn(unsigned char*, unsigned char*, int, int, int)'

    我在Ubantu上运行g++ libfacedetectcnn-example.cpp ./test.jpg -O3 pkg-config --libs --cflags opencv4 undefined reference to `facedetect_cnn(unsigned char*, unsigned char*, int, int, int)', 我已经加头文件了啊

    opened by Adhders 9
  • How to Use Android Platform??

    How to Use Android Platform??

    Why is it that after I migrated to Android, the recognition time of keliamoniz1.jpg in the sample image was 2800 milliseconds?

    This is my CMakeList.txt:

    cmake_minimum_required(VERSION 3.4.1)
    
    SET(CMAKE_BUILD_TYPE Release)
    
    set(CMAKE_SYSTEM_NAME Linux)
    set(CMAKE_SYSTEM_VERSION 1)
    set(CMAKE_SYSTEM_PROCESSOR "aarch64")
    
    add_definitions(-O3)
    
    add_definitions(-D_ENABLE_INT8)
    #add_definitions(-D_ENABLE_AVX2)
    
    SET(CMAKE_C_FLAGS "$ENV{CFLAGS} -O3 -Wall")
    set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -std=gnu++11 -O3 -pthread")
    SET(CMAKE_CXX_FLAGS_RELEASE "$ENV{CXXFLAGS} -O3 -Wall")
    
    #set(CMAKE_C_COMPILER_ABI armeabi-v7a)
    
    set(OPENCV_PATH /home/ww/Downloads/OpenCV-android-sdk)
    set(CMAKE_VERBOSE_MAKEFILE on)
    
    include_directories(${OPENCV_PATH}/sdk/native/jni/include)
    add_library(lib_opencv STATIC IMPORTED)
    set_target_properties(lib_opencv
            PROPERTIES
            IMPORTED_LOCATION ${PROJECT_SOURCE_DIR}/src/main/jniLibs/${ANDROID_ABI}/libopencv_java4.so
            )
    
    add_library( 
            native-lib
    
            SHARED
    
            src/main/cpp/native-lib.cpp
            src/main/cpp/facedetectcnn.cpp
            src/main/cpp/facedetectcnn-floatdata.cpp
            src/main/cpp/facedetectcnn-int8data.cpp
            src/main/cpp/facedetectcnn-model.cpp
            )
    
    find_library( 
            log-lib
            log)
    
    target_link_libraries( 
            native-lib
            ${log-lib}
            lib_opencv
            )
    

    Android device CPU is : mtk6737

    opened by xiaomochen520 8
  • 多线程调用

    多线程调用

    您好,11 月 10 日更新的这个版本您说的是可以在多线程调用,但是我用 VS2015(以及 opencv 3.1)测试发现,还是没法多线程同时调用啊,必须要加锁。 另外,您提供的 dll 似乎是 VS2010 编译的,而新版的接口里面用到了 vector,编译器版本不匹配时在 vector 析构的时候就会出现问题,除非调用之前为 vector 预留足够的空间。

    opened by sean028 8
  • 关于facedetect_cnn函数定义

    关于facedetect_cnn函数定义

    我在facedetectcnn-model.cpp中找到了facedetect_cnn函数的定义,注释写着“input image, it must be RGB (three-channel) image!”而在头文件中facedetectcnn.h写着"input image, it must be BGR (three channels) insteed of RGB image!"。我觉得虽然是个小问题,但不一致的代码注释可能引起阅读混乱?

    opened by biepenghaomie 0
  • [MSVC] Libfacedetection build failed due to error C2039: 'to_string': is not a member of 'std'

    [MSVC] Libfacedetection build failed due to error C2039: 'to_string': is not a member of 'std'

    Description: Recently, we updated the commit of bitcoin for MSVC RWC testing, it failed to build due to the error C2039 and error C3861 like below, could you please help take a look? Thanks.

    F:\gitP\ShiqiYu\libfacedetection\src\facedetectcnn.cpp(638,17): error C2039: 'to_string': is not a member of 'std' [F:\gitP\ShiqiYu\libfacedetection\build_amd64\facedetection.vcxproj]
             F:\gitP\ShiqiYu\libfacedetection\src\facedetectcnn.cpp(638,26): error C3861: 'to_string': identifier not found [F:\gitP\ShiqiYu\libfacedetection\build_amd64\facedetection.vcxproj]
    

    Expected behavior: Build successfully.

    Actual behavior: Build failed with error C2039 and error C3861

    To reprodece:

    1. open VS2019 x64 Native Tools command.
    2. git clone https://github.com/ShiqiYu/libfacedetection F:\gitP\ShiqiYu\libfacedetection
    3. mkdir F:\gitP\ShiqiYu\libfacedetection\build_amd64 and cd F:\gitP\ShiqiYu\libfacedetection\build_amd64
    4. cmake -G "Visual Studio 16 2019" -A x64 -DCMAKE_SYSTEM_VERSION=10.0.18362.0 -DCMAKE_INSTALL_PREFIX=install -DBUILD_SHARED_LIBS=ON -DCMAKE_BUILD_TYPE=Release -DDEMO=OFF ..
    5. msbuild /m /p:Platform=x64 /p:Configuration=Release libfacedetection.sln /t:Rebuild

    More info: The commit of Libfacedetection we use: 4092665 VS version: VS2019 (v16.11.20)

    Detailed log: build.log

    opened by Zhaojun-Liu 2
  • Is 150ms normal for AMD Ryzen 5 3550H in Single-thread?

    Is 150ms normal for AMD Ryzen 5 3550H in Single-thread?

    I ran the detect-camera.cpp in example, and the average time consumption of face detection is 150ms. The environment is:

    • AMD Ryzen 5 3550H
    • 16GB RAM
    • Microsoft Visual Studio 2022

    By the way, I have enabled AVX2 and -O2 optimization when compling.

    opened by YjFnajEz 3
  • Problem about FDDB score

    Problem about FDDB score

    教授您好,有鉴于您的测试性能与精度相当地高,我使用您的模型测试FDDB的结果如下(红框部分):

    我想请问教授这个测试结果是正常的吗,我有看到有些评测说您的模型可达到 0.994 平均精度(AP),但我的测试都只达到0.968左右,

    我目前是个程式菜鸟,有些地方不太了解其中的意义,如果有什么地方有做错或少做的话请您给与指教,谢谢!

    opened by asiagodtonegg3beo 2
  • Upside-down images

    Upside-down images

    dotted_3 dotted_Right

    Good morning. How can I implement processing of upside-down images? Looks like keypoints are the same, so I can't just check them and rotate image. Is there any tool or hint to work with that images?

    Thank you.

    opened by snolentinque 1
Releases(v3.0)
Owner
Shiqi Yu
Associate Professor, Department of Computer Science and Engineering, Southern University of Science and Technology, Shenzhen, China.
Shiqi Yu
🍅🍅🍅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

pogg 1.5k Jan 5, 2023
Face Library is an open source package for accurate and real-time face detection and recognition

Face Library Face Library is an open source package for accurate and real-time face detection and recognition. The package is built over OpenCV and us

null 52 Nov 9, 2022
Learning to Reach Goals via Iterated Supervised Learning

Vanilla GCSL This repository contains a vanilla implementation of "Learning to Reach Goals via Iterated Supervised Learning" proposed by Dibya Gosh et

Christoph Heindl 4 Aug 10, 2022
An image base contains 490 images for learning (400 cars and 90 boats), and another 21 images for testingAn image base contains 490 images for learning (400 cars and 90 boats), and another 21 images for testing

SVM Données Une base d’images contient 490 images pour l’apprentissage (400 voitures et 90 bateaux), et encore 21 images pour fait des tests. Prétrait

Achraf Rahouti 3 Nov 30, 2021
PaddleRobotics is an open-source algorithm library for robots based on Paddle, including open-source parts such as human-robot interaction, complex motion control, environment perception, SLAM positioning, and navigation.

简体中文 | English PaddleRobotics paddleRobotics是基于paddle的机器人开源算法库集,包括人机交互、复杂运动控制、环境感知、slam定位导航等开源算法部分。 人机交互 主动多模交互技术TFVT-HRI 主动多模交互技术是通过视觉、语音、触摸传感器等输入机器人

null 185 Dec 26, 2022
Face Synthetics dataset is a collection of diverse synthetic face images with ground truth labels.

The Face Synthetics dataset Face Synthetics dataset is a collection of diverse synthetic face images with ground truth labels. It was introduced in ou

Microsoft 608 Jan 2, 2023
It is a simple library to speed up CLIP inference up to 3x (K80 GPU)

CLIP-ONNX It is a simple library to speed up CLIP inference up to 3x (K80 GPU) Usage Install clip-onnx module and requirements first. Use this trick !

Gerasimov Maxim 93 Dec 20, 2022
Vehicle speed detection with python

Vehicle-speed-detection In the project simulate the tracker.py first then simulate the SpeedDetector.py. Finally, a new window pops up and the output

null 3 Dec 15, 2022
LaneDet is an open source lane detection toolbox based on PyTorch that aims to pull together a wide variety of state-of-the-art lane detection models

LaneDet is an open source lane detection toolbox based on PyTorch that aims to pull together a wide variety of state-of-the-art lane detection models. Developers can reproduce these SOTA methods and build their own methods.

TuZheng 405 Jan 4, 2023
A python library for face detection and features extraction based on mediapipe library

FaceAnalyzer A python library for face detection and features extraction based on mediapipe library Introduction FaceAnalyzer is a library based on me

Saifeddine ALOUI 14 Dec 30, 2022
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

Vítor Albiero 519 Dec 29, 2022
Code for HLA-Face: Joint High-Low Adaptation for Low Light Face Detection (CVPR21)

HLA-Face: Joint High-Low Adaptation for Low Light Face Detection The official PyTorch implementation for HLA-Face: Joint High-Low Adaptation for Low L

Wenjing Wang 77 Dec 8, 2022
AI Face Mesh: This is a simple face mesh detection program based on Artificial intelligence.

AI Face Mesh: This is a simple face mesh detection program based on Artificial Intelligence which made with Python. It's able to detect 468 different

Md. Rakibul Islam 1 Jan 13, 2022
Official implementation of "Can You Spot the Chameleon? Adversarially Camouflaging Images from Co-Salient Object Detection" in CVPR 2022.

Jadena Official implementation of "Can You Spot the Chameleon? Adversarially Camouflaging Images from Co-Salient Object Detection" in CVPR 2022. arXiv

Qing Guo 13 Nov 29, 2022
This project contains an implemented version of Face Detection using OpenCV and Mediapipe. This is a code snippet and can be used in projects.

Live-Face-Detection Project Description: In this project, we will be using the live video feed from the camera to detect Faces. It will also detect so

Hassan Shahzad 3 Oct 2, 2021
A Neural Net Training Interface on TensorFlow, with focus on speed + flexibility

Tensorpack is a neural network training interface based on TensorFlow. Features: It's Yet Another TF high-level API, with speed, and flexibility built

Tensorpack 6.2k Jan 1, 2023
A Neural Net Training Interface on TensorFlow, with focus on speed + flexibility

Tensorpack is a neural network training interface based on TensorFlow. Features: It's Yet Another TF high-level API, with speed, and flexibility built

Tensorpack 6.2k Jan 9, 2023