diff --git a/.travis.yml b/.travis.yml index af46fde2..45dfd7ad 100644 --- a/.travis.yml +++ b/.travis.yml @@ -59,7 +59,6 @@ before_install: brew install tbb; brew tap homebrew/science; brew install opencv3; - brew install openblas; brew upgrade boost; fi diff --git a/cmake/modules/FindBLAS.cmake b/cmake/modules/FindBLAS.cmake index 334a2627..603fb78d 100644 --- a/cmake/modules/FindBLAS.cmake +++ b/cmake/modules/FindBLAS.cmake @@ -438,6 +438,20 @@ if (BLA_VENDOR MATCHES "ACML" OR BLA_VENDOR STREQUAL "All") endif() endif () # ACML +# Apple BLAS library? +if (BLA_VENDOR STREQUAL "Apple" OR BLA_VENDOR STREQUAL "All") +if(NOT BLAS_LIBRARIES) + check_fortran_libraries( + BLAS_LIBRARIES + BLAS + dgemm + "" + "Accelerate" + "" + ) + endif() +endif () + if (BLA_VENDOR STREQUAL "NAS" OR BLA_VENDOR STREQUAL "All") if ( NOT BLAS_LIBRARIES ) check_fortran_libraries( diff --git a/gui/OpenFaceOffline/MainWindow.xaml.cs b/gui/OpenFaceOffline/MainWindow.xaml.cs index 9008df65..1531c357 100644 --- a/gui/OpenFaceOffline/MainWindow.xaml.cs +++ b/gui/OpenFaceOffline/MainWindow.xaml.cs @@ -235,7 +235,7 @@ namespace OpenFaceOffline // Setup recording RecorderOpenFaceParameters rec_params = new RecorderOpenFaceParameters(true, reader.IsWebcam(), Record2DLandmarks, Record3DLandmarks, RecordModelParameters, RecordPose, RecordAUs, - RecordGaze, RecordHOG, RecordTracked, RecordAligned, + RecordGaze, RecordHOG, RecordTracked, RecordAligned, false, reader.GetFx(), reader.GetFy(), reader.GetCx(), reader.GetCy(), reader.GetFPS()); RecorderOpenFace recorder = new RecorderOpenFace(reader.GetName(), rec_params, record_root); @@ -357,7 +357,7 @@ namespace OpenFaceOffline // Setup recording RecorderOpenFaceParameters rec_params = new RecorderOpenFaceParameters(false, false, Record2DLandmarks, Record3DLandmarks, RecordModelParameters, RecordPose, RecordAUs, - RecordGaze, RecordHOG, RecordTracked, RecordAligned, + RecordGaze, RecordHOG, RecordTracked, RecordAligned, true, reader.GetFx(), reader.GetFy(), reader.GetCx(), reader.GetCy(), 0); RecorderOpenFace recorder = new RecorderOpenFace(reader.GetName(), rec_params, record_root); diff --git a/lib/local/CppInerop/RecorderInterop.h b/lib/local/CppInerop/RecorderInterop.h index 8a710ae3..95e9544b 100644 --- a/lib/local/CppInerop/RecorderInterop.h +++ b/lib/local/CppInerop/RecorderInterop.h @@ -58,12 +58,12 @@ namespace UtilitiesOF { public: RecorderOpenFaceParameters(bool sequence, bool is_from_webcam, bool output_2D_landmarks, bool output_3D_landmarks, bool output_model_params, bool output_pose, bool output_AUs, bool output_gaze, bool output_hog, bool output_tracked, - bool output_aligned_faces, float fx, float fy, float cx, float cy, double fps_vid_out) + bool output_aligned_faces, bool record_bad_aligned, float fx, float fy, float cx, float cy, double fps_vid_out) { m_params = new Utilities::RecorderOpenFaceParameters(sequence, is_from_webcam, output_2D_landmarks, output_3D_landmarks, output_model_params, output_pose, output_AUs, - output_gaze, output_hog, output_tracked, output_aligned_faces, fx, fy, cx, cy, fps_vid_out); + output_gaze, output_hog, output_tracked, output_aligned_faces, record_bad_aligned, fx, fy, cx, cy, fps_vid_out); } diff --git a/lib/local/LandmarkDetector/src/CCNF_patch_expert.cpp b/lib/local/LandmarkDetector/src/CCNF_patch_expert.cpp index 00972202..37ee7d91 100644 --- a/lib/local/LandmarkDetector/src/CCNF_patch_expert.cpp +++ b/lib/local/LandmarkDetector/src/CCNF_patch_expert.cpp @@ -329,8 +329,9 @@ void CCNF_patch_expert::Read(ifstream &stream, std::vector window_sizes, st } // In case we are using OpenBLAS, make sure it is not multi-threading as we are multi-threading outside of it - //goto_set_num_threads(1); - openblas_set_num_threads(1); + #ifndef __APPLE__ + openblas_set_num_threads(1); + #endif int n_sigmas = window_sizes.size(); diff --git a/lib/local/LandmarkDetector/src/CEN_patch_expert.cpp b/lib/local/LandmarkDetector/src/CEN_patch_expert.cpp index 455e8309..c4b18571 100644 --- a/lib/local/LandmarkDetector/src/CEN_patch_expert.cpp +++ b/lib/local/LandmarkDetector/src/CEN_patch_expert.cpp @@ -91,9 +91,10 @@ void CEN_patch_expert::Read(ifstream &stream) { // Setting up OpenBLAS - //goto_set_num_threads(1); - openblas_set_num_threads(1); - + #ifndef __APPLE__ + openblas_set_num_threads(1); + #endif + // Sanity check int read_type; diff --git a/lib/local/LandmarkDetector/src/FaceDetectorMTCNN.cpp b/lib/local/LandmarkDetector/src/FaceDetectorMTCNN.cpp index 4a790e0d..46681bf4 100644 --- a/lib/local/LandmarkDetector/src/FaceDetectorMTCNN.cpp +++ b/lib/local/LandmarkDetector/src/FaceDetectorMTCNN.cpp @@ -285,9 +285,11 @@ void CNN::ClearPrecomp() void CNN::Read(const string& location) { - //goto_set_num_threads(1); - openblas_set_num_threads(1); - + + #ifndef __APPLE__ + openblas_set_num_threads(1); + #endif + ifstream cnn_stream(location, ios::in | ios::binary); if (cnn_stream.is_open()) {