1
0
mirror of https://github.com/opencv/opencv_contrib.git synced 2025-10-19 02:16:34 +08:00

add FindCaffe cmake file for necessary dependency

This commit is contained in:
Wangyida
2015-08-11 14:51:53 +08:00
parent 4483d00c26
commit e4e374e217
9 changed files with 74 additions and 25 deletions

View File

@@ -58,12 +58,16 @@ the use of this software, even if advised of the possibility of such damage.
#include <tr1/memory>
#include <dirent.h>
#define CPU_ONLY
#include "caffe/blob.hpp"
#include "caffe/common.hpp"
#include "caffe/net.hpp"
#include "caffe/proto/caffe.pb.h"
#include "caffe/util/io.hpp"
#include "caffe/vision_layers.hpp"
#ifdef HAVE_CAFFE
#include <caffe/blob.hpp>
#include <caffe/common.hpp>
#include <caffe/net.hpp>
#include <caffe/proto/caffe.pb.h>
#include <caffe/util/io.hpp>
#include <caffe/vision_layers.hpp>
#endif
#include "opencv2/viz/vizcore.hpp"
#include "opencv2/highgui.hpp"
#include "opencv2/highgui/highgui_c.h"
@@ -132,10 +136,10 @@ class CV_EXPORTS_W IcoSphere
};
class CV_EXPORTS_W Classification
class CV_EXPORTS_W Feature
{
private:
caffe::shared_ptr<caffe::Net<float> > net_;
caffe::Net<float>* net_;
cv::Size input_geometry_;
int num_channels_;
cv::Mat mean_;
@@ -150,7 +154,7 @@ class CV_EXPORTS_W Classification
/** @brief Convert the input image to the input image format of the network.
*/
public:
Classification();
Feature();
void list_dir(const char *path,std::vector<string>& files,bool r);
/** @brief Get the file name from a root dictionary.
*/