Skip to content

Commit

Permalink
Cleaning up includes, fixing tbb binary include for 32 bit windows ve…
Browse files Browse the repository at this point in the history
…rsion.
  • Loading branch information
TadasBaltrusaitis committed Jun 18, 2018
1 parent cd24af0 commit b571cc2
Show file tree
Hide file tree
Showing 15 changed files with 53 additions and 96 deletions.
2 changes: 2 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -97,3 +97,5 @@ exe/releases/OpenFace_*
/build/
matlab_runners/Action Unit Experiments/AU_predictions/
lib/local/Utilities/Debug/
lib/3rdParty/CameraEnumerator/Debug/
lib/local/CppInerop/Debug/
5 changes: 1 addition & 4 deletions lib/3rdParty/OpenBLAS/OpenBLAS.props
Original file line number Diff line number Diff line change
Expand Up @@ -11,10 +11,7 @@
<AdditionalLibraryDirectories>$(SolutionDir)lib\3rdParty\OpenBLAS\lib\$(PlatformShortName);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>libopenblas.dll.a;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<PreBuildEvent>
<Command>
</Command>
</PreBuildEvent>
<PreBuildEvent />
<PreLinkEvent>
<Command>xcopy /I /E /Y /D /C "$(SolutionDir)lib\3rdParty\OpenBlas\bin\$(PlatformShortName)" "$(OutDir)"</Command>
</PreLinkEvent>
Expand Down
1 change: 1 addition & 0 deletions lib/3rdParty/dlib/dlib.props
Original file line number Diff line number Diff line change
Expand Up @@ -8,5 +8,6 @@
<AdditionalLibraryDirectories>$(SolutionDir)lib\3rdParty\dlib\lib\$(PlatformTarget)\$(PlatformToolset)\$(Configuration);%(AdditionalLibraryDirectories)</AdditionalLibraryDirectories>
<AdditionalDependencies>dlib.lib;%(AdditionalDependencies)</AdditionalDependencies>
</Link>
<PreBuildEvent />
</ItemDefinitionGroup>
</Project>
Original file line number Diff line number Diff line change
Expand Up @@ -3,9 +3,11 @@ We are using dlib 19.13, the libraries are pre-built for convenience, they were
For win 64 bit
cmake -G "Visual Studio 14 2015 Win64" -DDLIB_JPEG_SUPPORT=0 -DDLIB_PNG_SUPPORT=0 -DDLIB_NO_GUI_SUPPORT=1 -DDLIB_ISO_CPP_ONLY=0 -DENABLE_ASSERTS=0 -DCMAKE_INSTALL_PREFIX=install ..
cmake --build . --config Debug --target INSTALL
cmake --build . --config R --target INSTALL
cmake --build . --config Release --target INSTALL

For win 32 bit
cmake -G "Visual Studio 14 2015" -DDLIB_JPEG_SUPPORT=0 -DDLIB_PNG_SUPPORT=0 -DDLIB_NO_GUI_SUPPORT=1 -DDLIB_ISO_CPP_ONLY=0 -DENABLE_ASSERTS=0 -DCMAKE_INSTALL_PREFIX=install ..
cmake --build . --config Debug --target INSTALL
cmake --build . --config R --target INSTALL
cmake --build . --config Release --target INSTALL

Afterwards move the built libs to the right location "lib" folder and rename them accordingly
13 changes: 11 additions & 2 deletions lib/local/CppInerop/CppInterop.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -32,13 +32,22 @@
//
///////////////////////////////////////////////////////////////////////////////

// Allows to overcome boost name clash stuff with C++ CLI
#ifdef __cplusplus_cli
#define generic __identifier(generic)
#endif

// This is the main DLL file.
#include "GazeAnalyserInterop.h"
#include "LandmarkDetectorInterop.h"
#include "FaceAnalyserInterop.h"
#include "GazeAnalyserInterop.h"
#include "OpenCVWrappers.h"
#include "ImageReader.h"
#include "FaceDetectorInterop.h"
#include "RecorderInterop.h"
#include "VisualizerInterop.h"
#include "SequenceReader.h"
#include "SequenceReader.h"

#ifdef __cplusplus_cli
#undef generic
#endif
13 changes: 4 additions & 9 deletions lib/local/CppInerop/FaceAnalyserInterop.h
Original file line number Diff line number Diff line change
Expand Up @@ -46,18 +46,13 @@

