• Seetaface 向树莓派 移植


    seetaface由中科院计算所山世光研究员带领的人脸识别研究组研发。代码基于C++实现,不依赖第三方库。然而,目前开源的代码,是在windows vs上编译的,对于我们这帮mac/linux用户来说,用起来还是挺麻烦的。网上也有不少关于Linux的编译过程详解。然而针对嵌入式平台的移植依然少见:
     
     
    安装seetaface
    1 git clone https://github.com/seetaface/SeetaFaceEngine.git
    2 cd SeetaFaceEngine
    3 cd FaceDetection/
    4 vim CMakeLists.txt

    修改 set(USE_SSE "Set to ON to Build use SSE" OFF)

    mkdir build
    cd build
    cmake ..
    make -j4

    =================================================完

    1 cd FaceAlignment/
    2 vim CMakeLists.txt

    #注释 set(CMAKE_CXX_FLAGS "${CMAKE_CXX_FLAGS} -msse4.1")

    1 mkdir build/
    2 cd build
    3 cmake ..
    4 cp FaceDetection/build/libseeta_facedet_lib.so .
    5 export CPLUS_INCLUDE_PATH=/home/pi/SeetaFaceEngine/FaceDetection/inlude/
    6 make -j4

    ====================================================完

    1 cd FaceIdentification/
    2 vim CMakeLists.txt

      修改 set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -std=c++11 -O2")

      为:set(CMAKE_CXX_FLAGS_RELEASE "${CMAKE_CXX_FLAGS} -std=c++11 -O2 -L /home/pi/SeetaFaceEngine/FaceAlignment/build -lseeta_facedet_lib -lseeta_fa_lib")
    mkdir build/cd build/
    vim ../src/math_functions.cpp

      注释

    1  //#include<xmmintrin.h>
    2 
    3   
    4   /*
    5   #ifdef _WIN32
    6   #include <intrin.h>
    7   #else
    8   #include <x86intrin.h>
    9   */

    注释函数simd_dot()

    改写为:
    1   float simd_dot(const float* x, const float* y, const long& len){
    2     float inner_prod = 0.0f;
    3     long i;
    4     for(i = 0; i < len; i++){
    5       inner_prod += x[i] * y[i];
    6     }
    7     return inner_prod;
    8   }
    1 export CPLUS_INCLUDE_PATH=$CPLUS_INCLUDE_PATH:/home/pi/SeetaFaceEngine/FaceAlignment/include
    2 cmake ..
    3 cp ../../FaceAlignment/build/*.so .
    4 vim ../src/test/test_face_recognizer.cpp
      增加:
    1   #include <opencv2/opencv.hpp>
    2   #include <opencv2/imgproc/imgproc.hpp>
    vim ../src/test/test_face_verification.cpp

      增加:

    1   #include <opencv2/opencv.hpp>
    2   #include <opencv2/imgproc/imgproc.hpp>
    make -j4
     
    ========================================完
    乔思祎 2017年9月29日
  • 相关阅读:
    注意事项 软件连接的数据库是设置输出的数据库,弄错会造成数据库不一致
    归并排序
    快速排序
    冒泡排序
    插入排序
    上次遗留下来的XMLUtil的问题
    关于子网掩码
    java.lang.InstantiationException
    java.lang.ExceptionInInitializerError
    关于HashMap中的负载因子
  • 原文地址:https://www.cnblogs.com/pandaroll/p/7609284.html
Copyright © 2020-2023  润新知