diff --git a/.travis.yml b/.travis.yml index 548c3ab6..a936b0d2 100644 --- a/.travis.yml +++ b/.travis.yml @@ -80,4 +80,4 @@ script: - cmake -D CMAKE_BUILD_TYPE=RELEASE CMAKE_CXX_FLAGS="-std=c++11" -D CMAKE_EXE_LINKER_FLAGS="-std=c++11" .. - make - ../build/bin/FaceLandmarkImg -inroot ../samples -f sample1.jpg -out_dir data -of sample1.txt -multi_view 1 -wild -q - - ../build/bin/FeatureExtraction -f "../samples/2015-10-15-15-14.avi" -out_dir output -q \ No newline at end of file + - ../build/bin/FeatureExtraction -fdir "../samples/image_sequence" -out_dir output -q \ No newline at end of file diff --git a/appveyor.yml b/appveyor.yml index b5fbc2ac..af717e48 100644 --- a/appveyor.yml +++ b/appveyor.yml @@ -36,6 +36,6 @@ test_script: - cmd: if exist Release (cd Release) - cmd: dir - cmd: if exist "../samples" (FaceLandmarkImg.exe -inroot ../samples -f sample1.jpg -out_dir out_data -q) else (FaceLandmarkImg.exe -inroot ../../samples -f sample1.jpg -out_dir out_data -q) - - cmd: if exist "../samples" (FaceLandmarkVidMulti.exe -inroot ../samples -f default.wmv -q) else (FaceLandmarkVidMulti.exe -inroot ../../samples -f default.wmv -q) - - cmd: if exist "../samples" (FeatureExtraction.exe -f "../samples/default.wmv" -q) else (FeatureExtraction.exe -f "../../samples/default.wmv" -q) + - cmd: if exist "../samples" (FaceLandmarkVidMulti.exe -fdir ../samples/image_sequence -q) else (FaceLandmarkVidMulti.exe -fdir ../../samples/image_sequence -f default.wmv -q) + - cmd: if exist "../samples" (FeatureExtraction.exe -fdir "../samples/image_sequence" -q) else (FeatureExtraction.exe -fdir "../../samples/image_sequence" -q) - cmd: if exist "../samples" (FaceLandmarkVid.exe -f "../samples/default.wmv" -q) else (FaceLandmarkVid.exe -f "../../samples/default.wmv" -q) diff --git a/lib/local/LandmarkDetector/src/CCNF_patch_expert.cpp b/lib/local/LandmarkDetector/src/CCNF_patch_expert.cpp index cc90dbce..b875a129 100644 --- a/lib/local/LandmarkDetector/src/CCNF_patch_expert.cpp +++ b/lib/local/LandmarkDetector/src/CCNF_patch_expert.cpp @@ -455,7 +455,8 @@ void CCNF_patch_expert::ResponseOpenBlas(const cv::Mat_ &area_of_interest // Perform matrix multiplication in OpenBLAS (fortran call) float alpha1 = 1.0; float beta1 = 0.0; - sgemm_("N", "N", &normalized_input.cols, &weight_matrix.rows, &weight_matrix.cols, &alpha1, (float*)normalized_input.data, &normalized_input.cols, (float*)weight_matrix.data, &weight_matrix.cols, &beta1, (float*)neuron_resp_full.data, &normalized_input.cols); + char *not = "N"; + sgemm_(not, not, &normalized_input.cols, &weight_matrix.rows, &weight_matrix.cols, &alpha1, (float*)normalized_input.data, &normalized_input.cols, (float*)weight_matrix.data, &weight_matrix.cols, &beta1, (float*)neuron_resp_full.data, &normalized_input.cols); // Above is a faster version of this //cv::Mat_ neuron_resp_full = this->weight_matrix * normalized_input; @@ -499,7 +500,8 @@ void CCNF_patch_expert::ResponseOpenBlas(const cv::Mat_ &area_of_interest // Perform matrix multiplication in OpenBLAS (fortran call) alpha1 = 1.0; beta1 = 0.0; - sgemm_("N", "N", &resp_vec_f.cols, &Sigmas[s_to_use].rows, &Sigmas[s_to_use].cols, &alpha1, (float*)resp_vec_f.data, &resp_vec_f.cols, (float*)Sigmas[s_to_use].data, &Sigmas[s_to_use].cols, &beta1, (float*)out.data, &resp_vec_f.cols); + not = "N"; + sgemm_(not, not, &resp_vec_f.cols, &Sigmas[s_to_use].rows, &Sigmas[s_to_use].cols, &alpha1, (float*)resp_vec_f.data, &resp_vec_f.cols, (float*)Sigmas[s_to_use].data, &Sigmas[s_to_use].cols, &beta1, (float*)out.data, &resp_vec_f.cols); // Above is a faster version of this //cv::Mat out = Sigmas[s_to_use] * resp_vec_f; diff --git a/lib/local/LandmarkDetector/src/CEN_patch_expert.cpp b/lib/local/LandmarkDetector/src/CEN_patch_expert.cpp index 6ebf1a1e..e961dcb1 100644 --- a/lib/local/LandmarkDetector/src/CEN_patch_expert.cpp +++ b/lib/local/LandmarkDetector/src/CEN_patch_expert.cpp @@ -246,7 +246,8 @@ void CEN_patch_expert::Response(const cv::Mat_ &area_of_interest, cv::Mat // Perform matrix multiplication in OpenBLAS (fortran call) float alpha1 = 1.0; float beta1 = 0.0; - sgemm_("N", "N", &resp.cols, &weight.rows, &weight.cols, &alpha1, m1, &resp.cols, m2, &weight.cols, &beta1, m3, &resp.cols); + char *not = "N"; + sgemm_(not, not, &resp.cols, &weight.rows, &weight.cols, &alpha1, m1, &resp.cols, m2, &weight.cols, &beta1, m3, &resp.cols); // The above is a faster version of this, by calling the fortran version directly //cblas_sgemm(CblasColMajor, CblasNoTrans, CblasNoTrans, resp.cols, weight.rows, weight.cols, 1, m1, resp.cols, m2, weight.cols, 0.0, m3, resp.cols); @@ -528,7 +529,8 @@ void CEN_patch_expert::ResponseSparse(const cv::Mat_ &area_of_interest, c // Perform matrix multiplication in OpenBLAS (fortran call) float alpha1 = 1.0; float beta1 = 0.0; - sgemm_("N", "N", &resp.cols, &weight.rows, &weight.cols, &alpha1, m1, &resp.cols, m2, &weight.cols, &beta1, m3, &resp.cols); + char *not = "N"; + sgemm_(not, not, &resp.cols, &weight.rows, &weight.cols, &alpha1, m1, &resp.cols, m2, &weight.cols, &beta1, m3, &resp.cols); // The above is a faster version of this, by calling the fortran version directly //cblas_sgemm(CblasColMajor, CblasNoTrans, CblasNoTrans, resp.cols, weight.rows, weight.cols, 1, m1, resp.cols, m2, weight.cols, 0.0, m3, resp.cols); @@ -608,7 +610,8 @@ void CEN_patch_expert::ResponseSparse_mirror(const cv::Mat_ &area_of_inte // Perform matrix multiplication in OpenBLAS (fortran call) float alpha1 = 1.0; float beta1 = 0.0; - sgemm_("N", "N", &resp.cols, &weight.rows, &weight.cols, &alpha1, m1, &resp.cols, m2, &weight.cols, &beta1, m3, &resp.cols); + char *not = "N"; + sgemm_(not, not, &resp.cols, &weight.rows, &weight.cols, &alpha1, m1, &resp.cols, m2, &weight.cols, &beta1, m3, &resp.cols); // The above is a faster version of this, by calling the fortran version directly //cblas_sgemm(CblasColMajor, CblasNoTrans, CblasNoTrans, resp.cols, weight.rows, weight.cols, 1, m1, resp.cols, m2, weight.cols, 0.0, m3, resp.cols); @@ -692,7 +695,8 @@ void CEN_patch_expert::ResponseSparse_mirror_joint(const cv::Mat_ &area_o // Perform matrix multiplication in OpenBLAS (fortran call) float alpha1 = 1.0; float beta1 = 0.0; - sgemm_("N", "N", &resp.cols, &weight.rows, &weight.cols, &alpha1, m1, &resp.cols, m2, &weight.cols, &beta1, m3, &resp.cols); + char *not = "N"; + sgemm_(not, not, &resp.cols, &weight.rows, &weight.cols, &alpha1, m1, &resp.cols, m2, &weight.cols, &beta1, m3, &resp.cols); // The above is a faster version of this, by calling the fortran version directly //cblas_sgemm(CblasColMajor, CblasNoTrans, CblasNoTrans, resp.cols, weight.rows, weight.cols, 1, m1, resp.cols, m2, weight.cols, 0.0, m3, resp.cols); diff --git a/lib/local/LandmarkDetector/src/CNN_utils.cpp b/lib/local/LandmarkDetector/src/CNN_utils.cpp index 343b0ef4..c81cdab2 100644 --- a/lib/local/LandmarkDetector/src/CNN_utils.cpp +++ b/lib/local/LandmarkDetector/src/CNN_utils.cpp @@ -563,7 +563,8 @@ namespace LandmarkDetector float alpha = 1.0f; float beta = 0.0f; // Call fortran directly (faster) - sgemm_("N", "N", &m2_cols, &num_rows, &pre_alloc_im2col.cols, &alpha, m2, &m2_cols, m1, &pre_alloc_im2col.cols, &beta, m3, &m2_cols); + char *not = "N"; + sgemm_(not, not, &m2_cols, &num_rows, &pre_alloc_im2col.cols, &alpha, m2, &m2_cols, m1, &pre_alloc_im2col.cols, &beta, m3, &m2_cols); // Above is equivalent to out = pre_alloc_im2col * weight_matrix; diff --git a/lib/local/LandmarkDetector/src/LandmarkDetectorModel.cpp b/lib/local/LandmarkDetector/src/LandmarkDetectorModel.cpp index 42ae2131..a3216bd6 100644 --- a/lib/local/LandmarkDetector/src/LandmarkDetectorModel.cpp +++ b/lib/local/LandmarkDetector/src/LandmarkDetectorModel.cpp @@ -1115,7 +1115,8 @@ float CLNF::NU_RLMS(cv::Vec6f& final_global, cv::Mat_& final_local, const // Perform matrix multiplication in OpenBLAS (fortran call) float alpha1 = 1.0; float beta1 = 1.0; - sgemm_("N", "N", &J.cols, &J_w_t.rows, &J_w_t.cols, &alpha1, (float*)J.data, &J.cols, (float*)J_w_t.data, &J_w_t.cols, &beta1, (float*)Hessian.data, &J.cols); + char *not = "N"; + sgemm_(not, not, &J.cols, &J_w_t.rows, &J_w_t.cols, &alpha1, (float*)J.data, &J.cols, (float*)J_w_t.data, &J_w_t.cols, &beta1, (float*)Hessian.data, &J.cols); // Above is a fast (but ugly) version of // cv::Mat_ Hessian = J_w_t * J + regTerm; diff --git a/lib/local/LandmarkDetector/src/PDM.cpp b/lib/local/LandmarkDetector/src/PDM.cpp index 1ada6052..148c755d 100644 --- a/lib/local/LandmarkDetector/src/PDM.cpp +++ b/lib/local/LandmarkDetector/src/PDM.cpp @@ -150,7 +150,8 @@ void PDM::CalcShape3D(cv::Mat_& out_shape, const cv::Mat_& p_local int p_local_cols = p_local.cols; int princ_comp_rows = princ_comp.rows; int princ_comp_cols = princ_comp.cols; - sgemm_("N", "N", &p_local_cols, &princ_comp_rows, &princ_comp_cols, &alpha1, (float*)p_local.data, &p_local_cols, (float*)princ_comp.data, &princ_comp_cols, &beta1, (float*)out_shape.data, &p_local_cols); + char *not = "N"; + sgemm_(not, not, &p_local_cols, &princ_comp_rows, &princ_comp_cols, &alpha1, (float*)p_local.data, &p_local_cols, (float*)princ_comp.data, &princ_comp_cols, &beta1, (float*)out_shape.data, &p_local_cols); // Above is a fast (but ugly) version of // out_shape = mean_shape + princ_comp * p_local; @@ -638,7 +639,8 @@ void PDM::CalcParams(cv::Vec6f& out_params_global, cv::Mat_& out_params_l // Perform matrix multiplication in OpenBLAS (fortran call) float alpha1 = 1.0; float beta1 = 1.0; - sgemm_("N", "N", &J.cols, &J_w_t.rows, &J_w_t.cols, &alpha1, (float*)J.data, &J.cols, (float*)J_w_t.data, &J_w_t.cols, &beta1, (float*)Hessian.data, &J.cols); + char *not = "N"; + sgemm_(not, not, &J.cols, &J_w_t.rows, &J_w_t.cols, &alpha1, (float*)J.data, &J.cols, (float*)J_w_t.data, &J_w_t.cols, &beta1, (float*)Hessian.data, &J.cols); // Above is a fast (but ugly) version of // cv::Mat_ Hessian2 = J_w_t * J + regularisations;