#pragma unmanaged

#include <opencv2/opencv.hpp>

// Allows to overcome boost name clash stuff with C++ CLI
#ifdef __cplusplus_cli
#define generic __identifier(generic)
#endif

#include <opencv2/core/core.hpp>
#include "opencv2/objdetect.hpp"
#include "opencv2/calib3d.hpp"
#include <opencv2/imgcodecs.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>

#include <OpenCVWrappers.h>
#include <Face_utils.h>
#include <FaceAnalyser.h>
Expand All @@ -71,10 +66,10 @@
#undef generic
#endif

using namespace System::Collections::Generic;

#pragma managed

using namespace System::Collections::Generic;

namespace FaceAnalyser_Interop {

public ref class FaceAnalyserManaged
Expand Down
25 changes: 6 additions & 19 deletions lib/local/CppInerop/FaceDetectorInterop.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,32 +38,19 @@
#pragma once

// Include all the unmanaged things we need.
#pragma unmanaged

#include <opencv2/core/core.hpp>
#include "opencv2/objdetect.hpp"
#include "opencv2/calib3d.hpp"
#include <opencv2/imgcodecs.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>

// Allows to overcome boost name clash stuff with C++ CLI
#ifdef __cplusplus_cli
#define generic __identifier(generic)
#endif

#undef _M_CEE
#include <opencv2/opencv.hpp>
#include <OpenCVWrappers.h>

#include <LandmarkCoreIncludes.h>

#ifdef __cplusplus_cli
#undef generic
#endif

using namespace System::Collections::Generic;
#define _M_CEE

#pragma managed

#include <msclr\marshal.h>
#include <msclr\marshal_cppstd.h>
using namespace System::Collections::Generic;

namespace FaceDetectorInterop {

Expand Down
20 changes: 1 addition & 19 deletions lib/local/CppInerop/GazeAnalyserInterop.h
Original file line number Diff line number Diff line change
Expand Up @@ -47,30 +47,12 @@

#pragma unmanaged

#include <opencv2/core/core.hpp>
#include "opencv2/objdetect.hpp"
#include "opencv2/calib3d.hpp"
#include <opencv2/imgcodecs.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>

// Allows to overcome boost name clash stuff with C++ CLI
#ifdef __cplusplus_cli
#define generic __identifier(generic)
#endif
#include <opencv2/opencv.hpp>

#include <OpenCVWrappers.h>
#include <LandmarkDetectorInterop.h>
#include <GazeEstimation.h>

// Boost stuff
#include <filesystem.hpp>
#include <filesystem/fstream.hpp>

#ifdef __cplusplus_cli
#undef generic
#endif

#pragma managed

namespace GazeAnalyser_Interop {
Expand Down
9 changes: 2 additions & 7 deletions lib/local/CppInerop/ImageReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,18 +37,13 @@

// Include all the unmanaged things we need.

#include <opencv2/core/core.hpp>
#include "opencv2/objdetect.hpp"
#include "opencv2/calib3d.hpp"
#include <opencv2/imgcodecs.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/opencv.hpp>
#include <vector>
#include <set>

#include <OpenCVWrappers.h>

#include "ImageCapture.h"
#include <ImageCapture.h>

#pragma managed

Expand Down
19 changes: 3 additions & 16 deletions lib/local/CppInerop/LandmarkDetectorInterop.h
Original file line number Diff line number Diff line change
Expand Up @@ -45,29 +45,16 @@

// Include all the unmanaged things we need.

#include <opencv2/core/core.hpp>
#include "opencv2/objdetect.hpp"
#include "opencv2/calib3d.hpp"
#include <opencv2/imgcodecs.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>

// Allows to overcome boost name clash stuff with C++ CLI
#ifdef __cplusplus_cli
#define generic __identifier(generic)
#endif
#include <opencv2/opencv.hpp>

#include <OpenCVWrappers.h>

#undef _M_CEE
#include <LandmarkCoreIncludes.h>

#include <Face_utils.h>
#include <FaceAnalyser.h>
#include <VisualizationUtils.h>

#ifdef __cplusplus_cli
#undef generic
#endif
#define _M_CEE

using namespace System::Collections::Generic;

Expand Down
4 changes: 2 additions & 2 deletions lib/local/CppInerop/OpenCVWrappers.h
Original file line number Diff line number Diff line change
Expand Up @@ -42,8 +42,8 @@

#pragma unmanaged

#include "cv.h"
#include "highgui.h"
#include <cv.h>
#include <highgui.h>

#include <opencv2/videoio/videoio.hpp> // Video write
#include <opencv2/videoio/videoio_c.h> // Video write
Expand Down
5 changes: 4 additions & 1 deletion lib/local/CppInerop/RecorderInterop.h
Original file line number Diff line number Diff line change
Expand Up @@ -39,13 +39,16 @@

// Include all the unmanaged things we need.

#include "RecorderOpenFace.h"
#include <RecorderOpenFace.h>
#include <OpenCVWrappers.h>

#pragma managed

#include <msclr\marshal.h>
#include <msclr\marshal_cppstd.h>

using namespace System::Collections::Generic;

namespace UtilitiesOF {

public ref class RecorderOpenFaceParameters
Expand Down
22 changes: 9 additions & 13 deletions lib/local/CppInerop/SequenceReader.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,27 +37,23 @@

// Include all the unmanaged things we need.

#include <opencv2/core/core.hpp>
#include "opencv2/objdetect.hpp"
#include "opencv2/calib3d.hpp"
#include <opencv2/imgcodecs.hpp>
#include <opencv2/imgproc.hpp>
#include <opencv2/highgui/highgui.hpp>
#include <opencv2/opencv.hpp>
#include <vector>
#include <set>
#include <string>

#include <OpenCVWrappers.h>
#include <ImageReader.h>

#include "DeviceEnumerator.h"

#include "SequenceCapture.h"
#include <DeviceEnumerator.h>
#include <SequenceCapture.h>

#pragma managed

#include <msclr\marshal.h>
#include <msclr\marshal_cppstd.h>

using namespace System::Collections::Generic;

namespace UtilitiesOF {


Expand Down Expand Up @@ -271,7 +267,7 @@ namespace UtilitiesOF {

private:
// Static methods for listing cameras and their resolutions
static void split(const std::string &s, char delim, std::vector<string> &elems) {
static void split(const std::string &s, char delim, std::vector<std::string> &elems) {
std::stringstream ss;
ss.str(s);
std::string item;
Expand Down Expand Up @@ -299,7 +295,7 @@ namespace UtilitiesOF {
auto resolutions = gcnew System::Collections::Generic::List<System::Tuple<int, int>^>();
for (size_t r_idx = 0; r_idx < resolution_list.size(); r_idx++)
{
string res = resolution_list[r_idx]["res"];
std::string res = resolution_list[r_idx]["res"];

std::vector<std::string> elems;
split(res, 'x', elems);
Expand Down Expand Up @@ -329,7 +325,7 @@ namespace UtilitiesOF {
auto resolutions = camera_list[name_m];
for (int j = 0; j < resolutions->Count; j++)
{
stringstream ss;
std::stringstream ss;
ss << resolutions[j]->Item1 << "x" << resolutions[j]->Item2;

fs << "{:" << "res" << ss.str();
Expand Down
3 changes: 2 additions & 1 deletion lib/local/CppInerop/VisualizerInterop.h
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,8 @@

// Include all the unmanaged things we need.

#include "Visualizer.h"
#include <Visualizer.h>
#include <OpenCVWrappers.h>

#pragma managed

Expand Down
2 changes: 1 addition & 1 deletion lib/local/FaceAnalyser/FaceAnalyser.vcxproj
Original file line number Diff line number Diff line change
Expand Up @@ -56,8 +56,8 @@
<ImportGroup Label="PropertySheets" Condition="'$(Configuration)|$(Platform)'=='Debug|Win32'">
<Import Project="$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props" Condition="exists('$(UserRootDir)\Microsoft.Cpp.$(Platform).user.props')" Label="LocalAppDataPlatform" />
<Import Project="..\..\3rdParty\dlib\dlib.props" />
<Import Project="..\..\3rdParty\boost\boost_d.props" />
<Import Project="..\..\3rdParty\tbb\tbb_d.props" />
<Import Project="..\..\3rdParty\boost\boost_d.props" />
<Import Project="..\..\3rdParty\OpenBLAS\OpenBLAS.props" />
<Import Project="..\..\3rdParty\OpenCV3.4\openCV3.4.props" />
</ImportGroup>
Expand Down

0 comments on commit b571cc2

Please sign in to comment.