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的运行结果 [email protected]:~/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

    [email protected]:~/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
Mahadi-Now - This Is Pakistani Just Now Login Tools

PAKISTANI JUST NOW LOGIN TOOLS Install apt update apt upgrade apt install python

MAHADI HASAN AFRIDI 19 Apr 06, 2022
Official Implementation of "DialogLM: Pre-trained Model for Long Dialogue Understanding and Summarization."

DialogLM Code for AAAI 2022 paper: DialogLM: Pre-trained Model for Long Dialogue Understanding and Summarization. Pre-trained Models We release two ve

Microsoft 92 Dec 19, 2022
Collects many various multi-modal transformer architectures, including image transformer, video transformer, image-language transformer, video-language transformer and related datasets

The repository collects many various multi-modal transformer architectures, including image transformer, video transformer, image-language transformer, video-language transformer and related datasets

Jun Chen 139 Dec 21, 2022
Scripts of Machine Learning Algorithms from Scratch. Implementations of machine learning models and algorithms using nothing but NumPy with a focus on accessibility. Aims to cover everything from basic to advance.

Algo-ScriptML Python implementations of some of the fundamental Machine Learning models and algorithms from scratch. The goal of this project is not t

Algo Phantoms 81 Nov 26, 2022
PyTorch Implementation of VAENAR-TTS: Variational Auto-Encoder based Non-AutoRegressive Text-to-Speech Synthesis.

VAENAR-TTS - PyTorch Implementation PyTorch Implementation of VAENAR-TTS: Variational Auto-Encoder based Non-AutoRegressive Text-to-Speech Synthesis.

Keon Lee 67 Nov 14, 2022
Ἀνατομή is a PyTorch library to analyze representation of neural networks

Ἀνατομή is a PyTorch library to analyze representation of neural networks

Ryuichiro Hataya 50 Dec 05, 2022
Build and run Docker containers leveraging NVIDIA GPUs

NVIDIA Container Toolkit Introduction The NVIDIA Container Toolkit allows users to build and run GPU accelerated Docker containers. The toolkit includ

NVIDIA Corporation 15.6k Jan 01, 2023
StyleGAN2-ada for practice

This version of the newest PyTorch-based StyleGAN2-ada is intended mostly for fellow artists, who rarely look at scientific metrics, but rather need a working creative tool. Tested on Python 3.7 + Py

vadim epstein 170 Nov 16, 2022
This is official implementaion of paper "Token Shift Transformer for Video Classification".

This is official implementaion of paper "Token Shift Transformer for Video Classification". We achieve SOTA performance 80.40% on Kinetics-400 val. Paper link

VideoNet 60 Dec 30, 2022
Code for our WACV 2022 paper "Hyper-Convolution Networks for Biomedical Image Segmentation"

Hyper-Convolution Networks for Biomedical Image Segmentation Code for our WACV 2022 paper "Hyper-Convolution Networks for Biomedical Image Segmentatio

Tianyu Ma 17 Nov 02, 2022
Testing and Estimation of structural breaks in Stata

xtbreak estimating and testing for many known and unknown structural breaks in time series and panel data. For an overview of xtbreak test see xtbreak

Jan Ditzen 13 Jun 19, 2022
A simple image/video to Desmos graph converter run locally

Desmos Bezier Renderer A simple image/video to Desmos graph converter run locally Sample Result Setup Install dependencies apt update apt install git

Kevin JY Cui 339 Dec 23, 2022
Discovering and Achieving Goals via World Models

Discovering and Achieving Goals via World Models [Project Website] [Benchmark Code] [Video (2min)] [Oral Talk (13min)] [Paper] Russell Mendonca*1, Ole

Oleg Rybkin 71 Dec 22, 2022
deep learning model that learns to code with drawing in the Processing language

sketchnet sketchnet - processing code generator can we teach a computer to draw pictures with code. We use Processing and java/jruby code paired with

41 Dec 12, 2022
Automatically download the cwru data set, and then divide it into training data set and test data set

Automatically download the cwru data set, and then divide it into training data set and test data set.自动下载cwru数据集,然后分训练数据集和测试数据集

6 Jun 27, 2022
The code used for the free [email protected] Webinar series on Reinforcement Learning in Finance

Reinforcement Learning in Finance [email protected] Webinar This repository provides the code f

Yves Hilpisch 62 Dec 22, 2022
Keyhole Imaging: Non-Line-of-Sight Imaging and Tracking of Moving Objects Along a Single Optical Path

Keyhole Imaging Code & Dataset Code associated with the paper "Keyhole Imaging: Non-Line-of-Sight Imaging and Tracking of Moving Objects Along a Singl

Stanford Computational Imaging Lab 20 Feb 03, 2022
scikit-learn inspired API for CRFsuite

sklearn-crfsuite sklearn-crfsuite is a thin CRFsuite (python-crfsuite) wrapper which provides interface simlar to scikit-learn. sklearn_crfsuite.CRF i

417 Dec 20, 2022
Sync2Gen Code for ICCV 2021 paper: Scene Synthesis via Uncertainty-Driven Attribute Synchronization

Sync2Gen Code for ICCV 2021 paper: Scene Synthesis via Uncertainty-Driven Attribute Synchronization 0. Environment Environment: python 3.6 and cuda 10

Haitao Yang 62 Dec 30, 2022
PipeTransformer: Automated Elastic Pipelining for Distributed Training of Large-scale Models

PipeTransformer: Automated Elastic Pipelining for Distributed Training of Large-scale Models This repository is the official implementation of the fol

DistributedML 41 Dec 06, 2022