重點(diǎn)的事說三遍:
遇到段錯誤segmentation fault:11临扮、XXX not found之類的報(bào)錯讲岁,(1)檢查路徑(2)重啟翩活。
遇到段錯誤segmentation fault:11拂檩、XXX not found之類的報(bào)錯吗冤,(1)檢查路徑(2)重啟又厉。
遇到段錯誤segmentation fault:11九府、XXX not found之類的報(bào)錯,(1)檢查路徑(2)重啟覆致。
編譯FaceIdentification
(1)進(jìn)入到FaceIdentification文件目錄下
mkdir build建立build文件夾
(2)將FaceDetection/include/face_detection.h和FaceAlignment/include/face_alignment.h拷貝到FaceIdentification/include中
(3)將FaceDetection/model/seeta_fd_frontal_v1.0.bin和FaceAlignment/model/seeta_fa_v1.1.bin拷貝到FaceIdentification/build中侄旬;將FaceDetection/build/libseeta_facesdet_lib.dylib和FaceAlignment/build/libseeta_fa_lib.dylib拷貝到FaceIdentification/build中
(4)解壓縮FaceIdentification/model中的文件
(5)修改FaceIdentification/src/test/CMakeLists.txt文件內(nèi)容,替換的內(nèi)容如下:
aux_source_directory (. SRC_LIST)
link_directories(${PROJECT_BINARY_DIR})
message(${SRC_LIST})
# add external libraries
find_package(OpenCV REQUIRED)
include_directories(${seeta_facedet_lib_INCLUDE_DIRS}${seeta_fa_lib_INCLUDE_DIRS})
list(APPEND seeta_fi_lib_required_libs ${OpenCV_LIBS}seeta_facedet_lib seeta_fa_lib)
enable_testing ()
foreach (f ${SRC_LIST})
string(REGEXREPLACE "[.]cpp" ".bin" BIN ${f})
add_executable(${BIN}${f})
#target_link_libraries(${BIN} viplnet ${OpenCV_LIBS} seeta_facede_libseeta_fa_lib)
target_link_libraries(${BIN} viplnet ${seeta_fi_lib_required_libs})
endforeach ()
修改后結(jié)果如圖:
(6)修改FaceIdentification/src/test/test_face_recognizer.cpp和test_face_verification.cpp文件煌妈,添加如下內(nèi)容頭文件:
#include <opencv2/opencv.hpp>
#include<opencv2/highgui/highgui.hpp>
#include<opencv2/imgproc/imgproc.hpp>
(7)按照自己的保存路徑儡羔,修改兩個(gè)文件/model和/data的路徑。
(8)編譯
cmake ..
make
(9)運(yùn)行
./build/src/test/test_face_recognizer.bin #3個(gè)單元測試函數(shù)
./build/src/test/test_face_verification.bin #比較兩個(gè)圖像相似度
測的是/Users/SEU-Li/SeetaFaceEngine/FaceIdentification/data/test_face_recognizer/images/compare_im文件中兩幅圖片的相似度