Some changes in API. Caffe source files was cleared from unnecessary code.pull/265/head
parent
6e23d93b39
commit
77321e3ad6
10 changed files with 261 additions and 349 deletions
@ -0,0 +1,37 @@ |
||||
#ifndef __OPENCV_DNN_INL_HPP__ |
||||
#define __OPENCV_DNN_INL_HPP__ |
||||
|
||||
#include <opencv2/dnn.hpp> |
||||
|
||||
namespace cv |
||||
{ |
||||
namespace dnn |
||||
{ |
||||
inline
|
||||
Mat& Blob::getMatRef() |
||||
{ |
||||
return m; |
||||
} |
||||
|
||||
inline |
||||
const Mat& Blob::getMatRef() const |
||||
{ |
||||
return m; |
||||
} |
||||
|
||||
inline |
||||
Mat Blob::getMat() |
||||
{ |
||||
return m; |
||||
} |
||||
|
||||
|
||||
Mat Blob::getMat(int num, int channel) |
||||
{ |
||||
CV_Assert(false); |
||||
return Mat(); |
||||
} |
||||
} |
||||
} |
||||
|
||||
#endif |
@ -0,0 +1,59 @@ |
||||
#pragma once |
||||
#include <stdlib.h> |
||||
#include <iostream> |
||||
#include <opencv2/core.hpp> |
||||
|
||||
#define CHECK(cond) cv::GLogWrapper(__FILE__, CV_Func, __LINE__, "CHECK", #cond, cond) |
||||
#define CHECK_EQ(a, b) cv::GLogWrapper(__FILE__, CV_Func, __LINE__, "CHECK", #a #b, ((a) == (b))) |
||||
#define LOG(TYPE) cv::GLogWrapper(__FILE__, CV_Func, __LINE__, #TYPE) |
||||
|
||||
namespace cv |
||||
{ |
||||
|
||||
class GLogWrapper |
||||
{ |
||||
const char *type, *cond_str, *file, *func; |
||||
int line; |
||||
bool cond_staus; |
||||
std::ostream &stream; |
||||
|
||||
static std::ostream &selectStream(const char *type) |
||||
{ |
||||
if (!strcmp(type, "INFO")) |
||||
return std::cout; |
||||
else |
||||
return std::cerr; |
||||
} |
||||
|
||||
public: |
||||
|
||||
GLogWrapper(const char *_file, const char *_func, int _line,
|
||||
const char *_type,
|
||||
const char *_cond_str = NULL, bool _cond_status = true |
||||
) : |
||||
stream(selectStream(_type)),
|
||||
file(_file), func(_func), line(_line),
|
||||
type(_type), cond_str(_cond_str), cond_staus(_cond_status) {} |
||||
|
||||
template<typename T> |
||||
GLogWrapper &operator<<(const T &v) |
||||
{ |
||||
if (!cond_str || cond_str && !cond_staus) |
||||
stream << v; |
||||
return *this; |
||||
} |
||||
|
||||
~GLogWrapper() |
||||
{ |
||||
if (cond_str && !cond_staus) |
||||
{ |
||||
cv::error(cv::Error::StsAssert, cond_str, func, file, line); |
||||
} |
||||
//else if (!cond_str && strcmp(type, "INFO"))
|
||||
//{
|
||||
// cv::error(cv::Error::StsAssert, type, func, file, line);
|
||||
//}
|
||||
} |
||||
}; |
||||
|
||||
} |
Loading…
Reference in new issue