diff --git a/lib/3rdParty/dlib/include/dlib/matrix/matrix_trsm.h b/lib/3rdParty/dlib/include/dlib/matrix/matrix_trsm.h index 9ccd5950..769cbe88 100644 --- a/lib/3rdParty/dlib/include/dlib/matrix/matrix_trsm.h +++ b/lib/3rdParty/dlib/include/dlib/matrix/matrix_trsm.h @@ -12,13 +12,13 @@ namespace dlib #ifndef CBLAS_H extern "C" { - void cblas_strsmFIX(const enum CBLAS_ORDER Order, const enum CBLAS_SIDE Side, + void cblas_strsm(const enum CBLAS_ORDER Order, const enum CBLAS_SIDE Side, const enum CBLAS_UPLO Uplo, const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag, const int M, const int N, const float alpha, const float *A, const int lda, float *B, const int ldb); - void cblas_dtrsmFIX(const enum CBLAS_ORDER Order, const enum CBLAS_SIDE Side, + void cblas_dtrsm(const enum CBLAS_ORDER Order, const enum CBLAS_SIDE Side, const enum CBLAS_UPLO Uplo, const enum CBLAS_TRANSPOSE TransA, const enum CBLAS_DIAG Diag, const int M, const int N, const double alpha, const double *A, const int lda, diff --git a/lib/local/FaceAnalyser/include/FaceAnalyserParameters.h b/lib/local/FaceAnalyser/include/FaceAnalyserParameters.h index 2bc29b66..8677fd81 100644 --- a/lib/local/FaceAnalyser/include/FaceAnalyserParameters.h +++ b/lib/local/FaceAnalyser/include/FaceAnalyserParameters.h @@ -69,7 +69,7 @@ public: void OptimizeForVideos(); void OptimizeForImages(); - double getAlignMask() const { return sim_align_face_mask; } + bool getAlignMask() const { return sim_align_face_mask; } double getSimScaleOut() const { return sim_scale_out; } int getSimSizeOut() const { return sim_size_out; } bool getDynamic() const { return dynamic; } diff --git a/lib/local/FaceAnalyser/include/Face_utils.h b/lib/local/FaceAnalyser/include/Face_utils.h index d356b8fc..9618302a 100644 --- a/lib/local/FaceAnalyser/include/Face_utils.h +++ b/lib/local/FaceAnalyser/include/Face_utils.h @@ -47,8 +47,8 @@ namespace FaceAnalysis // Defining a set of useful utility functions to be used within FaceAnalyser // Aligning a face to a common reference frame - void AlignFace(cv::Mat& aligned_face, const cv::Mat& frame, const cv::Mat_& detected_landmarks, cv::Vec6f params_global, const LandmarkDetector::PDM& pdm, bool rigid = true, float scale = 0.6, int width = 96, int height = 96); - void AlignFaceMask(cv::Mat& aligned_face, const cv::Mat& frame, const cv::Mat_& detected_landmarks, cv::Vec6f params_global, const LandmarkDetector::PDM& pdm, const cv::Mat_& triangulation, bool rigid = true, float scale = 0.6, int width = 96, int height = 96); + void AlignFace(cv::Mat& aligned_face, const cv::Mat& frame, const cv::Mat_& detected_landmarks, cv::Vec6f params_global, const LandmarkDetector::PDM& pdm, bool rigid = true, double scale = 0.7, int width = 96, int height = 96); + void AlignFaceMask(cv::Mat& aligned_face, const cv::Mat& frame, const cv::Mat_& detected_landmarks, cv::Vec6f params_global, const LandmarkDetector::PDM& pdm, const cv::Mat_& triangulation, bool rigid = true, double scale = 0.7, int width = 96, int height = 96); void Extract_FHOG_descriptor(cv::Mat_& descriptor, const cv::Mat& image, int& num_rows, int& num_cols, int cell_size = 8); diff --git a/lib/local/FaceAnalyser/src/FaceAnalyser.cpp b/lib/local/FaceAnalyser/src/FaceAnalyser.cpp index d09d07ed..0383ad65 100644 --- a/lib/local/FaceAnalyser/src/FaceAnalyser.cpp +++ b/lib/local/FaceAnalyser/src/FaceAnalyser.cpp @@ -242,7 +242,7 @@ int GetViewId(const vector orientations_all, const cv::Vec3d& orienta if(i == 0 || d < dbest) { dbest = d; - id = i; + id = (int) i; } } return id; diff --git a/lib/local/FaceAnalyser/src/Face_utils.cpp b/lib/local/FaceAnalyser/src/Face_utils.cpp index 0df7d123..8d7c123b 100644 --- a/lib/local/FaceAnalyser/src/Face_utils.cpp +++ b/lib/local/FaceAnalyser/src/Face_utils.cpp @@ -114,7 +114,7 @@ namespace FaceAnalysis } // Aligning a face to a common reference frame - void AlignFace(cv::Mat& aligned_face, const cv::Mat& frame, const cv::Mat_& detected_landmarks, cv::Vec6f params_global, const LandmarkDetector::PDM& pdm, bool rigid, float sim_scale, int out_width, int out_height) + void AlignFace(cv::Mat& aligned_face, const cv::Mat& frame, const cv::Mat_& detected_landmarks, cv::Vec6f params_global, const LandmarkDetector::PDM& pdm, bool rigid, double sim_scale, int out_width, int out_height) { // Will warp to scaled mean shape cv::Mat_ similarity_normalised_shape = pdm.mean_shape * sim_scale; @@ -153,7 +153,7 @@ namespace FaceAnalysis } // Aligning a face to a common reference frame - void AlignFaceMask(cv::Mat& aligned_face, const cv::Mat& frame, const cv::Mat_& detected_landmarks, cv::Vec6f params_global, const LandmarkDetector::PDM& pdm, const cv::Mat_& triangulation, bool rigid, float sim_scale, int out_width, int out_height) + void AlignFaceMask(cv::Mat& aligned_face, const cv::Mat& frame, const cv::Mat_& detected_landmarks, cv::Vec6f params_global, const LandmarkDetector::PDM& pdm, const cv::Mat_& triangulation, bool rigid, double sim_scale, int out_width, int out_height) { // Will warp to scaled mean shape cv::Mat_ similarity_normalised_shape = pdm.mean_shape * sim_scale; diff --git a/lib/local/LandmarkDetector/include/stdafx.h b/lib/local/LandmarkDetector/include/stdafx.h index 719004eb..a8b646ec 100644 --- a/lib/local/LandmarkDetector/include/stdafx.h +++ b/lib/local/LandmarkDetector/include/stdafx.h @@ -23,10 +23,6 @@ #include #include -// IplImage stuff -#include -#include - // C++ stuff #include diff --git a/lib/local/LandmarkDetector/src/CCNF_patch_expert.cpp b/lib/local/LandmarkDetector/src/CCNF_patch_expert.cpp index cc90dbce..630a13ec 100644 --- a/lib/local/LandmarkDetector/src/CCNF_patch_expert.cpp +++ b/lib/local/LandmarkDetector/src/CCNF_patch_expert.cpp @@ -157,9 +157,9 @@ void im2colContrastNormBias(const cv::Mat_& input, const unsigned int wid // Iterate over the blocks unsigned int rowIdx = 0; - for (int j = 0; j< xB; j++) + for (unsigned int j = 0; j< xB; j++) { - for (int i = 0; i< yB; i++) + for (unsigned int i = 0; i< yB; i++) { float* Mo = output.ptr(rowIdx); @@ -171,7 +171,7 @@ void im2colContrastNormBias(const cv::Mat_& input, const unsigned int wid const float* Mi = input.ptr(i + yy); for (unsigned int xx = 0; xx < width; ++xx) { - int colIdx = xx*height + yy; + unsigned int colIdx = xx*height + yy; float in = Mi[j + xx]; sum += in; diff --git a/lib/local/LandmarkDetector/src/CNN_utils.cpp b/lib/local/LandmarkDetector/src/CNN_utils.cpp index 343b0ef4..ffd46f1e 100644 --- a/lib/local/LandmarkDetector/src/CNN_utils.cpp +++ b/lib/local/LandmarkDetector/src/CNN_utils.cpp @@ -50,18 +50,18 @@ namespace LandmarkDetector if (input_output_maps.size() > 1) { - int h = input_output_maps[0].rows; - int w = input_output_maps[0].cols; - size_t size_in = h * w; + unsigned int h = input_output_maps[0].rows; + unsigned int w = input_output_maps[0].cols; + unsigned int size_in = h * w; - for (size_t k = 0; k < input_output_maps.size(); ++k) + for (int k = 0; k < (int) input_output_maps.size(); ++k) { // Apply the PReLU auto iter = input_output_maps[k].begin(); float neg_mult = prelu_weights.at(k); - for (size_t i = 0; i < size_in; ++i) + for (unsigned int i = 0; i < size_in; ++i) { float in_val = *iter; @@ -76,7 +76,7 @@ namespace LandmarkDetector int w = input_output_maps[0].cols; - for (size_t k = 0; k < prelu_weights.rows; ++k) + for (int k = 0; k < prelu_weights.rows; ++k) { auto iter = input_output_maps[0].row(k).begin(); float neg_mult = prelu_weights.at(k); @@ -107,9 +107,9 @@ namespace LandmarkDetector { // Concatenate all the maps cv::Size orig_size = input_maps[0].size(); - cv::Mat_ input_concat(input_maps.size(), input_maps[0].cols * input_maps[0].rows); + cv::Mat_ input_concat((int)input_maps.size(), input_maps[0].cols * input_maps[0].rows); - for (size_t in = 0; in < input_maps.size(); ++in) + for (int in = 0; in < input_maps.size(); ++in) { cv::Mat_ add = input_maps[in]; @@ -128,14 +128,14 @@ namespace LandmarkDetector { input_concat = weights * input_concat; // Add biases - for (size_t k = 0; k < biases.rows; ++k) + for (int k = 0; k < biases.rows; ++k) { input_concat.row(k) = input_concat.row(k) + biases.at(k); } outputs.clear(); // Resize and add as output - for (size_t k = 0; k < biases.rows; ++k) + for (int k = 0; k < biases.rows; ++k) { cv::Mat_ reshaped = input_concat.row(k).clone(); reshaped = reshaped.reshape(1, orig_size.height); @@ -172,8 +172,8 @@ namespace LandmarkDetector for (size_t in = 0; in < input_maps.size(); ++in) { // Help with rounding up a bit, to match caffe style output - int out_x = round((float)(input_maps[in].cols - kernel_size_x) / (float)stride_x) + 1; - int out_y = round((float)(input_maps[in].rows - kernel_size_y) / (float)stride_y) + 1; + int out_x = (int)round((float)(input_maps[in].cols - kernel_size_x) / (float)stride_x) + 1; + int out_y = (int)round((float)(input_maps[in].rows - kernel_size_y) / (float)stride_y) + 1; cv::Mat_ sub_out(out_y, out_x, 0.0); cv::Mat_ in_map = input_maps[in]; @@ -360,15 +360,15 @@ namespace LandmarkDetector } } - void im2col_t(const cv::Mat_& input, int width, int height, cv::Mat_& output) + void im2col_t(const cv::Mat_& input, const unsigned int width, const unsigned int height, cv::Mat_& output) { - int m = input.cols; - int n = input.rows; + const unsigned int m = input.cols; + const unsigned int n = input.rows; // determine how many blocks there will be with a sliding window of width x height in the input - int yB = m - height + 1; - int xB = n - width + 1; + const unsigned int yB = m - height + 1; + const unsigned int xB = n - width + 1; // Allocate the output size if (output.rows != width * height || output.cols != xB*yB) @@ -377,10 +377,10 @@ namespace LandmarkDetector } // Iterate over the whole image - for (int i = 0; i< yB; i++) + for (unsigned int i = 0; i< yB; i++) { - int rowIdx = i; - for (int j = 0; j< xB; j++) + unsigned int rowIdx = i; + for (unsigned int j = 0; j< xB; j++) { //int rowIdx = i; +j*yB; // iterate over the blocks within the image @@ -390,7 +390,7 @@ namespace LandmarkDetector const float* Mi = input.ptr(j + yy); for (unsigned int xx = 0; xx < width; ++xx) { - int colIdx = xx*height + yy; + unsigned int colIdx = xx*height + yy; output.at(colIdx, rowIdx) = Mi[i + xx]; } @@ -413,10 +413,10 @@ namespace LandmarkDetector int yB = height_in - height_k + 1; int xB = width_n - width_k + 1; - cv::Mat_ input_matrix(input_maps.size() * height_k * width_k + 1.0, yB * xB, 1.0f); + cv::Mat_ input_matrix((int)input_maps.size() * height_k * width_k + 1, yB * xB, 1.0f); // Comibine im2col accross channels to prepare for matrix multiplication - for (size_t i = 0; i < input_maps.size(); ++i) + for (int i = 0; i < (int)input_maps.size(); ++i) { cv::Mat_ tmp = input_matrix(cv::Rect(0, i * height_k * width_k, yB * xB, height_k * width_k)); im2col_t(input_maps[i], width_k, height_k, tmp); @@ -431,22 +431,22 @@ namespace LandmarkDetector cblas_sgemm(CblasColMajor, CblasNoTrans, CblasNoTrans, input_matrix.cols, weight_matrix.rows, weight_matrix.cols, 1, m2, input_matrix.cols, m1, weight_matrix.cols, 0.0, m3, input_matrix.cols); // Move back to vectors and reshape accordingly (also add the bias) - for (size_t k = 0; k < out.rows; ++k) + for (int k = 0; k < out.rows; ++k) { outputs.push_back(out.row(k).reshape(1, yB)); } } - void im2col(const cv::Mat_& input, int width, int height, cv::Mat_& output) + void im2col(const cv::Mat_& input, const unsigned int width, const unsigned int height, cv::Mat_& output) { - int m = input.rows; - int n = input.cols; + const unsigned int m = input.rows; + const unsigned int n = input.cols; // determine how many blocks there will be with a sliding window of width x height in the input - int yB = m - height + 1; - int xB = n - width + 1; + const unsigned int yB = m - height + 1; + const unsigned int xB = n - width + 1; // Allocate the output size if (output.cols != width * height || output.rows != xB*yB) @@ -455,10 +455,10 @@ namespace LandmarkDetector } // Iterate over the whole image - for (int i = 0; i< yB; i++) + for (unsigned int i = 0; i< yB; i++) { - int rowIdx = i*xB; - for (int j = 0; j< xB; j++) + unsigned int rowIdx = i*xB; + for (unsigned int j = 0; j< xB; j++) { float* Mo = output.ptr(rowIdx); @@ -471,7 +471,7 @@ namespace LandmarkDetector for (unsigned int xx = 0; xx < width; ++xx) { - int colIdx = xx*height + yy; + unsigned int colIdx = xx*height + yy; //output.at(rowIdx, colIdx) = Mi[j + xx]; //input.at(i + yy, j + xx); Mo[colIdx] = Mi[j + xx]; } @@ -482,31 +482,31 @@ namespace LandmarkDetector } } - void im2col_multimap(const vector >& inputs, int width, int height, cv::Mat_& output) + void im2col_multimap(const vector >& inputs, const unsigned int width, const unsigned int height, cv::Mat_& output) { - int m = inputs[0].rows; - int n = inputs[0].cols; + const unsigned int m = inputs[0].rows; + const unsigned int n = inputs[0].cols; // determine how many blocks there will be with a sliding window of width x height in the input - int yB = m - height + 1; - int xB = n - width + 1; + const unsigned int yB = m - height + 1; + const unsigned int xB = n - width + 1; int stride = height * width; - size_t num_maps = inputs.size(); + unsigned int num_maps = (unsigned int)inputs.size(); // Allocate the output size - if (output.cols != width * height * inputs.size() + 1 || output.rows < xB*yB) + if (output.cols != width * height * inputs.size() + 1 || (unsigned int) output.rows < xB*yB) { output = cv::Mat::ones(xB*yB, width * height * num_maps + 1, CV_32F); } // Iterate over the whole image - for (int i = 0; i< yB; i++) + for (unsigned int i = 0; i< yB; i++) { - int rowIdx = i*xB; - for (int j = 0; j< xB; j++) + unsigned int rowIdx = i*xB; + for (unsigned int j = 0; j< xB; j++) { float* Mo = output.ptr(rowIdx); @@ -523,7 +523,7 @@ namespace LandmarkDetector for (unsigned int xx = 0; xx < width; ++xx) { - int colIdx = xx*height + yy + in_maps * stride; + unsigned int colIdx = xx*height + yy + in_maps * stride; //output.at(rowIdx, colIdx) = Mi[j + xx]; //input.at(i + yy, j + xx); Mo[colIdx] = Mi[j + xx]; } @@ -570,7 +570,7 @@ namespace LandmarkDetector out = out.t(); // Move back to vectors and reshape accordingly - for (size_t k = 0; k < out.rows; ++k) + for (int k = 0; k < out.rows; ++k) { outputs.push_back(out.row(k).reshape(1, yB)); } diff --git a/lib/local/LandmarkDetector/src/Patch_experts.cpp b/lib/local/LandmarkDetector/src/Patch_experts.cpp index ad9553e2..2dc72b5e 100644 --- a/lib/local/LandmarkDetector/src/Patch_experts.cpp +++ b/lib/local/LandmarkDetector/src/Patch_experts.cpp @@ -36,10 +36,6 @@ #include "Patch_experts.h" -// OpenCV includes -#include -#include - // TBB includes #include diff --git a/lib/local/Utilities/src/Visualizer.cpp b/lib/local/Utilities/src/Visualizer.cpp index 641c0663..111224af 100644 --- a/lib/local/Utilities/src/Visualizer.cpp +++ b/lib/local/Utilities/src/Visualizer.cpp @@ -256,7 +256,7 @@ void Visualizer::SetObservationActionUnits(const std::vector