Use PIMPL idiom to reduce compile times.

This commit is contained in:
2017-10-18 12:12:01 +02:00
parent 9c4576a00f
commit a151f0f5e3
3 changed files with 79 additions and 69 deletions

View File

@@ -3,20 +3,8 @@
#include <string>
#include <memory>
#include <vector>
#include <opencv2/core/types.hpp>
#include <opencv2/core/mat.hpp>
#include "utils.hpp"
#include "LayerData.hpp"
// Forward declare caffe::net so we don't have to include it here.
namespace caffe
{
template<class DType>
class Net;
}
namespace fmri {
using std::string;
using std::vector;
@@ -29,13 +17,7 @@ namespace fmri {
vector<LayerData> simulate(const string &input_file);
private:
std::unique_ptr<caffe::Net<DType>> net;
cv::Size input_geometry;
cv::Mat means;
unsigned int num_channels;
vector<cv::Mat> getWrappedInputLayer();
cv::Mat preprocess(cv::Mat original) const;
cv::Mat processMeans(const string &means_file) const;
struct Impl;
std::unique_ptr<Impl> pImpl;
};
}