Merge remote-tracking branch 'upstream/3.4' into merge-3.4

This commit is contained in:
Alexander Alekhin 2018-09-15 00:52:21 +03:00 committed by Alexander Alekhin
commit 808ba552c5
235 changed files with 18422 additions and 3526 deletions

View File

@ -1398,7 +1398,7 @@ if(WITH_VA OR HAVE_VA)
endif()
if(WITH_VA_INTEL OR HAVE_VA_INTEL)
status(" Intel VA-API/OpenCL:" HAVE_VA_INTEL THEN "YES (MSDK: ${VA_INTEL_MSDK_ROOT} OpenCL: ${VA_INTEL_IOCL_ROOT})" ELSE NO)
status(" Intel VA-API/OpenCL:" HAVE_VA_INTEL THEN "YES (OpenCL: ${VA_INTEL_IOCL_ROOT})" ELSE NO)
endif()
if(WITH_LAPACK OR HAVE_LAPACK)

View File

@ -50,7 +50,8 @@ else()
add_library(libprotobuf UNKNOWN IMPORTED)
set_target_properties(libprotobuf PROPERTIES
IMPORTED_LOCATION "${Protobuf_LIBRARY}"
INTERFACE_INCLUDE_SYSTEM_DIRECTORIES "${Protobuf_INCLUDE_DIR}"
INTERFACE_INCLUDE_DIRECTORIES "${Protobuf_INCLUDE_DIR}"
INTERFACE_SYSTEM_INCLUDE_DIRECTORIES "${Protobuf_INCLUDE_DIR}"
)
get_protobuf_version(Protobuf_VERSION "${Protobuf_INCLUDE_DIR}")
endif()

View File

@ -1,30 +1,16 @@
# Main variables:
# VA_INTEL_MSDK_INCLUDE_DIR and VA_INTEL_IOCL_INCLUDE_DIR to use VA_INTEL
# VA_INTEL_IOCL_INCLUDE_DIR to use VA_INTEL
# HAVE_VA_INTEL for conditional compilation OpenCV with/without VA_INTEL
# VA_INTEL_MSDK_ROOT - root of Intel MSDK installation
# VA_INTEL_IOCL_ROOT - root of Intel OCL installation
if(UNIX AND NOT ANDROID)
if($ENV{VA_INTEL_MSDK_ROOT})
set(VA_INTEL_MSDK_ROOT $ENV{VA_INTEL_MSDK_ROOT})
else()
set(VA_INTEL_MSDK_ROOT "/opt/intel/mediasdk")
endif()
if($ENV{VA_INTEL_IOCL_ROOT})
set(VA_INTEL_IOCL_ROOT $ENV{VA_INTEL_IOCL_ROOT})
else()
set(VA_INTEL_IOCL_ROOT "/opt/intel/opencl")
endif()
find_path(
VA_INTEL_MSDK_INCLUDE_DIR
NAMES mfxdefs.h
PATHS ${VA_INTEL_MSDK_ROOT}
PATH_SUFFIXES include
DOC "Path to Intel MSDK headers")
find_path(
VA_INTEL_IOCL_INCLUDE_DIR
NAMES CL/va_ext.h
@ -33,12 +19,14 @@ if(UNIX AND NOT ANDROID)
DOC "Path to Intel OpenCL headers")
endif()
if(VA_INTEL_MSDK_INCLUDE_DIR AND VA_INTEL_IOCL_INCLUDE_DIR)
if(VA_INTEL_IOCL_INCLUDE_DIR)
set(HAVE_VA_INTEL TRUE)
set(VA_INTEL_LIBRARIES "-lva" "-lva-drm")
if(NOT DEFINED VA_INTEL_LIBRARIES)
set(VA_INTEL_LIBRARIES "va" "va-drm")
endif()
else()
set(HAVE_VA_INTEL FALSE)
message(WARNING "Intel MSDK & OpenCL installation is not found.")
message(WARNING "Intel OpenCL installation is not found.")
endif()
mark_as_advanced(FORCE VA_INTEL_MSDK_INCLUDE_DIR VA_INTEL_IOCL_INCLUDE_DIR)
mark_as_advanced(FORCE VA_INTEL_IOCL_INCLUDE_DIR)

View File

@ -259,7 +259,7 @@ function(ocv_include_directories)
ocv_is_opencv_directory(__is_opencv_dir "${dir}")
if(__is_opencv_dir)
list(APPEND __add_before "${dir}")
elseif(CV_GCC AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.0" AND
elseif(((CV_GCC AND NOT CMAKE_CXX_COMPILER_VERSION VERSION_LESS "6.0") OR CV_CLANG) AND
dir MATCHES "/usr/include$")
# workaround for GCC 6.x bug
else()

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

After

Width:  |  Height:  |  Size: 23 KiB

View File

@ -297,7 +297,7 @@ int ap3p::computePoses(const double featureVectors[3][3],
}
bool ap3p::solve(cv::Mat &R, cv::Mat &tvec, const cv::Mat &opoints, const cv::Mat &ipoints) {
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
double rotation_matrix[3][3], translation[3];
std::vector<double> points;
@ -321,7 +321,7 @@ bool ap3p::solve(cv::Mat &R, cv::Mat &tvec, const cv::Mat &opoints, const cv::Ma
}
int ap3p::solve(std::vector<cv::Mat> &Rs, std::vector<cv::Mat> &tvecs, const cv::Mat &opoints, const cv::Mat &ipoints) {
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
double rotation_matrix[4][3][3], translation[4][3];
std::vector<double> points;

View File

@ -485,7 +485,7 @@ static void icvBinarizationHistogramBased(Mat & img)
bool findChessboardCorners(InputArray image_, Size pattern_size,
OutputArray corners_, int flags)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
DPRINTF("==== findChessboardCorners(img=%dx%d, pattern=%dx%d, flags=%d)",
image_.cols(), image_.rows(), pattern_size.width, pattern_size.height, flags);
@ -2183,7 +2183,7 @@ bool findCirclesGrid( InputArray _image, Size patternSize,
OutputArray _centers, int flags, const Ptr<FeatureDetector> &blobDetector,
const CirclesGridFinderParameters& parameters_)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
CirclesGridFinderParameters parameters = parameters_; // parameters.gridType is amended below

View File

@ -2795,7 +2795,7 @@ void cv::reprojectImageTo3D( InputArray _disparity,
OutputArray __3dImage, InputArray _Qmat,
bool handleMissingValues, int dtype )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
Mat disparity = _disparity.getMat(), Q = _Qmat.getMat();
int stype = disparity.type();
@ -3225,7 +3225,7 @@ static Mat prepareDistCoeffs(Mat& distCoeffs0, int rtype, int outputSize = 14)
void cv::Rodrigues(InputArray _src, OutputArray _dst, OutputArray _jacobian)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
Mat src = _src.getMat();
bool v2m = src.cols == 1 || src.rows == 1;
@ -3245,7 +3245,7 @@ void cv::Rodrigues(InputArray _src, OutputArray _dst, OutputArray _jacobian)
void cv::matMulDeriv( InputArray _Amat, InputArray _Bmat,
OutputArray _dABdA, OutputArray _dABdB )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
Mat A = _Amat.getMat(), B = _Bmat.getMat();
_dABdA.create(A.rows*B.cols, A.rows*A.cols, A.type());
@ -3350,7 +3350,7 @@ cv::Mat cv::initCameraMatrix2D( InputArrayOfArrays objectPoints,
InputArrayOfArrays imagePoints,
Size imageSize, double aspectRatio )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
Mat objPt, imgPt, npoints, cameraMatrix(3, 3, CV_64F);
collectCalibrationData( objectPoints, imagePoints, noArray(),
@ -3368,7 +3368,7 @@ double cv::calibrateCamera( InputArrayOfArrays _objectPoints,
Size imageSize, InputOutputArray _cameraMatrix, InputOutputArray _distCoeffs,
OutputArrayOfArrays _rvecs, OutputArrayOfArrays _tvecs, int flags, TermCriteria criteria )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
return calibrateCamera(_objectPoints, _imagePoints, imageSize, _cameraMatrix, _distCoeffs,
_rvecs, _tvecs, noArray(), noArray(), noArray(), flags, criteria);
@ -3382,7 +3382,7 @@ double cv::calibrateCamera(InputArrayOfArrays _objectPoints,
OutputArray stdDeviationsExtrinsics,
OutputArray _perViewErrors, int flags, TermCriteria criteria )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
int rtype = CV_64F;
Mat cameraMatrix = _cameraMatrix.getMat();
@ -3496,7 +3496,7 @@ void cv::calibrationMatrixValues( InputArray _cameraMatrix, Size imageSize,
double& fovx, double& fovy, double& focalLength,
Point2d& principalPoint, double& aspectRatio )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
if(_cameraMatrix.size() != Size(3, 3))
CV_Error(CV_StsUnmatchedSizes, "Size of cameraMatrix must be 3x3!");
@ -3675,7 +3675,7 @@ bool cv::stereoRectifyUncalibrated( InputArray _points1, InputArray _points2,
InputArray _Fmat, Size imgSize,
OutputArray _Hmat1, OutputArray _Hmat2, double threshold )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
int rtype = CV_64F;
_Hmat1.create(3, 3, rtype);
@ -3695,7 +3695,7 @@ cv::Mat cv::getOptimalNewCameraMatrix( InputArray _cameraMatrix,
Size imgSize, double alpha, Size newImgSize,
Rect* validPixROI, bool centerPrincipalPoint )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
Mat cameraMatrix = _cameraMatrix.getMat(), distCoeffs = _distCoeffs.getMat();
CvMat c_cameraMatrix = cvMat(cameraMatrix), c_distCoeffs = cvMat(distCoeffs);
@ -3717,7 +3717,7 @@ cv::Vec3d cv::RQDecomp3x3( InputArray _Mmat,
OutputArray _Qy,
OutputArray _Qz )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
Mat M = _Mmat.getMat();
_Rmat.create(3, 3, M.type());
@ -3751,7 +3751,7 @@ void cv::decomposeProjectionMatrix( InputArray _projMatrix, OutputArray _cameraM
OutputArray _rotMatrixX, OutputArray _rotMatrixY,
OutputArray _rotMatrixZ, OutputArray _eulerAngles )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
Mat projMatrix = _projMatrix.getMat();
int type = projMatrix.type();

View File

@ -3156,7 +3156,7 @@ void Chessboard::detectImpl(InputArray image, std::vector<KeyPoint>& keypoints,
bool cv::findChessboardCornersSB(cv::InputArray image_, cv::Size pattern_size,
cv::OutputArray corners_, int flags)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
int type = image_.type(), depth = CV_MAT_DEPTH(type), cn = CV_MAT_CN(type);
Mat img = image_.getMat();
CV_CheckType(type, depth == CV_8U && (cn == 1 || cn == 3),

View File

@ -7,8 +7,17 @@
# if defined __GNUC__ && defined __APPLE__
# pragma GCC diagnostic ignored "-Wshadow"
# endif
# if defined(_MSC_VER)
# pragma warning(push)
# pragma warning(disable:4701) // potentially uninitialized local variable
# pragma warning(disable:4702) // unreachable code
# pragma warning(disable:4714) // const marked as __forceinline not inlined
# endif
# include <Eigen/Core>
# include <Eigen/Eigenvalues>
# if defined(_MSC_VER)
# pragma warning(pop)
# endif
# include "opencv2/core/eigen.hpp"
#endif

View File

@ -63,7 +63,7 @@ namespace cv { namespace
void cv::fisheye::projectPoints(InputArray objectPoints, OutputArray imagePoints, const Affine3d& affine,
InputArray K, InputArray D, double alpha, OutputArray jacobian)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
projectPoints(objectPoints, imagePoints, affine.rvec(), affine.translation(), K, D, alpha, jacobian);
}
@ -71,7 +71,7 @@ void cv::fisheye::projectPoints(InputArray objectPoints, OutputArray imagePoints
void cv::fisheye::projectPoints(InputArray objectPoints, OutputArray imagePoints, InputArray _rvec,
InputArray _tvec, InputArray _K, InputArray _D, double alpha, OutputArray jacobian)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
// will support only 3-channel data now for points
CV_Assert(objectPoints.type() == CV_32FC3 || objectPoints.type() == CV_64FC3);
@ -255,7 +255,7 @@ void cv::fisheye::projectPoints(InputArray objectPoints, OutputArray imagePoints
void cv::fisheye::distortPoints(InputArray undistorted, OutputArray distorted, InputArray K, InputArray D, double alpha)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
// will support only 2-channel data now for points
CV_Assert(undistorted.type() == CV_32FC2 || undistorted.type() == CV_64FC2);
@ -319,7 +319,7 @@ void cv::fisheye::distortPoints(InputArray undistorted, OutputArray distorted, I
void cv::fisheye::undistortPoints( InputArray distorted, OutputArray undistorted, InputArray K, InputArray D, InputArray R, InputArray P)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
// will support only 2-channel data now for points
CV_Assert(distorted.type() == CV_32FC2 || distorted.type() == CV_64FC2);
@ -425,7 +425,7 @@ void cv::fisheye::undistortPoints( InputArray distorted, OutputArray undistorted
void cv::fisheye::initUndistortRectifyMap( InputArray K, InputArray D, InputArray R, InputArray P,
const cv::Size& size, int m1type, OutputArray map1, OutputArray map2 )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
CV_Assert( m1type == CV_16SC2 || m1type == CV_32F || m1type <=0 );
map1.create( size, m1type <= 0 ? CV_16SC2 : m1type );
@ -532,7 +532,7 @@ void cv::fisheye::initUndistortRectifyMap( InputArray K, InputArray D, InputArra
void cv::fisheye::undistortImage(InputArray distorted, OutputArray undistorted,
InputArray K, InputArray D, InputArray Knew, const Size& new_size)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
Size size = new_size.area() != 0 ? new_size : distorted.size();
@ -548,7 +548,7 @@ void cv::fisheye::undistortImage(InputArray distorted, OutputArray undistorted,
void cv::fisheye::estimateNewCameraMatrixForUndistortRectify(InputArray K, InputArray D, const Size &image_size, InputArray R,
OutputArray P, double balance, const Size& new_size, double fov_scale)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
CV_Assert( K.size() == Size(3, 3) && (K.depth() == CV_32F || K.depth() == CV_64F));
CV_Assert(D.empty() || ((D.total() == 4) && (D.depth() == CV_32F || D.depth() == CV_64F)));
@ -623,7 +623,7 @@ void cv::fisheye::stereoRectify( InputArray K1, InputArray D1, InputArray K2, In
InputArray _R, InputArray _tvec, OutputArray R1, OutputArray R2, OutputArray P1, OutputArray P2,
OutputArray Q, int flags, const Size& newImageSize, double balance, double fov_scale)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
CV_Assert((_R.size() == Size(3, 3) || _R.total() * _R.channels() == 3) && (_R.depth() == CV_32F || _R.depth() == CV_64F));
CV_Assert(_tvec.total() * _tvec.channels() == 3 && (_tvec.depth() == CV_32F || _tvec.depth() == CV_64F));
@ -707,7 +707,7 @@ double cv::fisheye::calibrate(InputArrayOfArrays objectPoints, InputArrayOfArray
InputOutputArray K, InputOutputArray D, OutputArrayOfArrays rvecs, OutputArrayOfArrays tvecs,
int flags , cv::TermCriteria criteria)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
CV_Assert(!objectPoints.empty() && !imagePoints.empty() && objectPoints.total() == imagePoints.total());
CV_Assert(objectPoints.type() == CV_32FC3 || objectPoints.type() == CV_64FC3);
@ -846,7 +846,7 @@ double cv::fisheye::stereoCalibrate(InputArrayOfArrays objectPoints, InputArrayO
InputOutputArray K1, InputOutputArray D1, InputOutputArray K2, InputOutputArray D2, Size imageSize,
OutputArray R, OutputArray T, int flags, TermCriteria criteria)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
CV_Assert(!objectPoints.empty() && !imagePoints1.empty() && !imagePoints2.empty());
CV_Assert(objectPoints.total() == imagePoints1.total() || imagePoints1.total() == imagePoints2.total());
@ -1172,7 +1172,7 @@ void cv::internal::projectPoints(cv::InputArray objectPoints, cv::OutputArray im
cv::InputArray _rvec,cv::InputArray _tvec,
const IntrinsicParams& param, cv::OutputArray jacobian)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
CV_Assert(!objectPoints.empty() && (objectPoints.type() == CV_32FC3 || objectPoints.type() == CV_64FC3));
Matx33d K(param.f[0], param.f[0] * param.alpha, param.c[0],
@ -1227,7 +1227,7 @@ void cv::internal::ComputeExtrinsicRefine(const Mat& imagePoints, const Mat& obj
cv::Mat cv::internal::ComputeHomography(Mat m, Mat M)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
int Np = m.cols;
@ -1328,7 +1328,7 @@ cv::Mat cv::internal::ComputeHomography(Mat m, Mat M)
cv::Mat cv::internal::NormalizePixels(const Mat& imagePoints, const IntrinsicParams& param)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
CV_Assert(!imagePoints.empty() && imagePoints.type() == CV_64FC2);

View File

@ -405,7 +405,7 @@ protected:
cv::Mat cv::findEssentialMat( InputArray _points1, InputArray _points2, InputArray _cameraMatrix,
int method, double prob, double threshold, OutputArray _mask)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
Mat points1, points2, cameraMatrix;
_points1.getMat().convertTo(points1, CV_64F);
@ -452,7 +452,7 @@ cv::Mat cv::findEssentialMat( InputArray _points1, InputArray _points2, InputArr
cv::Mat cv::findEssentialMat( InputArray _points1, InputArray _points2, double focal, Point2d pp,
int method, double prob, double threshold, OutputArray _mask)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
Mat cameraMatrix = (Mat_<double>(3,3) << focal, 0, pp.x, 0, focal, pp.y, 0, 0, 1);
return cv::findEssentialMat(_points1, _points2, cameraMatrix, method, prob, threshold, _mask);
@ -462,7 +462,7 @@ int cv::recoverPose( InputArray E, InputArray _points1, InputArray _points2,
InputArray _cameraMatrix, OutputArray _R, OutputArray _t, double distanceThresh,
InputOutputArray _mask, OutputArray triangulatedPoints)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
Mat points1, points2, cameraMatrix;
_points1.getMat().convertTo(points1, CV_64F);
@ -642,7 +642,7 @@ int cv::recoverPose( InputArray E, InputArray _points1, InputArray _points2, Out
void cv::decomposeEssentialMat( InputArray _E, OutputArray _R1, OutputArray _R2, OutputArray _t )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
Mat E = _E.getMat().reshape(1, 3);
CV_Assert(E.cols == 3 && E.rows == 3);

View File

@ -351,7 +351,7 @@ cv::Mat cv::findHomography( InputArray _points1, InputArray _points2,
int method, double ransacReprojThreshold, OutputArray _mask,
const int maxIters, const double confidence)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
const double defaultRANSACReprojThreshold = 3;
bool result = false;
@ -764,7 +764,7 @@ cv::Mat cv::findFundamentalMat( InputArray _points1, InputArray _points2,
int method, double ransacReprojThreshold, double confidence,
OutputArray _mask )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
Mat points1 = _points1.getMat(), points2 = _points2.getMat();
Mat m1, m2, F;
@ -836,7 +836,7 @@ cv::Mat cv::findFundamentalMat( InputArray _points1, InputArray _points2,
void cv::computeCorrespondEpilines( InputArray _points, int whichImage,
InputArray _Fmat, OutputArray _lines )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
double f[9] = {0};
Mat tempF(3, 3, CV_64F, f);
@ -911,7 +911,7 @@ void cv::computeCorrespondEpilines( InputArray _points, int whichImage,
void cv::convertPointsFromHomogeneous( InputArray _src, OutputArray _dst )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
Mat src = _src.getMat();
if( !src.isContinuous() )
@ -1012,7 +1012,7 @@ void cv::convertPointsFromHomogeneous( InputArray _src, OutputArray _dst )
void cv::convertPointsToHomogeneous( InputArray _src, OutputArray _dst )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
Mat src = _src.getMat();
if( !src.isContinuous() )
@ -1095,7 +1095,7 @@ void cv::convertPointsToHomogeneous( InputArray _src, OutputArray _dst )
void cv::convertPointsHomogeneous( InputArray _src, OutputArray _dst )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
int stype = _src.type(), dtype = _dst.type();
CV_Assert( _dst.fixedType() );
@ -1108,7 +1108,7 @@ void cv::convertPointsHomogeneous( InputArray _src, OutputArray _dst )
double cv::sampsonDistance(InputArray _pt1, InputArray _pt2, InputArray _F)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
CV_Assert(_pt1.type() == CV_64F && _pt2.type() == CV_64F && _F.type() == CV_64F);
CV_DbgAssert(_pt1.rows() == 3 && _F.size() == Size(3, 3) && _pt1.rows() == _pt2.rows());

View File

@ -33,7 +33,7 @@ p3p::p3p(double _fx, double _fy, double _cx, double _cy)
bool p3p::solve(cv::Mat& R, cv::Mat& tvec, const cv::Mat& opoints, const cv::Mat& ipoints)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
double rotation_matrix[3][3], translation[3];
std::vector<double> points;
@ -59,7 +59,7 @@ bool p3p::solve(cv::Mat& R, cv::Mat& tvec, const cv::Mat& opoints, const cv::Mat
int p3p::solve(std::vector<cv::Mat>& Rs, std::vector<cv::Mat>& tvecs, const cv::Mat& opoints, const cv::Mat& ipoints)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
double rotation_matrix[4][3][3], translation[4][3];
std::vector<double> points;

View File

@ -793,7 +793,7 @@ int estimateAffine3D(InputArray _from, InputArray _to,
OutputArray _out, OutputArray _inliers,
double ransacThreshold, double confidence)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
Mat from = _from.getMat(), to = _to.getMat();
int count = from.checkVector(3);

View File

@ -163,7 +163,7 @@ static int segment_hist_max(const Mat& hist, int& low_thresh, int& high_thresh)
bool cv::find4QuadCornerSubpix(InputArray _img, InputOutputArray _corners, Size region_size)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
Mat img = _img.getMat(), cornersM = _corners.getMat();
int ncorners = cornersM.checkVector(2, CV_32F);

View File

@ -57,7 +57,7 @@ bool solvePnP( InputArray _opoints, InputArray _ipoints,
InputArray _cameraMatrix, InputArray _distCoeffs,
OutputArray _rvec, OutputArray _tvec, bool useExtrinsicGuess, int flags )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
Mat opoints = _opoints.getMat(), ipoints = _ipoints.getMat();
int npoints = std::max(opoints.checkVector(3, CV_32F), opoints.checkVector(3, CV_64F));
@ -236,7 +236,7 @@ bool solvePnPRansac(InputArray _opoints, InputArray _ipoints,
int iterationsCount, float reprojectionError, double confidence,
OutputArray _inliers, int flags)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
Mat opoints0 = _opoints.getMat(), ipoints0 = _ipoints.getMat();
Mat opoints, ipoints;
@ -379,7 +379,7 @@ bool solvePnPRansac(InputArray _opoints, InputArray _ipoints,
int solveP3P( InputArray _opoints, InputArray _ipoints,
InputArray _cameraMatrix, InputArray _distCoeffs,
OutputArrayOfArrays _rvecs, OutputArrayOfArrays _tvecs, int flags) {
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
Mat opoints = _opoints.getMat(), ipoints = _ipoints.getMat();
int npoints = std::max(opoints.checkVector(3, CV_32F), opoints.checkVector(3, CV_64F));

View File

@ -1101,7 +1101,7 @@ public:
void compute( InputArray leftarr, InputArray rightarr, OutputArray disparr ) CV_OVERRIDE
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
int dtype = disparr.fixedType() ? disparr.type() : params.dispType;
Size leftsize = leftarr.size();

View File

@ -2151,7 +2151,7 @@ public:
void compute( InputArray leftarr, InputArray rightarr, OutputArray disparr ) CV_OVERRIDE
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
Mat left = leftarr.getMat(), right = rightarr.getMat();
CV_Assert( left.size() == right.size() && left.type() == right.type() &&
@ -2390,7 +2390,7 @@ void filterSpecklesImpl(cv::Mat& img, int newVal, int maxSpeckleSize, int maxDif
static bool ipp_filterSpeckles(Mat &img, int maxSpeckleSize, int newVal, int maxDiff, Mat &buffer)
{
#if IPP_VERSION_X100 >= 810
CV_INSTRUMENT_REGION_IPP()
CV_INSTRUMENT_REGION_IPP();
IppDataType dataType = ippiGetDataType(img.depth());
IppiSize size = ippiSize(img.size());
@ -2426,7 +2426,7 @@ static bool ipp_filterSpeckles(Mat &img, int maxSpeckleSize, int newVal, int max
void cv::filterSpeckles( InputOutputArray _img, double _newval, int maxSpeckleSize,
double _maxDiff, InputOutputArray __buf )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
Mat img = _img.getMat();
int type = img.type();
@ -2446,7 +2446,7 @@ void cv::filterSpeckles( InputOutputArray _img, double _newval, int maxSpeckleSi
void cv::validateDisparity( InputOutputArray _disp, InputArray _cost, int minDisparity,
int numberOfDisparities, int disp12MaxDiff )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
Mat disp = _disp.getMat(), cost = _cost.getMat();
int cols = disp.cols, rows = disp.rows;

View File

@ -347,7 +347,7 @@ void cv::triangulatePoints( InputArray _projMatr1, InputArray _projMatr2,
InputArray _projPoints1, InputArray _projPoints2,
OutputArray _points4D )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
Mat matr1 = _projMatr1.getMat(), matr2 = _projMatr2.getMat();
Mat points1 = _projPoints1.getMat(), points2 = _projPoints2.getMat();
@ -371,7 +371,7 @@ void cv::triangulatePoints( InputArray _projMatr1, InputArray _projMatr2,
void cv::correctMatches( InputArray _F, InputArray _points1, InputArray _points2,
OutputArray _newPoints1, OutputArray _newPoints2 )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
Mat F = _F.getMat();
Mat points1 = _points1.getMat(), points2 = _points2.getMat();

View File

@ -0,0 +1,23 @@
// This file is part of OpenCV project.
// It is subject to the license terms in the LICENSE file found in the top-level directory
// of this distribution and at http://opencv.org/license.html.
#ifndef OPENCV_CORE_BINDINGS_UTILS_HPP
#define OPENCV_CORE_BINDINGS_UTILS_HPP
namespace cv { namespace utils {
//! @addtogroup core_utils
//! @{
CV_EXPORTS_W String dumpInputArray(InputArray argument);
CV_EXPORTS_W String dumpInputArrayOfArrays(InputArrayOfArrays argument);
CV_EXPORTS_W String dumpInputOutputArray(InputOutputArray argument);
CV_EXPORTS_W String dumpInputOutputArrayOfArrays(InputOutputArrayOfArrays argument);
//! @}
}} // namespace
#endif // OPENCV_CORE_BINDINGS_UTILS_HPP

View File

@ -223,11 +223,7 @@ namespace cv { namespace cuda { namespace device
if (x_shifted + ft::smart_shift - 1 < src_.cols)
{
const read_type src_n_el = ((const read_type*)src)[x];
write_type dst_n_el = ((const write_type*)dst)[x];
OpUnroller<ft::smart_shift>::unroll(src_n_el, dst_n_el, mask, op, x_shifted, y);
((write_type*)dst)[x] = dst_n_el;
OpUnroller<ft::smart_shift>::unroll(src_n_el, ((write_type*)dst)[x], mask, op, x_shifted, y);
}
else
{
@ -275,11 +271,8 @@ namespace cv { namespace cuda { namespace device
{
const read_type1 src1_n_el = ((const read_type1*)src1)[x];
const read_type2 src2_n_el = ((const read_type2*)src2)[x];
write_type dst_n_el = ((const write_type*)dst)[x];
OpUnroller<ft::smart_shift>::unroll(src1_n_el, src2_n_el, dst_n_el, mask, op, x_shifted, y);
((write_type*)dst)[x] = dst_n_el;
OpUnroller<ft::smart_shift>::unroll(src1_n_el, src2_n_el, ((write_type*)dst)[x], mask, op, x_shifted, y);
}
else
{

View File

@ -57,7 +57,16 @@
# if defined __GNUC__ && defined __APPLE__
# pragma GCC diagnostic ignored "-Wshadow"
# endif
# if defined(_MSC_VER)
# pragma warning(push)
# pragma warning(disable:4701) // potentially uninitialized local variable
# pragma warning(disable:4702) // unreachable code
# pragma warning(disable:4714) // const marked as __forceinline not inlined
# endif
# include <Eigen/Core>
# if defined(_MSC_VER)
# pragma warning(pop)
# endif
# include "opencv2/core/eigen.hpp"
#endif
@ -731,15 +740,15 @@ CV_EXPORTS InstrNode* getCurrentNode();
///// General instrumentation
// General OpenCV region instrumentation macro
#define CV_INSTRUMENT_REGION_() CV_INSTRUMENT_REGION_META(__FUNCTION__, false, ::cv::instr::TYPE_GENERAL, ::cv::instr::IMPL_PLAIN)
#define CV_INSTRUMENT_REGION_(); CV_INSTRUMENT_REGION_META(__FUNCTION__, false, ::cv::instr::TYPE_GENERAL, ::cv::instr::IMPL_PLAIN)
// Custom OpenCV region instrumentation macro
#define CV_INSTRUMENT_REGION_NAME(NAME) CV_INSTRUMENT_REGION_CUSTOM_META(NAME, false, ::cv::instr::TYPE_GENERAL, ::cv::instr::IMPL_PLAIN)
// Instrumentation for parallel_for_ or other regions which forks and gathers threads
#define CV_INSTRUMENT_REGION_MT_FORK() CV_INSTRUMENT_REGION_META(__FUNCTION__, true, ::cv::instr::TYPE_GENERAL, ::cv::instr::IMPL_PLAIN);
#define CV_INSTRUMENT_REGION_MT_FORK(); CV_INSTRUMENT_REGION_META(__FUNCTION__, true, ::cv::instr::TYPE_GENERAL, ::cv::instr::IMPL_PLAIN);
///// IPP instrumentation
// Wrapper region instrumentation macro
#define CV_INSTRUMENT_REGION_IPP() CV_INSTRUMENT_REGION_META(__FUNCTION__, false, ::cv::instr::TYPE_WRAPPER, ::cv::instr::IMPL_IPP)
#define CV_INSTRUMENT_REGION_IPP(); CV_INSTRUMENT_REGION_META(__FUNCTION__, false, ::cv::instr::TYPE_WRAPPER, ::cv::instr::IMPL_IPP)
// Function instrumentation macro
#define CV_INSTRUMENT_FUN_IPP(FUN, ...) CV_INSTRUMENT_FUN_RT_META(::cv::instr::TYPE_FUN, ::cv::instr::IMPL_IPP, status < 0, FUN, __VA_ARGS__)
// Diagnostic markers
@ -747,7 +756,7 @@ CV_EXPORTS InstrNode* getCurrentNode();
///// OpenCL instrumentation
// Wrapper region instrumentation macro
#define CV_INSTRUMENT_REGION_OPENCL() CV_INSTRUMENT_REGION_META(__FUNCTION__, false, ::cv::instr::TYPE_WRAPPER, ::cv::instr::IMPL_OPENCL)
#define CV_INSTRUMENT_REGION_OPENCL(); CV_INSTRUMENT_REGION_META(__FUNCTION__, false, ::cv::instr::TYPE_WRAPPER, ::cv::instr::IMPL_OPENCL)
// OpenCL kernel compilation wrapper
#define CV_INSTRUMENT_REGION_OPENCL_COMPILE(NAME) CV_INSTRUMENT_REGION_META(NAME, false, ::cv::instr::TYPE_WRAPPER, ::cv::instr::IMPL_OPENCL)
// OpenCL kernel run wrapper
@ -757,24 +766,24 @@ CV_EXPORTS InstrNode* getCurrentNode();
#else
#define CV_INSTRUMENT_REGION_META(...)
#define CV_INSTRUMENT_REGION_() CV_TRACE_FUNCTION()
#define CV_INSTRUMENT_REGION_(); CV_TRACE_FUNCTION()
#define CV_INSTRUMENT_REGION_NAME(...) CV_TRACE_REGION(__VA_ARGS__)
#define CV_INSTRUMENT_REGION_MT_FORK()
#define CV_INSTRUMENT_REGION_MT_FORK();
#define CV_INSTRUMENT_REGION_IPP() CV__TRACE_REGION_("IPP", CV_TRACE_NS::details::REGION_FLAG_IMPL_IPP)
#define CV_INSTRUMENT_REGION_IPP(); CV__TRACE_REGION_("IPP", CV_TRACE_NS::details::REGION_FLAG_IMPL_IPP)
#define CV_INSTRUMENT_FUN_IPP(FUN, ...) ((FUN)(__VA_ARGS__))
#define CV_INSTRUMENT_MARK_IPP(...)
#define CV_INSTRUMENT_REGION_OPENCL() CV__TRACE_REGION_("OpenCL", CV_TRACE_NS::details::REGION_FLAG_IMPL_OPENCL)
#define CV_INSTRUMENT_REGION_OPENCL(); CV__TRACE_REGION_("OpenCL", CV_TRACE_NS::details::REGION_FLAG_IMPL_OPENCL)
#define CV_INSTRUMENT_REGION_OPENCL_COMPILE(...)
#define CV_INSTRUMENT_REGION_OPENCL_RUN(...)
#define CV_INSTRUMENT_MARK_OPENCL(...)
#endif
#ifdef __CV_AVX_GUARD
#define CV_INSTRUMENT_REGION() __CV_AVX_GUARD CV_INSTRUMENT_REGION_()
#define CV_INSTRUMENT_REGION(); __CV_AVX_GUARD CV_INSTRUMENT_REGION_();
#else
#define CV_INSTRUMENT_REGION() CV_INSTRUMENT_REGION_()
#define CV_INSTRUMENT_REGION(); CV_INSTRUMENT_REGION_();
#endif
//! @endcond

View File

@ -31,8 +31,9 @@ This section describes Intel VA-API/OpenCL (CL-VA) interoperability.
To enable CL-VA interoperability support, configure OpenCV using CMake with WITH_VA_INTEL=ON . Currently VA-API is
supported on Linux only. You should also install Intel Media Server Studio (MSS) to use this feature. You may
have to specify the path(s) to MSS components for cmake in environment variables: VA_INTEL_MSDK_ROOT for Media SDK
(default is "/opt/intel/mediasdk"), and VA_INTEL_IOCL_ROOT for Intel OpenCL (default is "/opt/intel/opencl").
have to specify the path(s) to MSS components for cmake in environment variables:
- VA_INTEL_IOCL_ROOT for Intel OpenCL (default is "/opt/intel/opencl").
To use CL-VA interoperability you should first create VADisplay (libva), and then call initializeContextFromVA()
function to create OpenCL context and set up interoperability.

View File

@ -369,7 +369,7 @@ static BinaryFuncC* getMinTab()
void cv::bitwise_and(InputArray a, InputArray b, OutputArray c, InputArray mask)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
BinaryFuncC f = (BinaryFuncC)GET_OPTIMIZED(cv::hal::and8u);
binary_op(a, b, c, mask, &f, true, OCL_OP_AND);
@ -377,7 +377,7 @@ void cv::bitwise_and(InputArray a, InputArray b, OutputArray c, InputArray mask)
void cv::bitwise_or(InputArray a, InputArray b, OutputArray c, InputArray mask)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
BinaryFuncC f = (BinaryFuncC)GET_OPTIMIZED(cv::hal::or8u);
binary_op(a, b, c, mask, &f, true, OCL_OP_OR);
@ -385,7 +385,7 @@ void cv::bitwise_or(InputArray a, InputArray b, OutputArray c, InputArray mask)
void cv::bitwise_xor(InputArray a, InputArray b, OutputArray c, InputArray mask)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
BinaryFuncC f = (BinaryFuncC)GET_OPTIMIZED(cv::hal::xor8u);
binary_op(a, b, c, mask, &f, true, OCL_OP_XOR);
@ -393,7 +393,7 @@ void cv::bitwise_xor(InputArray a, InputArray b, OutputArray c, InputArray mask)
void cv::bitwise_not(InputArray a, OutputArray c, InputArray mask)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
BinaryFuncC f = (BinaryFuncC)GET_OPTIMIZED(cv::hal::not8u);
binary_op(a, a, c, mask, &f, true, OCL_OP_NOT);
@ -401,21 +401,21 @@ void cv::bitwise_not(InputArray a, OutputArray c, InputArray mask)
void cv::max( InputArray src1, InputArray src2, OutputArray dst )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
binary_op(src1, src2, dst, noArray(), getMaxTab(), false, OCL_OP_MAX );
}
void cv::min( InputArray src1, InputArray src2, OutputArray dst )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
binary_op(src1, src2, dst, noArray(), getMinTab(), false, OCL_OP_MIN );
}
void cv::max(const Mat& src1, const Mat& src2, Mat& dst)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
OutputArray _dst(dst);
binary_op(src1, src2, _dst, noArray(), getMaxTab(), false, OCL_OP_MAX );
@ -423,7 +423,7 @@ void cv::max(const Mat& src1, const Mat& src2, Mat& dst)
void cv::min(const Mat& src1, const Mat& src2, Mat& dst)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
OutputArray _dst(dst);
binary_op(src1, src2, _dst, noArray(), getMinTab(), false, OCL_OP_MIN );
@ -431,7 +431,7 @@ void cv::min(const Mat& src1, const Mat& src2, Mat& dst)
void cv::max(const UMat& src1, const UMat& src2, UMat& dst)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
OutputArray _dst(dst);
binary_op(src1, src2, _dst, noArray(), getMaxTab(), false, OCL_OP_MAX );
@ -439,7 +439,7 @@ void cv::max(const UMat& src1, const UMat& src2, UMat& dst)
void cv::min(const UMat& src1, const UMat& src2, UMat& dst)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
OutputArray _dst(dst);
binary_op(src1, src2, _dst, noArray(), getMinTab(), false, OCL_OP_MIN );
@ -921,7 +921,7 @@ static BinaryFuncC* getAbsDiffTab()
void cv::add( InputArray src1, InputArray src2, OutputArray dst,
InputArray mask, int dtype )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
arithm_op(src1, src2, dst, mask, dtype, getAddTab(), false, 0, OCL_OP_ADD );
}
@ -929,14 +929,14 @@ void cv::add( InputArray src1, InputArray src2, OutputArray dst,
void cv::subtract( InputArray _src1, InputArray _src2, OutputArray _dst,
InputArray mask, int dtype )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
arithm_op(_src1, _src2, _dst, mask, dtype, getSubTab(), false, 0, OCL_OP_SUB );
}
void cv::absdiff( InputArray src1, InputArray src2, OutputArray dst )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
arithm_op(src1, src2, dst, noArray(), -1, getAbsDiffTab(), false, 0, OCL_OP_ABSDIFF);
}
@ -989,7 +989,7 @@ static BinaryFuncC* getRecipTab()
void cv::multiply(InputArray src1, InputArray src2,
OutputArray dst, double scale, int dtype)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
arithm_op(src1, src2, dst, noArray(), dtype, getMulTab(),
true, &scale, std::abs(scale - 1.0) < DBL_EPSILON ? OCL_OP_MUL : OCL_OP_MUL_SCALE);
@ -998,7 +998,7 @@ void cv::multiply(InputArray src1, InputArray src2,
void cv::divide(InputArray src1, InputArray src2,
OutputArray dst, double scale, int dtype)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
arithm_op(src1, src2, dst, noArray(), dtype, getDivTab(), true, &scale, OCL_OP_DIV_SCALE);
}
@ -1006,7 +1006,7 @@ void cv::divide(InputArray src1, InputArray src2,
void cv::divide(double scale, InputArray src2,
OutputArray dst, int dtype)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
arithm_op(src2, src2, dst, noArray(), dtype, getRecipTab(), true, &scale, OCL_OP_RECIP_SCALE);
}
@ -1035,7 +1035,7 @@ static BinaryFuncC* getAddWeightedTab()
void cv::addWeighted( InputArray src1, double alpha, InputArray src2,
double beta, double gamma, OutputArray dst, int dtype )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
double scalars[] = {alpha, beta, gamma};
arithm_op(src1, src2, dst, noArray(), dtype, getAddWeightedTab(), true, scalars, OCL_OP_ADDW);
@ -1175,7 +1175,7 @@ static bool ocl_compare(InputArray _src1, InputArray _src2, OutputArray _dst, in
void cv::compare(InputArray _src1, InputArray _src2, OutputArray _dst, int op)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
CV_Assert( op == CMP_LT || op == CMP_LE || op == CMP_EQ ||
op == CMP_NE || op == CMP_GE || op == CMP_GT );
@ -1704,7 +1704,7 @@ static bool ocl_inRange( InputArray _src, InputArray _lowerb,
void cv::inRange(InputArray _src, InputArray _lowerb,
InputArray _upperb, OutputArray _dst)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
CV_Assert(! _src.empty());

View File

@ -3224,7 +3224,7 @@ void scalarToRawData_(const Scalar& s, T * const buf, const int cn, const int un
void scalarToRawData(const Scalar& s, void* _buf, int type, int unroll_to)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
const int depth = CV_MAT_DEPTH(type), cn = CV_MAT_CN(type);
CV_Assert(cn <= 4);

View File

@ -267,7 +267,7 @@ void cv::batchDistance( InputArray _src1, InputArray _src2,
int normType, int K, InputArray _mask,
int update, bool crosscheck )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
Mat src1 = _src1.getMat(), src2 = _src2.getMat(), mask = _mask.getMat();
int type = src1.type();

View File

@ -0,0 +1,145 @@
// This file is part of OpenCV project.
// It is subject to the license terms in the LICENSE file found in the top-level directory
// of this distribution and at http://opencv.org/license.html.
#include "precomp.hpp"
#include "opencv2/core/bindings_utils.hpp"
#include <sstream>
namespace cv { namespace utils {
String dumpInputArray(InputArray argument)
{
if (&argument == &noArray())
return "InputArray: noArray()";
std::ostringstream ss;
ss << "InputArray:";
try {
do {
ss << (argument.empty() ? " empty()=true" : " empty()=false");
ss << cv::format(" kind=0x%08llx", (long long int)argument.kind());
ss << cv::format(" flags=0x%08llx", (long long int)argument.getFlags());
if (argument.getObj() == NULL)
{
ss << " obj=NULL";
break; // done
}
ss << cv::format(" total(-1)=%lld", (long long int)argument.total(-1));
ss << cv::format(" dims(-1)=%d", argument.dims(-1));
Size size = argument.size(-1);
ss << cv::format(" size(-1)=%dx%d", size.width, size.height);
ss << " type(-1)=" << cv::typeToString(argument.type(-1));
} while (0);
}
catch (...)
{
ss << " ERROR: exception occured, dump is non-complete"; // need to properly support different kinds
}
return ss.str();
}
CV_EXPORTS_W String dumpInputArrayOfArrays(InputArrayOfArrays argument)
{
if (&argument == &noArray())
return "InputArrayOfArrays: noArray()";
std::ostringstream ss;
ss << "InputArrayOfArrays:";
try {
do {
ss << (argument.empty() ? " empty()=true" : " empty()=false");
ss << cv::format(" kind=0x%08llx", (long long int)argument.kind());
ss << cv::format(" flags=0x%08llx", (long long int)argument.getFlags());
if (argument.getObj() == NULL)
{
ss << " obj=NULL";
break; // done
}
ss << cv::format(" total(-1)=%lld", (long long int)argument.total(-1));
ss << cv::format(" dims(-1)=%d", argument.dims(-1));
Size size = argument.size(-1);
ss << cv::format(" size(-1)=%dx%d", size.width, size.height);
if (argument.total(-1) > 0)
{
ss << " type(0)=" << cv::typeToString(argument.type(0));
ss << cv::format(" dims(0)=%d", argument.dims(0));
size = argument.size(0);
ss << cv::format(" size(0)=%dx%d", size.width, size.height);
ss << " type(0)=" << cv::typeToString(argument.type(0));
}
} while (0);
}
catch (...)
{
ss << " ERROR: exception occured, dump is non-complete"; // need to properly support different kinds
}
return ss.str();
}
CV_EXPORTS_W String dumpInputOutputArray(InputOutputArray argument)
{
if (&argument == &noArray())
return "InputOutputArray: noArray()";
std::ostringstream ss;
ss << "InputOutputArray:";
try {
do {
ss << (argument.empty() ? " empty()=true" : " empty()=false");
ss << cv::format(" kind=0x%08llx", (long long int)argument.kind());
ss << cv::format(" flags=0x%08llx", (long long int)argument.getFlags());
if (argument.getObj() == NULL)
{
ss << " obj=NULL";
break; // done
}
ss << cv::format(" total(-1)=%lld", (long long int)argument.total(-1));
ss << cv::format(" dims(-1)=%d", argument.dims(-1));
Size size = argument.size(-1);
ss << cv::format(" size(-1)=%dx%d", size.width, size.height);
ss << " type(-1)=" << cv::typeToString(argument.type(-1));
} while (0);
}
catch (...)
{
ss << " ERROR: exception occured, dump is non-complete"; // need to properly support different kinds
}
return ss.str();
}
CV_EXPORTS_W String dumpInputOutputArrayOfArrays(InputOutputArrayOfArrays argument)
{
if (&argument == &noArray())
return "InputOutputArrayOfArrays: noArray()";
std::ostringstream ss;
ss << "InputOutputArrayOfArrays:";
try {
do {
ss << (argument.empty() ? " empty()=true" : " empty()=false");
ss << cv::format(" kind=0x%08llx", (long long int)argument.kind());
ss << cv::format(" flags=0x%08llx", (long long int)argument.getFlags());
if (argument.getObj() == NULL)
{
ss << " obj=NULL";
break; // done
}
ss << cv::format(" total(-1)=%lld", (long long int)argument.total(-1));
ss << cv::format(" dims(-1)=%d", argument.dims(-1));
Size size = argument.size(-1);
ss << cv::format(" size(-1)=%dx%d", size.width, size.height);
if (argument.total(-1) > 0)
{
ss << " type(0)=" << cv::typeToString(argument.type(0));
ss << cv::format(" dims(0)=%d", argument.dims(0));
size = argument.size(0);
ss << cv::format(" size(0)=%dx%d", size.width, size.height);
ss << " type(0)=" << cv::typeToString(argument.type(0));
}
} while (0);
}
catch (...)
{
ss << " ERROR: exception occured, dump is non-complete"; // need to properly support different kinds
}
return ss.str();
}
}} // namespace

View File

@ -94,7 +94,7 @@ static MixChannelsFunc getMixchFunc(int depth)
void cv::mixChannels( const Mat* src, size_t nsrcs, Mat* dst, size_t ndsts, const int* fromTo, size_t npairs )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
if( npairs == 0 )
return;
@ -272,7 +272,7 @@ static bool ocl_mixChannels(InputArrayOfArrays _src, InputOutputArrayOfArrays _d
void cv::mixChannels(InputArrayOfArrays src, InputOutputArrayOfArrays dst,
const int* fromTo, size_t npairs)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
if (npairs == 0 || fromTo == NULL)
return;
@ -305,7 +305,7 @@ void cv::mixChannels(InputArrayOfArrays src, InputOutputArrayOfArrays dst,
void cv::mixChannels(InputArrayOfArrays src, InputOutputArrayOfArrays dst,
const std::vector<int>& fromTo)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
if (fromTo.empty())
return;
@ -342,7 +342,7 @@ namespace cv
static bool ipp_extractChannel(const Mat &src, Mat &dst, int channel)
{
#ifdef HAVE_IPP_IW
CV_INSTRUMENT_REGION_IPP()
CV_INSTRUMENT_REGION_IPP();
int srcChannels = src.channels();
int dstChannels = dst.channels();
@ -380,7 +380,7 @@ static bool ipp_extractChannel(const Mat &src, Mat &dst, int channel)
static bool ipp_insertChannel(const Mat &src, Mat &dst, int channel)
{
#ifdef HAVE_IPP_IW
CV_INSTRUMENT_REGION_IPP()
CV_INSTRUMENT_REGION_IPP();
int srcChannels = src.channels();
int dstChannels = dst.channels();
@ -419,7 +419,7 @@ static bool ipp_insertChannel(const Mat &src, Mat &dst, int channel)
void cv::extractChannel(InputArray _src, OutputArray _dst, int coi)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
int type = _src.type(), depth = CV_MAT_DEPTH(type), cn = CV_MAT_CN(type);
CV_Assert( 0 <= coi && coi < cn );
@ -447,7 +447,7 @@ void cv::extractChannel(InputArray _src, OutputArray _dst, int coi)
void cv::insertChannel(InputArray _src, InputOutputArray _dst, int coi)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
int stype = _src.type(), sdepth = CV_MAT_DEPTH(stype), scn = CV_MAT_CN(stype);
int dtype = _dst.type(), ddepth = CV_MAT_DEPTH(dtype), dcn = CV_MAT_CN(dtype);

View File

@ -413,7 +413,7 @@ static bool ocl_convertFp16( InputArray _src, OutputArray _dst, int sdepth, int
void cv::Mat::convertTo(OutputArray _dst, int _type, double alpha, double beta) const
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
if( empty() )
{
@ -469,7 +469,7 @@ void cv::Mat::convertTo(OutputArray _dst, int _type, double alpha, double beta)
void cv::convertFp16( InputArray _src, OutputArray _dst )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
int sdepth = _src.depth(), ddepth = 0;
BinaryFunc func = 0;

View File

@ -411,7 +411,7 @@ static bool ocl_convertScaleAbs( InputArray _src, OutputArray _dst, double alpha
void cv::convertScaleAbs( InputArray _src, OutputArray _dst, double alpha, double beta )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
CV_OCL_RUN(_src.dims() <= 2 && _dst.isUMat(),
ocl_convertScaleAbs(_src, _dst, alpha, beta))
@ -539,7 +539,7 @@ static bool ocl_normalize( InputArray _src, InputOutputArray _dst, InputArray _m
void cv::normalize( InputArray _src, InputOutputArray _dst, double a, double b,
int norm_type, int rtype, InputArray _mask )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
double scale = 1, shift = 0;
int type = _src.type(), depth = CV_MAT_DEPTH(type);

View File

@ -236,7 +236,7 @@ BinaryFunc getCopyMaskFunc(size_t esz)
/* dst = src */
void Mat::copyTo( OutputArray _dst ) const
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
int dtype = _dst.type();
if( _dst.fixedType() && dtype != type() )
@ -319,7 +319,7 @@ void Mat::copyTo( OutputArray _dst ) const
static bool ipp_copyTo(const Mat &src, Mat &dst, const Mat &mask)
{
#ifdef HAVE_IPP_IW
CV_INSTRUMENT_REGION_IPP()
CV_INSTRUMENT_REGION_IPP();
if(mask.channels() > 1 || mask.depth() != CV_8U)
return false;
@ -353,7 +353,7 @@ static bool ipp_copyTo(const Mat &src, Mat &dst, const Mat &mask)
void Mat::copyTo( OutputArray _dst, InputArray _mask ) const
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
Mat mask = _mask.getMat();
if( !mask.data )
@ -409,7 +409,7 @@ void Mat::copyTo( OutputArray _dst, InputArray _mask ) const
Mat& Mat::operator = (const Scalar& s)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
if (this->empty())
return *this;
@ -454,7 +454,7 @@ Mat& Mat::operator = (const Scalar& s)
static bool ipp_Mat_setTo_Mat(Mat &dst, Mat &_val, Mat &mask)
{
#ifdef HAVE_IPP_IW
CV_INSTRUMENT_REGION_IPP()
CV_INSTRUMENT_REGION_IPP();
if(mask.empty())
return false;
@ -511,7 +511,7 @@ static bool ipp_Mat_setTo_Mat(Mat &dst, Mat &_val, Mat &mask)
Mat& Mat::setTo(InputArray _value, InputArray _mask)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
if( empty() )
return *this;
@ -702,7 +702,7 @@ static bool ocl_flip(InputArray _src, OutputArray _dst, int flipCode )
static bool ipp_flip(Mat &src, Mat &dst, int flip_mode)
{
#ifdef HAVE_IPP_IW
CV_INSTRUMENT_REGION_IPP()
CV_INSTRUMENT_REGION_IPP();
IppiAxis ippMode;
if(flip_mode < 0)
@ -735,7 +735,7 @@ static bool ipp_flip(Mat &src, Mat &dst, int flip_mode)
void flip( InputArray _src, OutputArray _dst, int flip_mode )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
CV_Assert( _src.dims() <= 2 );
Size size = _src.size();
@ -855,7 +855,7 @@ static bool ocl_repeat(InputArray _src, int ny, int nx, OutputArray _dst)
void repeat(InputArray _src, int ny, int nx, OutputArray _dst)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
CV_Assert(_src.getObj() != _dst.getObj());
CV_Assert( _src.dims() <= 2 );
@ -1143,7 +1143,7 @@ static bool ipp_copyMakeBorder( Mat &_src, Mat &_dst, int top, int bottom,
int left, int right, int _borderType, const Scalar& value )
{
#if defined HAVE_IPP_IW && !IPP_DISABLE_PERF_COPYMAKE
CV_INSTRUMENT_REGION_IPP()
CV_INSTRUMENT_REGION_IPP();
::ipp::IwiBorderSize borderSize(left, top, right, bottom);
::ipp::IwiSize size(_src.cols, _src.rows);
@ -1174,7 +1174,7 @@ static bool ipp_copyMakeBorder( Mat &_src, Mat &_dst, int top, int bottom,
void cv::copyMakeBorder( InputArray _src, OutputArray _dst, int top, int bottom,
int left, int right, int borderType, const Scalar& value )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
CV_Assert( top >= 0 && bottom >= 0 && left >= 0 && right >= 0 );

View File

@ -232,7 +232,7 @@ static bool ocl_countNonZero( InputArray _src, int & res )
#if defined HAVE_IPP
static bool ipp_countNonZero( Mat &src, int &res )
{
CV_INSTRUMENT_REGION_IPP()
CV_INSTRUMENT_REGION_IPP();
#if IPP_VERSION_X100 < 201801
// Poor performance of SSE42
@ -292,7 +292,7 @@ static bool ipp_countNonZero( Mat &src, int &res )
int cv::countNonZero( InputArray _src )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
int type = _src.type(), cn = CV_MAT_CN(type);
CV_Assert( cn == 1 );
@ -326,7 +326,7 @@ int cv::countNonZero( InputArray _src )
void cv::findNonZero( InputArray _src, OutputArray _idx )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
Mat src = _src.getMat();
CV_Assert( src.channels() == 1 && src.dims == 2 );

View File

@ -45,6 +45,10 @@
using namespace cv;
using namespace cv::cuda;
#if defined(_MSC_VER)
#pragma warning(disable : 4702) // unreachable code
#endif
/////////////////////////////////////////////////////////////
/// MemoryStack

View File

@ -1752,7 +1752,7 @@ private:
static bool ippi_DFT_C_32F(const uchar * src, size_t src_step, uchar * dst, size_t dst_step, int width, int height, bool inv, int norm_flag)
{
CV_INSTRUMENT_REGION_IPP()
CV_INSTRUMENT_REGION_IPP();
IppStatus status;
Ipp8u* pBuffer = 0;
@ -1808,7 +1808,7 @@ static bool ippi_DFT_C_32F(const uchar * src, size_t src_step, uchar * dst, size
static bool ippi_DFT_R_32F(const uchar * src, size_t src_step, uchar * dst, size_t dst_step, int width, int height, bool inv, int norm_flag)
{
CV_INSTRUMENT_REGION_IPP()
CV_INSTRUMENT_REGION_IPP();
IppStatus status;
Ipp8u* pBuffer = 0;
@ -3314,7 +3314,7 @@ Ptr<DFT2D> DFT2D::create(int width, int height, int depth,
void cv::dft( InputArray _src0, OutputArray _dst, int flags, int nonzero_rows )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
#ifdef HAVE_CLAMDFFT
CV_OCL_RUN(ocl::haveAmdFft() && ocl::Device::getDefault().type() != ocl::Device::TYPE_CPU &&
@ -3364,7 +3364,7 @@ void cv::dft( InputArray _src0, OutputArray _dst, int flags, int nonzero_rows )
void cv::idft( InputArray src, OutputArray dst, int flags, int nonzero_rows )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
dft( src, dst, flags | DFT_INVERSE, nonzero_rows );
}
@ -3529,7 +3529,7 @@ void mulSpectrums_Impl(const T* dataA, const T* dataB, T* dataC, size_t stepA, s
void cv::mulSpectrums( InputArray _srcA, InputArray _srcB,
OutputArray _dst, int flags, bool conjB )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
CV_OCL_RUN(_dst.isUMat() && _srcA.dims() <= 2 && _srcB.dims() <= 2,
ocl_mulSpectrums(_srcA, _srcB, _dst, flags, conjB))
@ -3941,7 +3941,7 @@ static bool DctIPPLoop(const uchar * src, size_t src_step, uchar * dst, size_t d
static bool ippi_DCT_32f(const uchar * src, size_t src_step, uchar * dst, size_t dst_step, int width, int height, bool inv, bool row)
{
CV_INSTRUMENT_REGION_IPP()
CV_INSTRUMENT_REGION_IPP();
if(row)
return DctIPPLoop(src, src_step, dst, dst_step, width, height, inv);
@ -4236,7 +4236,7 @@ Ptr<DCT2D> DCT2D::create(int width, int height, int depth, int flags)
void cv::dct( InputArray _src0, OutputArray _dst, int flags )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
Mat src0 = _src0.getMat(), src = src0;
int type = src.type(), depth = src.depth();
@ -4260,7 +4260,7 @@ void cv::dct( InputArray _src0, OutputArray _dst, int flags )
void cv::idct( InputArray src, OutputArray dst, int flags )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
dct( src, dst, flags | DCT_INVERSE );
}

View File

@ -171,7 +171,7 @@ static bool isDir(const cv::String& path, DIR* dir)
bool cv::utils::fs::isDirectory(const cv::String& path)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
return isDir(path, NULL);
}
@ -270,7 +270,7 @@ static void glob_rec(const cv::String& directory, const cv::String& wildchart, s
void cv::glob(String pattern, std::vector<String>& result, bool recursive)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
result.clear();
String path, wildchart;

View File

@ -228,7 +228,7 @@ double cv::kmeans( InputArray _data, int K,
TermCriteria criteria, int attempts,
int flags, OutputArray _centers )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
const int SPP_TRIALS = 3;
Mat data0 = _data.getMat();
const bool isrow = data0.rows == 1;

View File

@ -44,9 +44,18 @@
#include <limits>
#ifdef HAVE_EIGEN
#include <Eigen/Core>
#include <Eigen/Eigenvalues>
#include "opencv2/core/eigen.hpp"
# if defined(_MSC_VER)
# pragma warning(push)
# pragma warning(disable:4701) // potentially uninitialized local variable
# pragma warning(disable:4702) // unreachable code
# pragma warning(disable:4714) // const marked as __forceinline not inlined
# endif
# include <Eigen/Core>
# include <Eigen/Eigenvalues>
# if defined(_MSC_VER)
# pragma warning(pop)
# endif
# include "opencv2/core/eigen.hpp"
#endif
#if defined _M_IX86 && defined _MSC_VER && _MSC_VER < 1700
@ -58,28 +67,28 @@ namespace cv
int LU(float* A, size_t astep, int m, float* b, size_t bstep, int n)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
return hal::LU32f(A, astep, m, b, bstep, n);
}
int LU(double* A, size_t astep, int m, double* b, size_t bstep, int n)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
return hal::LU64f(A, astep, m, b, bstep, n);
}
bool Cholesky(float* A, size_t astep, int m, float* b, size_t bstep, int n)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
return hal::Cholesky32f(A, astep, m, b, bstep, n);
}
bool Cholesky(double* A, size_t astep, int m, double* b, size_t bstep, int n)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
return hal::Cholesky64f(A, astep, m, b, bstep, n);
}
@ -752,7 +761,7 @@ SVBkSb( int m, int n, const double* w, size_t wstep,
double cv::determinant( InputArray _mat )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
Mat mat = _mat.getMat();
double result = 0;
@ -830,7 +839,7 @@ double cv::determinant( InputArray _mat )
double cv::invert( InputArray _src, OutputArray _dst, int method )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
bool result = false;
Mat src = _src.getMat();
@ -1090,7 +1099,7 @@ double cv::invert( InputArray _src, OutputArray _dst, int method )
bool cv::solve( InputArray _src, InputArray _src2arg, OutputArray _dst, int method )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
bool result = true;
Mat src = _src.getMat(), _src2 = _src2arg.getMat();
@ -1389,7 +1398,7 @@ bool cv::solve( InputArray _src, InputArray _src2arg, OutputArray _dst, int meth
bool cv::eigen( InputArray _src, OutputArray _evals, OutputArray _evects )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
Mat src = _src.getMat();
int type = src.type();
@ -1541,14 +1550,14 @@ static void _SVDcompute( InputArray _aarr, OutputArray _w,
void SVD::compute( InputArray a, OutputArray w, OutputArray u, OutputArray vt, int flags )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
_SVDcompute(a, w, u, vt, flags);
}
void SVD::compute( InputArray a, OutputArray w, int flags )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
_SVDcompute(a, w, noArray(), noArray(), flags);
}
@ -1598,14 +1607,14 @@ void SVD::backSubst( InputArray rhs, OutputArray dst ) const
void cv::SVDecomp(InputArray src, OutputArray w, OutputArray u, OutputArray vt, int flags)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
SVD::compute(src, w, u, vt, flags);
}
void cv::SVBackSubst(InputArray w, InputArray u, InputArray vt, InputArray rhs, OutputArray dst)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
SVD::backSubst(w, u, vt, rhs, dst);
}

View File

@ -906,7 +906,7 @@ public:
// National Institute of Standards and Technology (NIST).
void compute(InputArray src, bool fallbackSymmetric)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
if(fallbackSymmetric && isSymmetric(src)) {
// Fall back to OpenCV for a symmetric matrix!
@ -944,7 +944,7 @@ public:
void eigenNonSymmetric(InputArray _src, OutputArray _evals, OutputArray _evects)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
Mat src = _src.getMat();
int type = src.type();

View File

@ -271,7 +271,7 @@ private:
static bool ipp_lut(Mat &src, Mat &lut, Mat &dst)
{
CV_INSTRUMENT_REGION_IPP()
CV_INSTRUMENT_REGION_IPP();
int lutcn = lut.channels();
@ -358,7 +358,7 @@ private:
void cv::LUT( InputArray _src, InputArray _lut, OutputArray _dst )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
int cn = _src.channels(), depth = _src.depth();
int lutcn = _lut.channels();

View File

@ -102,7 +102,7 @@ static bool ocl_math_op(InputArray _src1, InputArray _src2, OutputArray _dst, in
\* ************************************************************************** */
float cubeRoot( float value )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
float fr;
Cv32suf v, m;
@ -145,7 +145,7 @@ float cubeRoot( float value )
void magnitude( InputArray src1, InputArray src2, OutputArray dst )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
int type = src1.type(), depth = src1.depth(), cn = src1.channels();
CV_Assert( src1.size() == src2.size() && type == src2.type() && (depth == CV_32F || depth == CV_64F));
@ -181,7 +181,7 @@ void magnitude( InputArray src1, InputArray src2, OutputArray dst )
void phase( InputArray src1, InputArray src2, OutputArray dst, bool angleInDegrees )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
int type = src1.type(), depth = src1.depth(), cn = src1.channels();
CV_Assert( src1.size() == src2.size() && type == src2.type() && (depth == CV_32F || depth == CV_64F));
@ -267,7 +267,7 @@ static bool ocl_cartToPolar( InputArray _src1, InputArray _src2,
void cartToPolar( InputArray src1, InputArray src2,
OutputArray dst1, OutputArray dst2, bool angleInDegrees )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
CV_OCL_RUN(dst1.isUMat() && dst2.isUMat(),
ocl_cartToPolar(src1, src2, dst1, dst2, angleInDegrees))
@ -501,7 +501,7 @@ static bool ocl_polarToCart( InputArray _mag, InputArray _angle,
#ifdef HAVE_IPP
static bool ipp_polarToCart(Mat &mag, Mat &angle, Mat &x, Mat &y)
{
CV_INSTRUMENT_REGION_IPP()
CV_INSTRUMENT_REGION_IPP();
int depth = angle.depth();
if(depth != CV_32F && depth != CV_64F)
@ -560,7 +560,7 @@ static bool ipp_polarToCart(Mat &mag, Mat &angle, Mat &x, Mat &y)
void polarToCart( InputArray src1, InputArray src2,
OutputArray dst1, OutputArray dst2, bool angleInDegrees )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
int type = src2.type(), depth = CV_MAT_DEPTH(type), cn = CV_MAT_CN(type);
CV_Assert((depth == CV_32F || depth == CV_64F) && (src1.empty() || src1.type() == type));
@ -663,7 +663,7 @@ void polarToCart( InputArray src1, InputArray src2,
void exp( InputArray _src, OutputArray _dst )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
int type = _src.type(), depth = _src.depth(), cn = _src.channels();
CV_Assert( depth == CV_32F || depth == CV_64F );
@ -696,7 +696,7 @@ void exp( InputArray _src, OutputArray _dst )
void log( InputArray _src, OutputArray _dst )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
int type = _src.type(), depth = _src.depth(), cn = _src.channels();
CV_Assert( depth == CV_32F || depth == CV_64F );
@ -1202,7 +1202,7 @@ static bool ocl_pow(InputArray _src, double power, OutputArray _dst,
void pow( InputArray _src, double power, OutputArray _dst )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
int type = _src.type(), depth = CV_MAT_DEPTH(type),
cn = CV_MAT_CN(type), ipower = cvRound(power);
@ -1353,7 +1353,7 @@ void pow( InputArray _src, double power, OutputArray _dst )
void sqrt(InputArray a, OutputArray b)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
cv::pow(a, 0.5, b);
}
@ -1440,7 +1440,7 @@ check_range_function check_range_functions[] =
bool checkRange(InputArray _src, bool quiet, Point* pt, double minVal, double maxVal)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
Mat src = _src.getMat();
@ -1579,7 +1579,7 @@ static bool ocl_patchNaNs( InputOutputArray _a, float value )
void patchNaNs( InputOutputArray _a, double _val )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
CV_Assert( _a.depth() == CV_32F );
@ -1736,7 +1736,7 @@ CV_IMPL int cvCheckArr( const CvArr* arr, int flags,
int cv::solveCubic( InputArray _coeffs, OutputArray _roots )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
const int n0 = 3;
Mat coeffs = _coeffs.getMat();
@ -1883,7 +1883,7 @@ int cv::solveCubic( InputArray _coeffs, OutputArray _roots )
http://en.wikipedia.org/wiki/Durand%E2%80%93Kerner_method */
double cv::solvePoly( InputArray _coeffs0, OutputArray _roots0, int maxIters )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
typedef Complex<double> C;

View File

@ -13,7 +13,7 @@ namespace cv { namespace hal {
void fastAtan32f(const float *Y, const float *X, float *angle, int len, bool angleInDegrees )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
CALL_HAL(fastAtan32f, cv_hal_fastAtan32f, Y, X, angle, len, angleInDegrees);
@ -23,7 +23,7 @@ void fastAtan32f(const float *Y, const float *X, float *angle, int len, bool ang
void fastAtan64f(const double *Y, const double *X, double *angle, int len, bool angleInDegrees)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
CALL_HAL(fastAtan64f, cv_hal_fastAtan64f, Y, X, angle, len, angleInDegrees);
@ -34,14 +34,14 @@ void fastAtan64f(const double *Y, const double *X, double *angle, int len, bool
// deprecated
void fastAtan2(const float *Y, const float *X, float *angle, int len, bool angleInDegrees )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
fastAtan32f(Y, X, angle, len, angleInDegrees);
}
void magnitude32f(const float* x, const float* y, float* mag, int len)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
CALL_HAL(magnitude32f, cv_hal_magnitude32f, x, y, mag, len);
// SSE42 performance issues
@ -53,7 +53,7 @@ void magnitude32f(const float* x, const float* y, float* mag, int len)
void magnitude64f(const double* x, const double* y, double* mag, int len)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
CALL_HAL(magnitude64f, cv_hal_magnitude64f, x, y, mag, len);
// SSE42 performance issues
@ -66,7 +66,7 @@ void magnitude64f(const double* x, const double* y, double* mag, int len)
void invSqrt32f(const float* src, float* dst, int len)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
CALL_HAL(invSqrt32f, cv_hal_invSqrt32f, src, dst, len);
CV_IPP_RUN_FAST(CV_INSTRUMENT_FUN_IPP(ippsInvSqrt_32f_A21, src, dst, len) >= 0);
@ -78,7 +78,7 @@ void invSqrt32f(const float* src, float* dst, int len)
void invSqrt64f(const double* src, double* dst, int len)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
CALL_HAL(invSqrt64f, cv_hal_invSqrt64f, src, dst, len);
CV_IPP_RUN_FAST(CV_INSTRUMENT_FUN_IPP(ippsInvSqrt_64f_A50, src, dst, len) >= 0);
@ -90,7 +90,7 @@ void invSqrt64f(const double* src, double* dst, int len)
void sqrt32f(const float* src, float* dst, int len)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
CALL_HAL(sqrt32f, cv_hal_sqrt32f, src, dst, len);
@ -101,7 +101,7 @@ void sqrt32f(const float* src, float* dst, int len)
void sqrt64f(const double* src, double* dst, int len)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
CALL_HAL(sqrt64f, cv_hal_sqrt64f, src, dst, len);
@ -111,7 +111,7 @@ void sqrt64f(const double* src, double* dst, int len)
void exp32f(const float *src, float *dst, int n)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
CALL_HAL(exp32f, cv_hal_exp32f, src, dst, n);
CV_IPP_RUN_FAST(CV_INSTRUMENT_FUN_IPP(ippsExp_32f_A21, src, dst, n) >= 0);
@ -122,7 +122,7 @@ void exp32f(const float *src, float *dst, int n)
void exp64f(const double *src, double *dst, int n)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
CALL_HAL(exp64f, cv_hal_exp64f, src, dst, n);
CV_IPP_RUN_FAST(CV_INSTRUMENT_FUN_IPP(ippsExp_64f_A50, src, dst, n) >= 0);
@ -133,7 +133,7 @@ void exp64f(const double *src, double *dst, int n)
void log32f(const float *src, float *dst, int n)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
CALL_HAL(log32f, cv_hal_log32f, src, dst, n);
CV_IPP_RUN_FAST(CV_INSTRUMENT_FUN_IPP(ippsLn_32f_A21, src, dst, n) >= 0);
@ -144,7 +144,7 @@ void log32f(const float *src, float *dst, int n)
void log64f(const double *src, double *dst, int n)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
CALL_HAL(log64f, cv_hal_log64f, src, dst, n);
CV_IPP_RUN_FAST(CV_INSTRUMENT_FUN_IPP(ippsLn_64f_A50, src, dst, n) >= 0);

View File

@ -149,13 +149,13 @@ static void fastAtan32f_(const float *Y, const float *X, float *angle, int len,
void fastAtan32f(const float *Y, const float *X, float *angle, int len, bool angleInDegrees )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
fastAtan32f_(Y, X, angle, len, angleInDegrees );
}
void fastAtan64f(const double *Y, const double *X, double *angle, int len, bool angleInDegrees)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
const int BLKSZ = 128;
float ybuf[BLKSZ], xbuf[BLKSZ], abuf[BLKSZ];
@ -176,13 +176,13 @@ void fastAtan64f(const double *Y, const double *X, double *angle, int len, bool
// deprecated
void fastAtan2(const float *Y, const float *X, float *angle, int len, bool angleInDegrees )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
fastAtan32f(Y, X, angle, len, angleInDegrees);
}
void magnitude32f(const float* x, const float* y, float* mag, int len)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
int i = 0;
@ -215,7 +215,7 @@ void magnitude32f(const float* x, const float* y, float* mag, int len)
void magnitude64f(const double* x, const double* y, double* mag, int len)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
int i = 0;
@ -249,7 +249,7 @@ void magnitude64f(const double* x, const double* y, double* mag, int len)
void invSqrt32f(const float* src, float* dst, int len)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
int i = 0;
@ -278,7 +278,7 @@ void invSqrt32f(const float* src, float* dst, int len)
void invSqrt64f(const double* src, double* dst, int len)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
int i = 0;
#if CV_SIMD_64F
@ -305,7 +305,7 @@ void invSqrt64f(const double* src, double* dst, int len)
void sqrt32f(const float* src, float* dst, int len)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
int i = 0;
@ -334,7 +334,7 @@ void sqrt32f(const float* src, float* dst, int len)
void sqrt64f(const double* src, double* dst, int len)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
int i = 0;
@ -366,7 +366,7 @@ void sqrt64f(const double* src, double* dst, int len)
#if (defined _MSC_VER && _MSC_VER >= 1900)
void exp32f(const float *src, float *dst, int n)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
for (int i = 0; i < n; i++)
{
@ -376,7 +376,7 @@ void exp32f(const float *src, float *dst, int n)
void exp64f(const double *src, double *dst, int n)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
for (int i = 0; i < n; i++)
{
@ -386,7 +386,7 @@ void exp64f(const double *src, double *dst, int n)
void log32f(const float *src, float *dst, int n)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
for (int i = 0; i < n; i++)
{
@ -395,7 +395,7 @@ void log32f(const float *src, float *dst, int n)
}
void log64f(const double *src, double *dst, int n)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
for (int i = 0; i < n; i++)
{
@ -424,7 +424,7 @@ static const double exp_max_val = 3000.*(1 << EXPTAB_SCALE); // log10(DBL_MAX) <
void exp32f( const float *_x, float *y, int n )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
const float* const expTab_f = cv::details::getExpTab32f();
@ -537,7 +537,7 @@ void exp32f( const float *_x, float *y, int n )
void exp64f( const double *_x, double *y, int n )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
const double* const expTab = cv::details::getExpTab64f();
@ -671,7 +671,7 @@ static const double ln_2 = 0.69314718055994530941723212145818;
void log32f( const float *_x, float *y, int n )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
const float* const logTab_f = cv::details::getLogTab32f();
@ -742,7 +742,7 @@ void log32f( const float *_x, float *y, int n )
void log64f( const double *x, double *y, int n )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
const double* const logTab = cv::details::getLogTab64f();

View File

@ -896,7 +896,7 @@ static bool ocl_gemm( InputArray matA, InputArray matB, double alpha,
static void gemmImpl( Mat A, Mat B, double alpha,
Mat C, double beta, Mat D, int flags )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
const int block_lin_size = 128;
const int block_size = block_lin_size * block_lin_size;
@ -2081,7 +2081,7 @@ static TransformFunc getDiagTransformFunc(int depth)
void cv::transform( InputArray _src, OutputArray _dst, InputArray _mtx )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
Mat src = _src.getMat(), m = _mtx.getMat();
int depth = src.depth(), scn = src.channels(), dcn = m.rows;
@ -2261,7 +2261,7 @@ perspectiveTransform_64f(const double* src, double* dst, const double* m, int le
void cv::perspectiveTransform( InputArray _src, OutputArray _dst, InputArray _mtx )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
Mat src = _src.getMat(), m = _mtx.getMat();
int depth = src.depth(), scn = src.channels(), dcn = m.rows-1;
@ -2408,7 +2408,7 @@ static bool ocl_scaleAdd( InputArray _src1, double alpha, InputArray _src2, Outp
void cv::scaleAdd( InputArray _src1, double alpha, InputArray _src2, OutputArray _dst )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
int type = _src1.type(), depth = CV_MAT_DEPTH(type), cn = CV_MAT_CN(type);
CV_Assert( type == _src2.type() );
@ -2455,7 +2455,7 @@ void cv::scaleAdd( InputArray _src1, double alpha, InputArray _src2, OutputArray
void cv::calcCovarMatrix( const Mat* data, int nsamples, Mat& covar, Mat& _mean, int flags, int ctype )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
CV_Assert_N( data, nsamples > 0 );
Size size = data[0].size();
@ -2497,7 +2497,7 @@ void cv::calcCovarMatrix( const Mat* data, int nsamples, Mat& covar, Mat& _mean,
void cv::calcCovarMatrix( InputArray _src, OutputArray _covar, InputOutputArray _mean, int flags, int ctype )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
if(_src.kind() == _InputArray::STD_VECTOR_MAT || _src.kind() == _InputArray::STD_ARRAY_MAT)
{
@ -2586,7 +2586,7 @@ void cv::calcCovarMatrix( InputArray _src, OutputArray _covar, InputOutputArray
double cv::Mahalanobis( InputArray _v1, InputArray _v2, InputArray _icovar )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
Mat v1 = _v1.getMat(), v2 = _v2.getMat(), icovar = _icovar.getMat();
int type = v1.type(), depth = v1.depth();
@ -2878,7 +2878,7 @@ typedef void (*MulTransposedFunc)(const Mat& src, Mat& dst, const Mat& delta, do
void cv::mulTransposed( InputArray _src, OutputArray _dst, bool ata,
InputArray _delta, double scale, int dtype )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
Mat src = _src.getMat(), delta = _delta.getMat();
const int gemm_level = 100; // boundary above which GEMM is faster.
@ -3286,7 +3286,7 @@ static DotProdFunc getDotProdFunc(int depth)
double Mat::dot(InputArray _mat) const
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
Mat mat = _mat.getMat();
int cn = channels();

View File

@ -85,7 +85,7 @@ void MatAllocator::copy(UMatData* usrc, UMatData* udst, int dims, const size_t s
const size_t srcofs[], const size_t srcstep[],
const size_t dstofs[], const size_t dststep[], bool /*sync*/) const
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
if(!usrc || !udst)
return;

View File

@ -72,7 +72,7 @@ LUImpl(_Tp* A, size_t astep, int m, _Tp* b, size_t bstep, int n, _Tp eps)
int LU32f(float* A, size_t astep, int m, float* b, size_t bstep, int n)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
int output;
CALL_HAL_RET(LU32f, cv_hal_LU32f, output, A, astep, m, b, bstep, n)
@ -83,7 +83,7 @@ int LU32f(float* A, size_t astep, int m, float* b, size_t bstep, int n)
int LU64f(double* A, size_t astep, int m, double* b, size_t bstep, int n)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
int output;
CALL_HAL_RET(LU64f, cv_hal_LU64f, output, A, astep, m, b, bstep, n)
@ -172,7 +172,7 @@ CholImpl(_Tp* A, size_t astep, int m, _Tp* b, size_t bstep, int n)
bool Cholesky32f(float* A, size_t astep, int m, float* b, size_t bstep, int n)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
bool output;
CALL_HAL_RET(Cholesky32f, cv_hal_Cholesky32f, output, A, astep, m, b, bstep, n)
@ -181,7 +181,7 @@ bool Cholesky32f(float* A, size_t astep, int m, float* b, size_t bstep, int n)
bool Cholesky64f(double* A, size_t astep, int m, double* b, size_t bstep, int n)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
bool output;
CALL_HAL_RET(Cholesky64f, cv_hal_Cholesky64f, output, A, astep, m, b, bstep, n)
@ -293,7 +293,7 @@ QRImpl(_Tp* A, size_t astep, int m, int n, int k, _Tp* b, size_t bstep, _Tp* hFa
int QR32f(float* A, size_t astep, int m, int n, int k, float* b, size_t bstep, float* hFactors)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
int output;
CALL_HAL_RET(QR32f, cv_hal_QR32f, output, A, astep, m, n, k, b, bstep, hFactors);
@ -303,7 +303,7 @@ int QR32f(float* A, size_t astep, int m, int n, int k, float* b, size_t bstep, f
int QR64f(double* A, size_t astep, int m, int n, int k, double* b, size_t bstep, double* hFactors)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
int output;
CALL_HAL_RET(QR64f, cv_hal_QR64f, output, A, astep, m, n, k, b, bstep, hFactors)

View File

@ -296,7 +296,7 @@ void MatOp::augAssignXor(const MatExpr& expr, Mat& m) const
void MatOp::add(const MatExpr& e1, const MatExpr& e2, MatExpr& res) const
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
if( this == e2.op )
{
@ -329,7 +329,7 @@ void MatOp::add(const MatExpr& e1, const MatExpr& e2, MatExpr& res) const
void MatOp::add(const MatExpr& expr1, const Scalar& s, MatExpr& res) const
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
Mat m1;
expr1.op->assign(expr1, m1);
@ -339,7 +339,7 @@ void MatOp::add(const MatExpr& expr1, const Scalar& s, MatExpr& res) const
void MatOp::subtract(const MatExpr& e1, const MatExpr& e2, MatExpr& res) const
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
if( this == e2.op )
{
@ -372,7 +372,7 @@ void MatOp::subtract(const MatExpr& e1, const MatExpr& e2, MatExpr& res) const
void MatOp::subtract(const Scalar& s, const MatExpr& expr, MatExpr& res) const
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
Mat m;
expr.op->assign(expr, m);
@ -382,7 +382,7 @@ void MatOp::subtract(const Scalar& s, const MatExpr& expr, MatExpr& res) const
void MatOp::multiply(const MatExpr& e1, const MatExpr& e2, MatExpr& res, double scale) const
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
if( this == e2.op )
{
@ -435,7 +435,7 @@ void MatOp::multiply(const MatExpr& e1, const MatExpr& e2, MatExpr& res, double
void MatOp::multiply(const MatExpr& expr, double s, MatExpr& res) const
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
Mat m;
expr.op->assign(expr, m);
@ -445,7 +445,7 @@ void MatOp::multiply(const MatExpr& expr, double s, MatExpr& res) const
void MatOp::divide(const MatExpr& e1, const MatExpr& e2, MatExpr& res, double scale) const
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
if( this == e2.op )
{
@ -487,7 +487,7 @@ void MatOp::divide(const MatExpr& e1, const MatExpr& e2, MatExpr& res, double sc
void MatOp::divide(double s, const MatExpr& expr, MatExpr& res) const
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
Mat m;
expr.op->assign(expr, m);
@ -497,7 +497,7 @@ void MatOp::divide(double s, const MatExpr& expr, MatExpr& res) const
void MatOp::abs(const MatExpr& expr, MatExpr& res) const
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
Mat m;
expr.op->assign(expr, m);
@ -507,7 +507,7 @@ void MatOp::abs(const MatExpr& expr, MatExpr& res) const
void MatOp::transpose(const MatExpr& expr, MatExpr& res) const
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
Mat m;
expr.op->assign(expr, m);
@ -573,7 +573,7 @@ Size MatOp::size(const MatExpr& expr) const
int MatOp::type(const MatExpr& expr) const
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
return !expr.a.empty() ? expr.a.type() : expr.b.empty() ? expr.b.type() : expr.c.type();
}
@ -1023,7 +1023,7 @@ MatExpr operator > (double s, const Mat& a)
MatExpr min(const Mat& a, const Mat& b)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
MatExpr e;
MatOp_Bin::makeExpr(e, 'm', a, b);
@ -1032,7 +1032,7 @@ MatExpr min(const Mat& a, const Mat& b)
MatExpr min(const Mat& a, double s)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
MatExpr e;
MatOp_Bin::makeExpr(e, 'n', a, s);
@ -1041,7 +1041,7 @@ MatExpr min(const Mat& a, double s)
MatExpr min(double s, const Mat& a)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
MatExpr e;
MatOp_Bin::makeExpr(e, 'n', a, s);
@ -1050,7 +1050,7 @@ MatExpr min(double s, const Mat& a)
MatExpr max(const Mat& a, const Mat& b)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
MatExpr e;
MatOp_Bin::makeExpr(e, 'M', a, b);
@ -1059,7 +1059,7 @@ MatExpr max(const Mat& a, const Mat& b)
MatExpr max(const Mat& a, double s)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
MatExpr e;
MatOp_Bin::makeExpr(e, 'N', a, s);
@ -1068,7 +1068,7 @@ MatExpr max(const Mat& a, double s)
MatExpr max(double s, const Mat& a)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
MatExpr e;
MatOp_Bin::makeExpr(e, 'N', a, s);
@ -1147,7 +1147,7 @@ MatExpr operator ~(const Mat& a)
MatExpr abs(const Mat& a)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
MatExpr e;
MatOp_Bin::makeExpr(e, 'a', a, Scalar());
@ -1156,7 +1156,7 @@ MatExpr abs(const Mat& a)
MatExpr abs(const MatExpr& e)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
MatExpr en;
e.op->abs(e, en);
@ -1180,7 +1180,7 @@ Size MatExpr::size() const
int MatExpr::type() const
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
if( isInitializer(*this) )
return a.type();
@ -1264,7 +1264,7 @@ void MatOp_AddEx::assign(const MatExpr& e, Mat& m, int _type) const
void MatOp_AddEx::add(const MatExpr& e, const Scalar& s, MatExpr& res) const
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
res = e;
res.s += s;
@ -1273,7 +1273,7 @@ void MatOp_AddEx::add(const MatExpr& e, const Scalar& s, MatExpr& res) const
void MatOp_AddEx::subtract(const Scalar& s, const MatExpr& e, MatExpr& res) const
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
res = e;
res.alpha = -res.alpha;
@ -1283,7 +1283,7 @@ void MatOp_AddEx::subtract(const Scalar& s, const MatExpr& e, MatExpr& res) cons
void MatOp_AddEx::multiply(const MatExpr& e, double s, MatExpr& res) const
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
res = e;
res.alpha *= s;
@ -1293,7 +1293,7 @@ void MatOp_AddEx::multiply(const MatExpr& e, double s, MatExpr& res) const
void MatOp_AddEx::divide(double s, const MatExpr& e, MatExpr& res) const
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
if( isScaled(e) )
MatOp_Bin::makeExpr(res, '/', e.a, Mat(), s/e.alpha);
@ -1304,7 +1304,7 @@ void MatOp_AddEx::divide(double s, const MatExpr& e, MatExpr& res) const
void MatOp_AddEx::transpose(const MatExpr& e, MatExpr& res) const
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
if( isScaled(e) )
MatOp_T::makeExpr(res, e.a, e.alpha);
@ -1314,7 +1314,7 @@ void MatOp_AddEx::transpose(const MatExpr& e, MatExpr& res) const
void MatOp_AddEx::abs(const MatExpr& e, MatExpr& res) const
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
if( (!e.b.data || e.beta == 0) && fabs(e.alpha) == 1 )
MatOp_Bin::makeExpr(res, 'a', e.a, -e.s*e.alpha);
@ -1376,7 +1376,7 @@ void MatOp_Bin::assign(const MatExpr& e, Mat& m, int _type) const
void MatOp_Bin::multiply(const MatExpr& e, double s, MatExpr& res) const
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
if( e.flags == '*' || e.flags == '/' )
{
@ -1389,7 +1389,7 @@ void MatOp_Bin::multiply(const MatExpr& e, double s, MatExpr& res) const
void MatOp_Bin::divide(double s, const MatExpr& e, MatExpr& res) const
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
if( e.flags == '/' && (!e.b.data || e.beta == 0) )
MatOp_AddEx::makeExpr(res, e.a, Mat(), s/e.alpha, 0);
@ -1446,7 +1446,7 @@ void MatOp_T::assign(const MatExpr& e, Mat& m, int _type) const
void MatOp_T::multiply(const MatExpr& e, double s, MatExpr& res) const
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
res = e;
res.alpha *= s;
@ -1454,7 +1454,7 @@ void MatOp_T::multiply(const MatExpr& e, double s, MatExpr& res) const
void MatOp_T::transpose(const MatExpr& e, MatExpr& res) const
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
if( e.alpha == 1 )
MatOp_Identity::makeExpr(res, e.a);
@ -1480,7 +1480,7 @@ void MatOp_GEMM::assign(const MatExpr& e, Mat& m, int _type) const
void MatOp_GEMM::add(const MatExpr& e1, const MatExpr& e2, MatExpr& res) const
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
bool i1 = isIdentity(e1), i2 = isIdentity(e2);
double alpha1 = i1 ? 1 : e1.alpha, alpha2 = i2 ? 1 : e2.alpha;
@ -1499,7 +1499,7 @@ void MatOp_GEMM::add(const MatExpr& e1, const MatExpr& e2, MatExpr& res) const
void MatOp_GEMM::subtract(const MatExpr& e1, const MatExpr& e2, MatExpr& res) const
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
bool i1 = isIdentity(e1), i2 = isIdentity(e2);
double alpha1 = i1 ? 1 : e1.alpha, alpha2 = i2 ? 1 : e2.alpha;
@ -1518,7 +1518,7 @@ void MatOp_GEMM::subtract(const MatExpr& e1, const MatExpr& e2, MatExpr& res) co
void MatOp_GEMM::multiply(const MatExpr& e, double s, MatExpr& res) const
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
res = e;
res.alpha *= s;
@ -1527,7 +1527,7 @@ void MatOp_GEMM::multiply(const MatExpr& e, double s, MatExpr& res) const
void MatOp_GEMM::transpose(const MatExpr& e, MatExpr& res) const
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
res = e;
res.flags = (!(e.flags & CV_GEMM_A_T) ? CV_GEMM_B_T : 0) |
@ -1608,7 +1608,7 @@ void MatOp_Initializer::assign(const MatExpr& e, Mat& m, int _type) const
void MatOp_Initializer::multiply(const MatExpr& e, double s, MatExpr& res) const
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
res = e;
res.alpha *= s;
@ -1628,7 +1628,7 @@ inline void MatOp_Initializer::makeExpr(MatExpr& res, int method, int ndims, con
MatExpr Mat::t() const
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
MatExpr e;
MatOp_T::makeExpr(e, *this);
@ -1637,7 +1637,7 @@ MatExpr Mat::t() const
MatExpr Mat::inv(int method) const
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
MatExpr e;
MatOp_Invert::makeExpr(e, method, *this);
@ -1647,7 +1647,7 @@ MatExpr Mat::inv(int method) const
MatExpr Mat::mul(InputArray m, double scale) const
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
MatExpr e;
if(m.kind() == _InputArray::EXPR)
@ -1662,7 +1662,7 @@ MatExpr Mat::mul(InputArray m, double scale) const
MatExpr Mat::zeros(int rows, int cols, int type)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
MatExpr e;
MatOp_Initializer::makeExpr(e, '0', Size(cols, rows), type);
@ -1671,7 +1671,7 @@ MatExpr Mat::zeros(int rows, int cols, int type)
MatExpr Mat::zeros(Size size, int type)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
MatExpr e;
MatOp_Initializer::makeExpr(e, '0', size, type);
@ -1680,7 +1680,7 @@ MatExpr Mat::zeros(Size size, int type)
MatExpr Mat::zeros(int ndims, const int* sizes, int type)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
MatExpr e;
MatOp_Initializer::makeExpr(e, '0', ndims, sizes, type);
@ -1689,7 +1689,7 @@ MatExpr Mat::zeros(int ndims, const int* sizes, int type)
MatExpr Mat::ones(int rows, int cols, int type)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
MatExpr e;
MatOp_Initializer::makeExpr(e, '1', Size(cols, rows), type);
@ -1698,7 +1698,7 @@ MatExpr Mat::ones(int rows, int cols, int type)
MatExpr Mat::ones(Size size, int type)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
MatExpr e;
MatOp_Initializer::makeExpr(e, '1', size, type);
@ -1707,7 +1707,7 @@ MatExpr Mat::ones(Size size, int type)
MatExpr Mat::ones(int ndims, const int* sizes, int type)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
MatExpr e;
MatOp_Initializer::makeExpr(e, '1', ndims, sizes, type);
@ -1716,7 +1716,7 @@ MatExpr Mat::ones(int ndims, const int* sizes, int type)
MatExpr Mat::eye(int rows, int cols, int type)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
MatExpr e;
MatOp_Initializer::makeExpr(e, 'I', Size(cols, rows), type);
@ -1725,7 +1725,7 @@ MatExpr Mat::eye(int rows, int cols, int type)
MatExpr Mat::eye(Size size, int type)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
MatExpr e;
MatOp_Initializer::makeExpr(e, 'I', size, type);

View File

@ -47,7 +47,7 @@ void cv::swap( Mat& a, Mat& b )
void cv::hconcat(const Mat* src, size_t nsrc, OutputArray _dst)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
if( nsrc == 0 || !src )
{
@ -75,7 +75,7 @@ void cv::hconcat(const Mat* src, size_t nsrc, OutputArray _dst)
void cv::hconcat(InputArray src1, InputArray src2, OutputArray dst)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
Mat src[] = {src1.getMat(), src2.getMat()};
hconcat(src, 2, dst);
@ -83,7 +83,7 @@ void cv::hconcat(InputArray src1, InputArray src2, OutputArray dst)
void cv::hconcat(InputArray _src, OutputArray dst)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
std::vector<Mat> src;
_src.getMatVector(src);
@ -120,7 +120,7 @@ void cv::vconcat(const Mat* src, size_t nsrc, OutputArray _dst)
void cv::vconcat(InputArray src1, InputArray src2, OutputArray dst)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
Mat src[] = {src1.getMat(), src2.getMat()};
vconcat(src, 2, dst);
@ -128,7 +128,7 @@ void cv::vconcat(InputArray src1, InputArray src2, OutputArray dst)
void cv::vconcat(InputArray _src, OutputArray dst)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
std::vector<Mat> src;
_src.getMatVector(src);
@ -179,7 +179,7 @@ static bool ocl_setIdentity( InputOutputArray _m, const Scalar& s )
void cv::setIdentity( InputOutputArray _m, const Scalar& s )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
CV_Assert( _m.dims() <= 2 );
@ -226,7 +226,7 @@ void cv::setIdentity( InputOutputArray _m, const Scalar& s )
cv::Scalar cv::trace( InputArray _m )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
Mat m = _m.getMat();
CV_Assert( m.dims <= 2 );
@ -423,7 +423,7 @@ static bool ocl_transpose( InputArray _src, OutputArray _dst )
#ifdef HAVE_IPP
static bool ipp_transpose( Mat &src, Mat &dst )
{
CV_INSTRUMENT_REGION_IPP()
CV_INSTRUMENT_REGION_IPP();
int type = src.type();
typedef IppStatus (CV_STDCALL * IppiTranspose)(const void * pSrc, int srcStep, void * pDst, int dstStep, IppiSize roiSize);
@ -492,7 +492,7 @@ static bool ipp_transpose( Mat &src, Mat &dst )
void cv::transpose( InputArray _src, OutputArray _dst )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
int type = _src.type(), esz = CV_ELEM_SIZE(type);
CV_Assert( _src.dims() <= 2 && esz <= 32 );
@ -540,7 +540,7 @@ void cv::transpose( InputArray _src, OutputArray _dst )
void cv::completeSymm( InputOutputArray _m, bool LtoR )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
Mat m = _m.getMat();
size_t step = m.step, esz = m.elemSize();
@ -964,7 +964,7 @@ static bool ocl_reduce(InputArray _src, OutputArray _dst,
void cv::reduce(InputArray _src, OutputArray _dst, int dim, int op, int dtype)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
CV_Assert( _src.dims() <= 2 );
int op0 = op;
@ -1196,7 +1196,7 @@ static IppSortFunc getSortFunc(int depth, bool sortDescending)
static bool ipp_sort(const Mat& src, Mat& dst, int flags)
{
CV_INSTRUMENT_REGION_IPP()
CV_INSTRUMENT_REGION_IPP();
bool sortRows = (flags & 1) == CV_SORT_EVERY_ROW;
bool sortDescending = (flags & CV_SORT_DESCENDING) != 0;
@ -1342,7 +1342,7 @@ static IppSortIndexFunc getSortIndexFunc(int depth, bool sortDescending)
static bool ipp_sortIdx( const Mat& src, Mat& dst, int flags )
{
CV_INSTRUMENT_REGION_IPP()
CV_INSTRUMENT_REGION_IPP();
bool sortRows = (flags & 1) == SORT_EVERY_ROW;
bool sortDescending = (flags & SORT_DESCENDING) != 0;
@ -1404,7 +1404,7 @@ typedef void (*SortFunc)(const Mat& src, Mat& dst, int flags);
void cv::sort( InputArray _src, OutputArray _dst, int flags )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
Mat src = _src.getMat();
CV_Assert( src.dims <= 2 && src.channels() == 1 );
@ -1425,7 +1425,7 @@ void cv::sort( InputArray _src, OutputArray _dst, int flags )
void cv::sortIdx( InputArray _src, OutputArray _dst, int flags )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
Mat src = _src.getMat();
CV_Assert( src.dims <= 2 && src.channels() == 1 );

View File

@ -615,7 +615,7 @@ void SparseMat::removeNode(size_t hidx, size_t nidx, size_t previdx)
//
double norm( const SparseMat& src, int normType )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
SparseMatConstIterator it = src.begin();
@ -680,7 +680,7 @@ double norm( const SparseMat& src, int normType )
void minMaxLoc( const SparseMat& src, double* _minval, double* _maxval, int* _minidx, int* _maxidx )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
SparseMatConstIterator it = src.begin();
size_t i, N = src.nzcount(), d = src.hdr ? src.hdr->dims : 0;
@ -747,7 +747,7 @@ void minMaxLoc( const SparseMat& src, double* _minval, double* _maxval, int* _mi
void normalize( const SparseMat& src, SparseMat& dst, double a, int norm_type )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
double scale = 1;
if( norm_type == CV_L2 || norm_type == CV_L1 || norm_type == CV_C )

View File

@ -13,7 +13,7 @@ namespace cv
{
static bool ipp_mean( Mat &src, Mat &mask, Scalar &ret )
{
CV_INSTRUMENT_REGION_IPP()
CV_INSTRUMENT_REGION_IPP();
#if IPP_VERSION_X100 >= 700
size_t total_size = src.total();
@ -106,7 +106,7 @@ static bool ipp_mean( Mat &src, Mat &mask, Scalar &ret )
cv::Scalar cv::mean( InputArray _src, InputArray _mask )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
Mat src = _src.getMat(), mask = _mask.getMat();
CV_Assert( mask.empty() || mask.type() == CV_8U );
@ -180,66 +180,71 @@ struct SumSqr_SIMD
}
};
template <typename T>
inline void addSqrChannels(T * sum, T * sqsum, T * buf, int cn)
{
for (int i = 0; i < 4; ++i)
{
sum[i % cn] += buf[i];
sqsum[i % cn] += buf[4 + i];
}
}
#if CV_SSE2
#if CV_SIMD
template <>
struct SumSqr_SIMD<uchar, int, int>
{
int operator () (const uchar * src0, const uchar * mask, int * sum, int * sqsum, int len, int cn) const
{
if (mask || (cn != 1 && cn != 2) || !USE_SSE2)
if (mask || (cn != 1 && cn != 2 && cn != 4))
return 0;
len *= cn;
int x = 0;
__m128i v_zero = _mm_setzero_si128(), v_sum = v_zero, v_sqsum = v_zero;
const int len_16 = len & ~15;
v_int32 v_sum = vx_setzero_s32();
v_int32 v_sqsum = vx_setzero_s32();
for ( ; x <= len_16 - 16; )
const int len0 = len & -v_uint8::nlanes;
while(x < len0)
{
const int len_tmp = min(x + 2048, len_16);
__m128i v_sum_tmp = v_zero;
for ( ; x <= len_tmp - 16; x += 16)
const int len_tmp = min(x + 256*v_uint16::nlanes, len0);
v_uint16 v_sum16 = vx_setzero_u16();
for ( ; x < len_tmp; x += v_uint8::nlanes)
{
__m128i v_src = _mm_loadu_si128((const __m128i *)(src0 + x));
__m128i v_half_0 = _mm_unpacklo_epi8(v_src, v_zero);
__m128i v_half_1 = _mm_unpackhi_epi8(v_src, v_zero);
v_sum_tmp = _mm_add_epi16(v_sum_tmp, _mm_add_epi16(v_half_0, v_half_1));
__m128i v_half_2 = _mm_unpacklo_epi16(v_half_0, v_half_1);
__m128i v_half_3 = _mm_unpackhi_epi16(v_half_0, v_half_1);
v_sqsum = _mm_add_epi32(v_sqsum, _mm_madd_epi16(v_half_2, v_half_2));
v_sqsum = _mm_add_epi32(v_sqsum, _mm_madd_epi16(v_half_3, v_half_3));
v_uint16 v_src0 = vx_load_expand(src0 + x);
v_uint16 v_src1 = vx_load_expand(src0 + x + v_uint16::nlanes);
v_sum16 += v_src0 + v_src1;
v_int16 v_tmp0, v_tmp1;
v_zip(v_reinterpret_as_s16(v_src0), v_reinterpret_as_s16(v_src1), v_tmp0, v_tmp1);
v_sqsum += v_dotprod(v_tmp0, v_tmp0) + v_dotprod(v_tmp1, v_tmp1);
}
v_sum = _mm_add_epi32(v_sum, _mm_unpacklo_epi16(v_sum_tmp, v_zero));
v_sum = _mm_add_epi32(v_sum, _mm_unpackhi_epi16(v_sum_tmp, v_zero));
v_uint32 v_half0, v_half1;
v_expand(v_sum16, v_half0, v_half1);
v_sum += v_reinterpret_as_s32(v_half0 + v_half1);
}
for ( ; x <= len - 8; x += 8)
if (x <= len - v_uint16::nlanes)
{
__m128i v_src = _mm_unpacklo_epi8(_mm_loadl_epi64((__m128i const *)(src0 + x)), v_zero);
__m128i v_half_0 = _mm_unpackhi_epi64(v_src, v_src);
__m128i v_sum_tmp = _mm_add_epi16(v_src, v_half_0);
__m128i v_half_1 = _mm_unpacklo_epi16(v_src, v_half_0);
v_uint16 v_src = vx_load_expand(src0 + x);
v_uint16 v_half = v_combine_high(v_src, v_src);
v_sum = _mm_add_epi32(v_sum, _mm_unpacklo_epi16(v_sum_tmp, v_zero));
v_sqsum = _mm_add_epi32(v_sqsum, _mm_madd_epi16(v_half_1, v_half_1));
v_uint32 v_tmp0, v_tmp1;
v_expand(v_src + v_half, v_tmp0, v_tmp1);
v_sum += v_reinterpret_as_s32(v_tmp0);
v_int16 v_tmp2, v_tmp3;
v_zip(v_reinterpret_as_s16(v_src), v_reinterpret_as_s16(v_half), v_tmp2, v_tmp3);
v_sqsum += v_dotprod(v_tmp2, v_tmp2);
x += v_uint16::nlanes;
}
int CV_DECL_ALIGNED(16) ar[8];
_mm_store_si128((__m128i*)ar, v_sum);
_mm_store_si128((__m128i*)(ar + 4), v_sqsum);
addSqrChannels(sum, sqsum, ar, cn);
if (cn == 1)
{
*sum += v_reduce_sum(v_sum);
*sqsum += v_reduce_sum(v_sqsum);
}
else
{
int CV_DECL_ALIGNED(CV_SIMD_WIDTH) ar[2 * v_int32::nlanes];
v_store(ar, v_sum);
v_store(ar + v_int32::nlanes, v_sqsum);
for (int i = 0; i < v_int32::nlanes; ++i)
{
sum[i % cn] += ar[i];
sqsum[i % cn] += ar[v_int32::nlanes + i];
}
}
v_cleanup();
return x / cn;
}
};
@ -249,49 +254,64 @@ struct SumSqr_SIMD<schar, int, int>
{
int operator () (const schar * src0, const uchar * mask, int * sum, int * sqsum, int len, int cn) const
{
if (mask || (cn != 1 && cn != 2) || !USE_SSE2)
if (mask || (cn != 1 && cn != 2 && cn != 4))
return 0;
len *= cn;
int x = 0;
__m128i v_zero = _mm_setzero_si128(), v_sum = v_zero, v_sqsum = v_zero;
const int len_16 = len & ~15;
v_int32 v_sum = vx_setzero_s32();
v_int32 v_sqsum = vx_setzero_s32();
for ( ; x <= len_16 - 16; )
const int len0 = len & -v_int8::nlanes;
while (x < len0)
{
const int len_tmp = min(x + 2048, len_16);
__m128i v_sum_tmp = v_zero;
for ( ; x <= len_tmp - 16; x += 16)
const int len_tmp = min(x + 256 * v_int16::nlanes, len0);
v_int16 v_sum16 = vx_setzero_s16();
for (; x < len_tmp; x += v_int8::nlanes)
{
__m128i v_src = _mm_loadu_si128((const __m128i *)(src0 + x));
__m128i v_half_0 = _mm_srai_epi16(_mm_unpacklo_epi8(v_zero, v_src), 8);
__m128i v_half_1 = _mm_srai_epi16(_mm_unpackhi_epi8(v_zero, v_src), 8);
v_sum_tmp = _mm_add_epi16(v_sum_tmp, _mm_add_epi16(v_half_0, v_half_1));
__m128i v_half_2 = _mm_unpacklo_epi16(v_half_0, v_half_1);
__m128i v_half_3 = _mm_unpackhi_epi16(v_half_0, v_half_1);
v_sqsum = _mm_add_epi32(v_sqsum, _mm_madd_epi16(v_half_2, v_half_2));
v_sqsum = _mm_add_epi32(v_sqsum, _mm_madd_epi16(v_half_3, v_half_3));
v_int16 v_src0 = vx_load_expand(src0 + x);
v_int16 v_src1 = vx_load_expand(src0 + x + v_int16::nlanes);
v_sum16 += v_src0 + v_src1;
v_int16 v_tmp0, v_tmp1;
v_zip(v_src0, v_src1, v_tmp0, v_tmp1);
v_sqsum += v_dotprod(v_tmp0, v_tmp0) + v_dotprod(v_tmp1, v_tmp1);
}
v_sum = _mm_add_epi32(v_sum, _mm_srai_epi32(_mm_unpacklo_epi16(v_zero, v_sum_tmp), 16));
v_sum = _mm_add_epi32(v_sum, _mm_srai_epi32(_mm_unpackhi_epi16(v_zero, v_sum_tmp), 16));
v_int32 v_half0, v_half1;
v_expand(v_sum16, v_half0, v_half1);
v_sum += v_half0 + v_half1;
}
for ( ; x <= len - 8; x += 8)
if (x <= len - v_int16::nlanes)
{
__m128i v_src = _mm_srai_epi16(_mm_unpacklo_epi8(v_zero, _mm_loadl_epi64((__m128i const *)(src0 + x))), 8);
__m128i v_half_0 = _mm_unpackhi_epi64(v_src, v_src);
__m128i v_sum_tmp = _mm_add_epi16(v_src, v_half_0);
__m128i v_half_1 = _mm_unpacklo_epi16(v_src, v_half_0);
v_int16 v_src = vx_load_expand(src0 + x);
v_int16 v_half = v_combine_high(v_src, v_src);
v_sum = _mm_add_epi32(v_sum, _mm_srai_epi32(_mm_unpacklo_epi16(v_zero, v_sum_tmp), 16));
v_sqsum = _mm_add_epi32(v_sqsum, _mm_madd_epi16(v_half_1, v_half_1));
v_int32 v_tmp0, v_tmp1;
v_expand(v_src + v_half, v_tmp0, v_tmp1);
v_sum += v_tmp0;
v_int16 v_tmp2, v_tmp3;
v_zip(v_src, v_half, v_tmp2, v_tmp3);
v_sqsum += v_dotprod(v_tmp2, v_tmp2);
x += v_int16::nlanes;
}
int CV_DECL_ALIGNED(16) ar[8];
_mm_store_si128((__m128i*)ar, v_sum);
_mm_store_si128((__m128i*)(ar + 4), v_sqsum);
addSqrChannels(sum, sqsum, ar, cn);
if (cn == 1)
{
*sum += v_reduce_sum(v_sum);
*sqsum += v_reduce_sum(v_sqsum);
}
else
{
int CV_DECL_ALIGNED(CV_SIMD_WIDTH) ar[2 * v_int32::nlanes];
v_store(ar, v_sum);
v_store(ar + v_int32::nlanes, v_sqsum);
for (int i = 0; i < v_int32::nlanes; ++i)
{
sum[i % cn] += ar[i];
sqsum[i % cn] += ar[v_int32::nlanes + i];
}
}
v_cleanup();
return x / cn;
}
};
@ -306,14 +326,14 @@ static int sumsqr_(const T* src0, const uchar* mask, ST* sum, SQT* sqsum, int le
if( !mask )
{
SumSqr_SIMD<T, ST, SQT> vop;
int i = vop(src0, mask, sum, sqsum, len, cn), k = cn % 4;
src += i * cn;
int x = vop(src0, mask, sum, sqsum, len, cn), k = cn % 4;
src = src0 + x * cn;
if( k == 1 )
{
ST s0 = sum[0];
SQT sq0 = sqsum[0];
for( ; i < len; i++, src += cn )
for(int i = x; i < len; i++, src += cn )
{
T v = src[0];
s0 += v; sq0 += (SQT)v*v;
@ -325,7 +345,7 @@ static int sumsqr_(const T* src0, const uchar* mask, ST* sum, SQT* sqsum, int le
{
ST s0 = sum[0], s1 = sum[1];
SQT sq0 = sqsum[0], sq1 = sqsum[1];
for( ; i < len; i++, src += cn )
for(int i = x; i < len; i++, src += cn )
{
T v0 = src[0], v1 = src[1];
s0 += v0; sq0 += (SQT)v0*v0;
@ -338,7 +358,7 @@ static int sumsqr_(const T* src0, const uchar* mask, ST* sum, SQT* sqsum, int le
{
ST s0 = sum[0], s1 = sum[1], s2 = sum[2];
SQT sq0 = sqsum[0], sq1 = sqsum[1], sq2 = sqsum[2];
for( ; i < len; i++, src += cn )
for(int i = x; i < len; i++, src += cn )
{
T v0 = src[0], v1 = src[1], v2 = src[2];
s0 += v0; sq0 += (SQT)v0*v0;
@ -351,10 +371,10 @@ static int sumsqr_(const T* src0, const uchar* mask, ST* sum, SQT* sqsum, int le
for( ; k < cn; k += 4 )
{
src = src0 + k;
src = src0 + x * cn + k;
ST s0 = sum[k], s1 = sum[k+1], s2 = sum[k+2], s3 = sum[k+3];
SQT sq0 = sqsum[k], sq1 = sqsum[k+1], sq2 = sqsum[k+2], sq3 = sqsum[k+3];
for( ; i < len; i++, src += cn )
for(int i = x; i < len; i++, src += cn )
{
T v0, v1;
v0 = src[0], v1 = src[1];
@ -460,7 +480,7 @@ static SumSqrFunc getSumSqrTab(int depth)
#ifdef HAVE_OPENCL
static bool ocl_meanStdDev( InputArray _src, OutputArray _mean, OutputArray _sdv, InputArray _mask )
{
CV_INSTRUMENT_REGION_OPENCL()
CV_INSTRUMENT_REGION_OPENCL();
bool haveMask = _mask.kind() != _InputArray::NONE;
int nz = haveMask ? -1 : (int)_src.total();
@ -644,7 +664,7 @@ static bool ocl_meanStdDev( InputArray _src, OutputArray _mean, OutputArray _sdv
#ifdef HAVE_IPP
static bool ipp_meanStdDev(Mat& src, OutputArray _mean, OutputArray _sdv, Mat& mask)
{
CV_INSTRUMENT_REGION_IPP()
CV_INSTRUMENT_REGION_IPP();
#if IPP_VERSION_X100 >= 700
int cn = src.channels();
@ -764,7 +784,7 @@ static bool ipp_meanStdDev(Mat& src, OutputArray _mean, OutputArray _sdv, Mat& m
void cv::meanStdDev( InputArray _src, OutputArray _mean, OutputArray _sdv, InputArray _mask )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
CV_Assert(!_src.empty());
CV_Assert( _mask.empty() || _mask.type() == CV_8UC1 );

View File

@ -231,7 +231,7 @@ namespace cv {
static bool ipp_merge(const Mat* mv, Mat& dst, int channels)
{
#ifdef HAVE_IPP_IW
CV_INSTRUMENT_REGION_IPP()
CV_INSTRUMENT_REGION_IPP();
if(channels != 3 && channels != 4)
return false;
@ -281,7 +281,7 @@ static bool ipp_merge(const Mat* mv, Mat& dst, int channels)
void cv::merge(const Mat* mv, size_t n, OutputArray _dst)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
CV_Assert( mv && n > 0 );
@ -429,7 +429,7 @@ static bool ocl_merge( InputArrayOfArrays _mv, OutputArray _dst )
void cv::merge(InputArrayOfArrays _mv, OutputArray _dst)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
CV_OCL_RUN(_mv.isUMatVector() && _dst.isUMat(),
ocl_merge(_mv, _dst))

View File

@ -579,7 +579,7 @@ typedef IppStatus (*IppMinMaxSelector)(const void* pSrc, int srcStep, IppiSize s
static bool ipp_minMaxIdx(Mat &src, double* _minVal, double* _maxVal, int* _minIdx, int* _maxIdx, Mat &mask)
{
#if IPP_VERSION_X100 >= 700
CV_INSTRUMENT_REGION_IPP()
CV_INSTRUMENT_REGION_IPP();
#if IPP_VERSION_X100 < 201800
// cv::minMaxIdx problem with NaN input
@ -746,7 +746,7 @@ void cv::minMaxIdx(InputArray _src, double* minVal,
double* maxVal, int* minIdx, int* maxIdx,
InputArray _mask)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
int type = _src.type(), depth = CV_MAT_DEPTH(type), cn = CV_MAT_CN(type);
CV_Assert( (cn == 1 && (_mask.empty() || _mask.type() == CV_8U)) ||
@ -818,7 +818,7 @@ void cv::minMaxIdx(InputArray _src, double* minVal,
void cv::minMaxLoc( InputArray _img, double* minVal, double* maxVal,
Point* minLoc, Point* maxLoc, InputArray mask )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
CV_Assert(_img.dims() <= 2);

View File

@ -496,7 +496,7 @@ static bool ocl_norm( InputArray _src, int normType, InputArray _mask, double &
#ifdef HAVE_IPP
static bool ipp_norm(Mat &src, int normType, Mat &mask, double &result)
{
CV_INSTRUMENT_REGION_IPP()
CV_INSTRUMENT_REGION_IPP();
#if IPP_VERSION_X100 >= 700
size_t total_size = src.total();
@ -625,7 +625,7 @@ static bool ipp_norm(Mat &src, int normType, Mat &mask, double &result)
double cv::norm( InputArray _src, int normType, InputArray _mask )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
normType &= NORM_TYPE_MASK;
CV_Assert( normType == NORM_INF || normType == NORM_L1 ||
@ -873,7 +873,7 @@ namespace cv
{
static bool ipp_norm(InputArray _src1, InputArray _src2, int normType, InputArray _mask, double &result)
{
CV_INSTRUMENT_REGION_IPP()
CV_INSTRUMENT_REGION_IPP();
#if IPP_VERSION_X100 >= 700
Mat src1 = _src1.getMat(), src2 = _src2.getMat(), mask = _mask.getMat();
@ -1103,7 +1103,7 @@ static bool ipp_norm(InputArray _src1, InputArray _src2, int normType, InputArra
double cv::norm( InputArray _src1, InputArray _src2, int normType, InputArray _mask )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
CV_Assert( _src1.sameSize(_src2) && _src1.type() == _src2.type() );
@ -1287,7 +1287,7 @@ cv::Hamming::ResultType cv::Hamming::operator()( const unsigned char* a, const u
double cv::PSNR(InputArray _src1, InputArray _src2, double R)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
//Input arrays must have depth CV_8U
CV_Assert( _src1.type() == _src2.type() );

View File

@ -3086,7 +3086,7 @@ bool Kernel::run(int dims, size_t _globalsize[], size_t _localsize[],
bool Kernel::Impl::run(int dims, size_t globalsize[], size_t localsize[],
bool sync, int64* timeNS, const Queue& q)
{
CV_INSTRUMENT_REGION_OPENCL_RUN(name.c_str());
CV_INSTRUMENT_REGION_OPENCL_RUN(name.c_str(););
if (!handle || isInProgress)
return false;

View File

@ -54,6 +54,10 @@
using namespace cv;
using namespace cv::cuda;
#if defined(_MSC_VER)
#pragma warning(disable : 4702) // unreachable code
#endif
namespace
{
#ifndef HAVE_OPENGL

View File

@ -319,7 +319,7 @@ namespace
cv::instr::InstrTLSStruct *pInstrTLS = &cv::instr::getInstrumentTLSStruct();
pInstrTLS->pCurrentNode = ctx.pThreadRoot; // Initialize TLS node for thread
}
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
#endif
// propagate main thread state
@ -493,7 +493,7 @@ void cv::parallel_for_(const cv::Range& range, const cv::ParallelLoopBody& body,
CV_TRACE_ARG_VALUE(nstripes, "nstripes", (int64)nstripes);
#endif
CV_INSTRUMENT_REGION_MT_FORK()
CV_INSTRUMENT_REGION_MT_FORK();
if (range.empty())
return;

View File

@ -352,7 +352,7 @@ Mat PCA::backProject(InputArray data) const
void cv::PCACompute(InputArray data, InputOutputArray mean,
OutputArray eigenvectors, int maxComponents)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
PCA pca;
pca(data, mean, 0, maxComponents);
@ -364,7 +364,7 @@ void cv::PCACompute(InputArray data, InputOutputArray mean,
OutputArray eigenvectors, OutputArray eigenvalues,
int maxComponents)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
PCA pca;
pca(data, mean, 0, maxComponents);
@ -376,7 +376,7 @@ void cv::PCACompute(InputArray data, InputOutputArray mean,
void cv::PCACompute(InputArray data, InputOutputArray mean,
OutputArray eigenvectors, double retainedVariance)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
PCA pca;
pca(data, mean, 0, retainedVariance);
@ -388,7 +388,7 @@ void cv::PCACompute(InputArray data, InputOutputArray mean,
OutputArray eigenvectors, OutputArray eigenvalues,
double retainedVariance)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
PCA pca;
pca(data, mean, 0, retainedVariance);
@ -400,7 +400,7 @@ void cv::PCACompute(InputArray data, InputOutputArray mean,
void cv::PCAProject(InputArray data, InputArray mean,
InputArray eigenvectors, OutputArray result)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
PCA pca;
pca.mean = mean.getMat();
@ -411,7 +411,7 @@ void cv::PCAProject(InputArray data, InputArray mean,
void cv::PCABackProject(InputArray data, InputArray mean,
InputArray eigenvectors, OutputArray result)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
PCA pca;
pca.mean = mean.getMat();

View File

@ -56,7 +56,7 @@ FileStorage::~FileStorage()
bool FileStorage::open(const String& filename, int flags, const String& encoding)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
release();
fs.reset(cvOpenFileStorage( filename.c_str(), 0, flags,

View File

@ -664,14 +664,14 @@ void cv::setRNGSeed(int seed)
void cv::randu(InputOutputArray dst, InputArray low, InputArray high)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
theRNG().fill(dst, RNG::UNIFORM, low, high);
}
void cv::randn(InputOutputArray dst, InputArray mean, InputArray stddev)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
theRNG().fill(dst, RNG::NORMAL, mean, stddev);
}
@ -719,7 +719,7 @@ typedef void (*RandShuffleFunc)( Mat& dst, RNG& rng, double iterFactor );
void cv::randShuffle( InputOutputArray _dst, double iterFactor, RNG* _rng )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
RandShuffleFunc tab[] =
{

View File

@ -239,7 +239,7 @@ namespace cv {
static bool ipp_split(const Mat& src, Mat* mv, int channels)
{
#ifdef HAVE_IPP_IW
CV_INSTRUMENT_REGION_IPP()
CV_INSTRUMENT_REGION_IPP();
if(channels != 3 && channels != 4)
return false;
@ -289,7 +289,7 @@ static bool ipp_split(const Mat& src, Mat* mv, int channels)
void cv::split(const Mat& src, Mat* mv)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
int k, depth = src.depth(), cn = src.channels();
if( cn == 1 )
@ -389,7 +389,7 @@ static bool ocl_split( InputArray _m, OutputArrayOfArrays _mv )
void cv::split(InputArray _m, OutputArrayOfArrays _mv)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
CV_OCL_RUN(_m.dims() <= 2 && _mv.isUMatVector(),
ocl_split(_m, _mv))

View File

@ -11,7 +11,7 @@ namespace cv { namespace hal {
int normHamming(const uchar* a, int n)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
CV_CPU_DISPATCH(normHamming, (a, n),
CV_CPU_DISPATCH_MODES_ALL);
@ -19,7 +19,7 @@ int normHamming(const uchar* a, int n)
int normHamming(const uchar* a, const uchar* b, int n)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
CV_CPU_DISPATCH(normHamming, (a, b, n),
CV_CPU_DISPATCH_MODES_ALL);

View File

@ -19,115 +19,7 @@ struct Sum_SIMD
}
};
template <typename ST, typename DT>
inline void addChannels(DT * dst, ST * buf, int cn)
{
for (int i = 0; i < 4; ++i)
dst[i % cn] += buf[i];
}
#if CV_SSE2
template <>
struct Sum_SIMD<schar, int>
{
int operator () (const schar * src0, const uchar * mask, int * dst, int len, int cn) const
{
if (mask || (cn != 1 && cn != 2 && cn != 4) || !USE_SSE2)
return 0;
int x = 0;
__m128i v_zero = _mm_setzero_si128(), v_sum = v_zero;
for ( ; x <= len - 16; x += 16)
{
__m128i v_src = _mm_loadu_si128((const __m128i *)(src0 + x));
__m128i v_half = _mm_srai_epi16(_mm_unpacklo_epi8(v_zero, v_src), 8);
v_sum = _mm_add_epi32(v_sum, _mm_srai_epi32(_mm_unpacklo_epi16(v_zero, v_half), 16));
v_sum = _mm_add_epi32(v_sum, _mm_srai_epi32(_mm_unpackhi_epi16(v_zero, v_half), 16));
v_half = _mm_srai_epi16(_mm_unpackhi_epi8(v_zero, v_src), 8);
v_sum = _mm_add_epi32(v_sum, _mm_srai_epi32(_mm_unpacklo_epi16(v_zero, v_half), 16));
v_sum = _mm_add_epi32(v_sum, _mm_srai_epi32(_mm_unpackhi_epi16(v_zero, v_half), 16));
}
for ( ; x <= len - 8; x += 8)
{
__m128i v_src = _mm_srai_epi16(_mm_unpacklo_epi8(v_zero, _mm_loadl_epi64((__m128i const *)(src0 + x))), 8);
v_sum = _mm_add_epi32(v_sum, _mm_srai_epi32(_mm_unpacklo_epi16(v_zero, v_src), 16));
v_sum = _mm_add_epi32(v_sum, _mm_srai_epi32(_mm_unpackhi_epi16(v_zero, v_src), 16));
}
int CV_DECL_ALIGNED(16) ar[4];
_mm_store_si128((__m128i*)ar, v_sum);
addChannels(dst, ar, cn);
return x / cn;
}
};
template <>
struct Sum_SIMD<int, double>
{
int operator () (const int * src0, const uchar * mask, double * dst, int len, int cn) const
{
if (mask || (cn != 1 && cn != 2 && cn != 4) || !USE_SSE2)
return 0;
int x = 0;
__m128d v_zero = _mm_setzero_pd(), v_sum0 = v_zero, v_sum1 = v_zero;
for ( ; x <= len - 4; x += 4)
{
__m128i v_src = _mm_loadu_si128((__m128i const *)(src0 + x));
v_sum0 = _mm_add_pd(v_sum0, _mm_cvtepi32_pd(v_src));
v_sum1 = _mm_add_pd(v_sum1, _mm_cvtepi32_pd(_mm_srli_si128(v_src, 8)));
}
double CV_DECL_ALIGNED(16) ar[4];
_mm_store_pd(ar, v_sum0);
_mm_store_pd(ar + 2, v_sum1);
addChannels(dst, ar, cn);
return x / cn;
}
};
template <>
struct Sum_SIMD<float, double>
{
int operator () (const float * src0, const uchar * mask, double * dst, int len, int cn) const
{
if (mask || (cn != 1 && cn != 2 && cn != 4) || !USE_SSE2)
return 0;
int x = 0;
__m128d v_zero = _mm_setzero_pd(), v_sum0 = v_zero, v_sum1 = v_zero;
for ( ; x <= len - 4; x += 4)
{
__m128 v_src = _mm_loadu_ps(src0 + x);
v_sum0 = _mm_add_pd(v_sum0, _mm_cvtps_pd(v_src));
v_src = _mm_castsi128_ps(_mm_srli_si128(_mm_castps_si128(v_src), 8));
v_sum1 = _mm_add_pd(v_sum1, _mm_cvtps_pd(v_src));
}
double CV_DECL_ALIGNED(16) ar[4];
_mm_store_pd(ar, v_sum0);
_mm_store_pd(ar + 2, v_sum1);
addChannels(dst, ar, cn);
return x / cn;
}
};
#elif CV_NEON
#if CV_SIMD
template <>
struct Sum_SIMD<uchar, int>
@ -136,35 +28,49 @@ struct Sum_SIMD<uchar, int>
{
if (mask || (cn != 1 && cn != 2 && cn != 4))
return 0;
len *= cn;
int x = 0;
uint32x4_t v_sum = vdupq_n_u32(0u);
v_uint32 v_sum = vx_setzero_u32();
for ( ; x <= len - 16; x += 16)
int len0 = len & -v_uint8::nlanes;
while (x < len0)
{
uint8x16_t v_src = vld1q_u8(src0 + x);
uint16x8_t v_half = vmovl_u8(vget_low_u8(v_src));
v_sum = vaddw_u16(v_sum, vget_low_u16(v_half));
v_sum = vaddw_u16(v_sum, vget_high_u16(v_half));
v_half = vmovl_u8(vget_high_u8(v_src));
v_sum = vaddw_u16(v_sum, vget_low_u16(v_half));
v_sum = vaddw_u16(v_sum, vget_high_u16(v_half));
const int len_tmp = min(x + 256*v_uint16::nlanes, len0);
v_uint16 v_sum16 = vx_setzero_u16();
for (; x < len_tmp; x += v_uint8::nlanes)
{
v_uint16 v_src0, v_src1;
v_expand(vx_load(src0 + x), v_src0, v_src1);
v_sum16 += v_src0 + v_src1;
}
v_uint32 v_half0, v_half1;
v_expand(v_sum16, v_half0, v_half1);
v_sum += v_half0 + v_half1;
}
if (x <= len - v_uint16::nlanes)
{
v_uint32 v_half0, v_half1;
v_expand(vx_load_expand(src0 + x), v_half0, v_half1);
v_sum += v_half0 + v_half1;
x += v_uint16::nlanes;
}
if (x <= len - v_uint32::nlanes)
{
v_sum += vx_load_expand_q(src0 + x);
x += v_uint32::nlanes;
}
for ( ; x <= len - 8; x += 8)
if (cn == 1)
*dst += v_reduce_sum(v_sum);
else
{
uint16x8_t v_src = vmovl_u8(vld1_u8(src0 + x));
v_sum = vaddw_u16(v_sum, vget_low_u16(v_src));
v_sum = vaddw_u16(v_sum, vget_high_u16(v_src));
uint32_t CV_DECL_ALIGNED(CV_SIMD_WIDTH) ar[v_uint32::nlanes];
v_store_aligned(ar, v_sum);
for (int i = 0; i < v_uint32::nlanes; ++i)
dst[i % cn] += ar[i];
}
unsigned int CV_DECL_ALIGNED(16) ar[4];
vst1q_u32(ar, v_sum);
addChannels(dst, ar, cn);
v_cleanup();
return x / cn;
}
@ -177,35 +83,49 @@ struct Sum_SIMD<schar, int>
{
if (mask || (cn != 1 && cn != 2 && cn != 4))
return 0;
len *= cn;
int x = 0;
int32x4_t v_sum = vdupq_n_s32(0);
v_int32 v_sum = vx_setzero_s32();
for ( ; x <= len - 16; x += 16)
int len0 = len & -v_int8::nlanes;
while (x < len0)
{
int8x16_t v_src = vld1q_s8(src0 + x);
int16x8_t v_half = vmovl_s8(vget_low_s8(v_src));
v_sum = vaddw_s16(v_sum, vget_low_s16(v_half));
v_sum = vaddw_s16(v_sum, vget_high_s16(v_half));
v_half = vmovl_s8(vget_high_s8(v_src));
v_sum = vaddw_s16(v_sum, vget_low_s16(v_half));
v_sum = vaddw_s16(v_sum, vget_high_s16(v_half));
const int len_tmp = min(x + 256*v_int16::nlanes, len0);
v_int16 v_sum16 = vx_setzero_s16();
for (; x < len_tmp; x += v_int8::nlanes)
{
v_int16 v_src0, v_src1;
v_expand(vx_load(src0 + x), v_src0, v_src1);
v_sum16 += v_src0 + v_src1;
}
v_int32 v_half0, v_half1;
v_expand(v_sum16, v_half0, v_half1);
v_sum += v_half0 + v_half1;
}
if (x <= len - v_int16::nlanes)
{
v_int32 v_half0, v_half1;
v_expand(vx_load_expand(src0 + x), v_half0, v_half1);
v_sum += v_half0 + v_half1;
x += v_int16::nlanes;
}
if (x <= len - v_int32::nlanes)
{
v_sum += vx_load_expand_q(src0 + x);
x += v_int32::nlanes;
}
for ( ; x <= len - 8; x += 8)
if (cn == 1)
*dst += v_reduce_sum(v_sum);
else
{
int16x8_t v_src = vmovl_s8(vld1_s8(src0 + x));
v_sum = vaddw_s16(v_sum, vget_low_s16(v_src));
v_sum = vaddw_s16(v_sum, vget_high_s16(v_src));
int32_t CV_DECL_ALIGNED(CV_SIMD_WIDTH) ar[v_int32::nlanes];
v_store_aligned(ar, v_sum);
for (int i = 0; i < v_int32::nlanes; ++i)
dst[i % cn] += ar[i];
}
int CV_DECL_ALIGNED(16) ar[4];
vst1q_s32(ar, v_sum);
addChannels(dst, ar, cn);
v_cleanup();
return x / cn;
}
@ -218,25 +138,33 @@ struct Sum_SIMD<ushort, int>
{
if (mask || (cn != 1 && cn != 2 && cn != 4))
return 0;
len *= cn;
int x = 0;
uint32x4_t v_sum = vdupq_n_u32(0u);
v_uint32 v_sum = vx_setzero_u32();
for ( ; x <= len - 8; x += 8)
for (; x <= len - v_uint16::nlanes; x += v_uint16::nlanes)
{
uint16x8_t v_src = vld1q_u16(src0 + x);
v_sum = vaddw_u16(v_sum, vget_low_u16(v_src));
v_sum = vaddw_u16(v_sum, vget_high_u16(v_src));
v_uint32 v_src0, v_src1;
v_expand(vx_load(src0 + x), v_src0, v_src1);
v_sum += v_src0 + v_src1;
}
if (x <= len - v_uint32::nlanes)
{
v_sum += vx_load_expand(src0 + x);
x += v_uint32::nlanes;
}
for ( ; x <= len - 4; x += 4)
v_sum = vaddw_u16(v_sum, vld1_u16(src0 + x));
unsigned int CV_DECL_ALIGNED(16) ar[4];
vst1q_u32(ar, v_sum);
addChannels(dst, ar, cn);
if (cn == 1)
*dst += v_reduce_sum(v_sum);
else
{
uint32_t CV_DECL_ALIGNED(CV_SIMD_WIDTH) ar[v_uint32::nlanes];
v_store_aligned(ar, v_sum);
for (int i = 0; i < v_uint32::nlanes; ++i)
dst[i % cn] += ar[i];
}
v_cleanup();
return x / cn;
}
@ -249,30 +177,117 @@ struct Sum_SIMD<short, int>
{
if (mask || (cn != 1 && cn != 2 && cn != 4))
return 0;
len *= cn;
int x = 0;
int32x4_t v_sum = vdupq_n_s32(0u);
v_int32 v_sum = vx_setzero_s32();
for ( ; x <= len - 8; x += 8)
for (; x <= len - v_int16::nlanes; x += v_int16::nlanes)
{
int16x8_t v_src = vld1q_s16(src0 + x);
v_sum = vaddw_s16(v_sum, vget_low_s16(v_src));
v_sum = vaddw_s16(v_sum, vget_high_s16(v_src));
v_int32 v_src0, v_src1;
v_expand(vx_load(src0 + x), v_src0, v_src1);
v_sum += v_src0 + v_src1;
}
if (x <= len - v_int32::nlanes)
{
v_sum += vx_load_expand(src0 + x);
x += v_int32::nlanes;
}
for ( ; x <= len - 4; x += 4)
v_sum = vaddw_s16(v_sum, vld1_s16(src0 + x));
int CV_DECL_ALIGNED(16) ar[4];
vst1q_s32(ar, v_sum);
addChannels(dst, ar, cn);
if (cn == 1)
*dst += v_reduce_sum(v_sum);
else
{
int32_t CV_DECL_ALIGNED(CV_SIMD_WIDTH) ar[v_int32::nlanes];
v_store_aligned(ar, v_sum);
for (int i = 0; i < v_int32::nlanes; ++i)
dst[i % cn] += ar[i];
}
v_cleanup();
return x / cn;
}
};
#if CV_SIMD_64F
template <>
struct Sum_SIMD<int, double>
{
int operator () (const int * src0, const uchar * mask, double * dst, int len, int cn) const
{
if (mask || (cn != 1 && cn != 2 && cn != 4))
return 0;
len *= cn;
int x = 0;
v_float64 v_sum0 = vx_setzero_f64();
v_float64 v_sum1 = vx_setzero_f64();
for (; x <= len - 2 * v_int32::nlanes; x += 2 * v_int32::nlanes)
{
v_int32 v_src0 = vx_load(src0 + x);
v_int32 v_src1 = vx_load(src0 + x + v_int32::nlanes);
v_sum0 += v_cvt_f64(v_src0) + v_cvt_f64(v_src1);
v_sum1 += v_cvt_f64_high(v_src0) + v_cvt_f64_high(v_src1);
}
#if CV_SIMD256 || CV_SIMD512
double CV_DECL_ALIGNED(CV_SIMD_WIDTH) ar[v_float64::nlanes];
v_store_aligned(ar, v_sum0 + v_sum1);
for (int i = 0; i < v_float64::nlanes; ++i)
dst[i % cn] += ar[i];
#else
double CV_DECL_ALIGNED(CV_SIMD_WIDTH) ar[2 * v_float64::nlanes];
v_store_aligned(ar, v_sum0);
v_store_aligned(ar + v_float64::nlanes, v_sum1);
for (int i = 0; i < 2 * v_float64::nlanes; ++i)
dst[i % cn] += ar[i];
#endif
v_cleanup();
return x / cn;
}
};
template <>
struct Sum_SIMD<float, double>
{
int operator () (const float * src0, const uchar * mask, double * dst, int len, int cn) const
{
if (mask || (cn != 1 && cn != 2 && cn != 4))
return 0;
len *= cn;
int x = 0;
v_float64 v_sum0 = vx_setzero_f64();
v_float64 v_sum1 = vx_setzero_f64();
for (; x <= len - 2 * v_float32::nlanes; x += 2 * v_float32::nlanes)
{
v_float32 v_src0 = vx_load(src0 + x);
v_float32 v_src1 = vx_load(src0 + x + v_float32::nlanes);
v_sum0 += v_cvt_f64(v_src0) + v_cvt_f64(v_src1);
v_sum1 += v_cvt_f64_high(v_src0) + v_cvt_f64_high(v_src1);
}
#if CV_SIMD256 || CV_SIMD512
double CV_DECL_ALIGNED(CV_SIMD_WIDTH) ar[v_float64::nlanes];
v_store_aligned(ar, v_sum0 + v_sum1);
for (int i = 0; i < v_float64::nlanes; ++i)
dst[i % cn] += ar[i];
#else
double CV_DECL_ALIGNED(CV_SIMD_WIDTH) ar[2 * v_float64::nlanes];
v_store_aligned(ar, v_sum0);
v_store_aligned(ar + v_float64::nlanes, v_sum1);
for (int i = 0; i < 2 * v_float64::nlanes; ++i)
dst[i % cn] += ar[i];
#endif
v_cleanup();
return x / cn;
}
};
#endif
#endif
template<typename T, typename ST>
@ -526,7 +541,7 @@ bool ocl_sum( InputArray _src, Scalar & res, int sum_op, InputArray _mask,
#ifdef HAVE_IPP
static bool ipp_sum(Mat &src, Scalar &_res)
{
CV_INSTRUMENT_REGION_IPP()
CV_INSTRUMENT_REGION_IPP();
#if IPP_VERSION_X100 >= 700
int cn = src.channels();
@ -582,7 +597,7 @@ static bool ipp_sum(Mat &src, Scalar &_res)
cv::Scalar cv::sum( InputArray _src )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
#if defined HAVE_OPENCL || defined HAVE_IPP
Scalar _res;

View File

@ -65,7 +65,7 @@ size_t KeyPoint::hash() const
void KeyPoint::convert(const std::vector<KeyPoint>& keypoints, std::vector<Point2f>& points2f,
const std::vector<int>& keypointIndexes)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
if( keypointIndexes.empty() )
{
@ -93,7 +93,7 @@ void KeyPoint::convert(const std::vector<KeyPoint>& keypoints, std::vector<Point
void KeyPoint::convert( const std::vector<Point2f>& points2f, std::vector<KeyPoint>& keypoints,
float size, float response, int octave, int class_id )
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
keypoints.resize(points2f.size());
for( size_t i = 0; i < points2f.size(); i++ )
@ -150,16 +150,18 @@ RotatedRect::RotatedRect(const Point2f& _point1, const Point2f& _point2, const P
Vec2f vecs[2];
vecs[0] = Vec2f(_point1 - _point2);
vecs[1] = Vec2f(_point2 - _point3);
double x = std::max(norm(_point1), std::max(norm(_point2), norm(_point3)));
double a = std::min(norm(vecs[0]), norm(vecs[1]));
// check that given sides are perpendicular
CV_Assert( abs(vecs[0].dot(vecs[1])) / (norm(vecs[0]) * norm(vecs[1])) <= FLT_EPSILON );
CV_Assert( std::fabs(vecs[0].ddot(vecs[1])) * a <= FLT_EPSILON * 9 * x * (norm(vecs[0]) * norm(vecs[1])) );
// wd_i stores which vector (0,1) or (1,2) will make the width
// One of them will definitely have slope within -1 to 1
int wd_i = 0;
if( abs(vecs[1][1]) < abs(vecs[1][0]) ) wd_i = 1;
if( std::fabs(vecs[1][1]) < std::fabs(vecs[1][0]) ) wd_i = 1;
int ht_i = (wd_i + 1) % 2;
float _angle = atan(vecs[wd_i][1] / vecs[wd_i][0]) * 180.0f / (float) CV_PI;
float _angle = std::atan(vecs[wd_i][1] / vecs[wd_i][0]) * 180.0f / (float) CV_PI;
float _width = (float) norm(vecs[wd_i]);
float _height = (float) norm(vecs[ht_i]);

View File

@ -872,7 +872,7 @@ void UMat::ndoffset(size_t* ofs) const
void UMat::copyTo(OutputArray _dst) const
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
int dtype = _dst.type();
if( _dst.fixedType() && dtype != type() )
@ -918,7 +918,7 @@ void UMat::copyTo(OutputArray _dst) const
void UMat::copyTo(OutputArray _dst, InputArray _mask) const
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
if( _mask.empty() )
{
@ -967,7 +967,7 @@ void UMat::copyTo(OutputArray _dst, InputArray _mask) const
void UMat::convertTo(OutputArray _dst, int _type, double alpha, double beta) const
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
bool noScale = std::fabs(alpha - 1) < DBL_EPSILON && std::fabs(beta) < DBL_EPSILON;
int stype = type(), cn = CV_MAT_CN(stype);
@ -1032,7 +1032,7 @@ void UMat::convertTo(OutputArray _dst, int _type, double alpha, double beta) con
UMat& UMat::setTo(InputArray _value, InputArray _mask)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
bool haveMask = !_mask.empty();
#ifdef HAVE_OPENCL
@ -1172,7 +1172,7 @@ static bool ocl_dot( InputArray _src1, InputArray _src2, double & res )
double UMat::dot(InputArray m) const
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
CV_Assert(m.sameSize(*this) && m.type() == type());

View File

@ -87,7 +87,7 @@ cv::String join(const cv::String& base, const cv::String& path)
bool exists(const cv::String& path)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
#if defined _WIN32 || defined WINCE
BOOL status = TRUE;
@ -150,7 +150,7 @@ CV_EXPORTS void remove_all(const cv::String& path)
cv::String getcwd()
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
cv::AutoBuffer<char, 4096> buf;
#if defined WIN32 || defined _WIN32 || defined WINCE
#ifdef WINRT
@ -185,7 +185,7 @@ cv::String getcwd()
bool createDirectory(const cv::String& path)
{
CV_INSTRUMENT_REGION()
CV_INSTRUMENT_REGION();
#if defined WIN32 || defined _WIN32 || defined WINCE
#ifdef WINRT
wchar_t wpath[MAX_PATH];

View File

@ -2225,4 +2225,21 @@ TEST(Core_ConvertTo, regression_12121)
}
}
TEST(Core_MeanStdDev, regression_multichannel)
{
{
uchar buf[] = { 1, 2, 3, 4, 5, 6, 7, 8,
3, 4, 5, 6, 7, 8, 9, 10 };
double ref_buf[] = { 2., 3., 4., 5., 6., 7., 8., 9.,
1., 1., 1., 1., 1., 1., 1., 1. };
Mat src(1, 2, CV_MAKETYPE(CV_8U, 8), buf);
Mat ref_m(8, 1, CV_64FC1, ref_buf);
Mat ref_sd(8, 1, CV_64FC1, ref_buf + 8);
Mat dst_m, dst_sd;
meanStdDev(src, dst_m, dst_sd);
EXPECT_EQ(0, cv::norm(dst_m, ref_m, NORM_L1));
EXPECT_EQ(0, cv::norm(dst_sd, ref_sd, NORM_L1));
}
}
}} // namespace

View File

@ -199,11 +199,8 @@ namespace grid_transform_detail
if (x_shifted + SHIFT - 1 < cols)
{
const read_type src_n_el = ((const read_type*)src)[x];
write_type dst_n_el = ((const write_type*)dst)[x];
OpUnroller<SHIFT>::unroll(src_n_el, dst_n_el, op, mask, x_shifted, y);
((write_type*)dst)[x] = dst_n_el;
OpUnroller<SHIFT>::unroll(src_n_el, ((write_type*)dst)[x], op, mask, x_shifted, y);
}
else
{
@ -237,11 +234,8 @@ namespace grid_transform_detail
{
const read_type1 src1_n_el = ((const read_type1*)src1)[x];
const read_type2 src2_n_el = ((const read_type2*)src2)[x];
write_type dst_n_el = ((const write_type*)dst)[x];
OpUnroller<SHIFT>::unroll(src1_n_el, src2_n_el, dst_n_el, op, mask, x_shifted, y);
((write_type*)dst)[x] = dst_n_el;
OpUnroller<SHIFT>::unroll(src1_n_el, src2_n_el, ((write_type*)dst)[x], op, mask, x_shifted, y);
}
else
{

View File

@ -67,13 +67,13 @@ ocv_warnings_disable(CMAKE_CXX_FLAGS
)
if(PROTOBUF_UPDATE_FILES)
file(GLOB proto_files "${CMAKE_CURRENT_LIST_DIR}/src/tensorflow/*.proto" "${CMAKE_CURRENT_LIST_DIR}/src/caffe/opencv-caffe.proto")
file(GLOB proto_files "${CMAKE_CURRENT_LIST_DIR}/src/tensorflow/*.proto" "${CMAKE_CURRENT_LIST_DIR}/src/caffe/opencv-caffe.proto" "${CMAKE_CURRENT_LIST_DIR}/src/onnx/opencv-onnx.proto")
set(PROTOBUF_GENERATE_CPP_APPEND_PATH ON) # required for tensorflow
protobuf_generate_cpp(fw_srcs fw_hdrs ${proto_files})
else()
file(GLOB fw_srcs "${CMAKE_CURRENT_LIST_DIR}/misc/tensorflow/*.cc" "${CMAKE_CURRENT_LIST_DIR}/misc/caffe/opencv-caffe.pb.cc")
file(GLOB fw_hdrs "${CMAKE_CURRENT_LIST_DIR}/misc/tensorflow/*.h" "${CMAKE_CURRENT_LIST_DIR}/misc/caffe/opencv-caffe.pb.h")
set(fw_inc "${CMAKE_CURRENT_LIST_DIR}/misc/caffe" "${CMAKE_CURRENT_LIST_DIR}/misc/tensorflow")
file(GLOB fw_srcs "${CMAKE_CURRENT_LIST_DIR}/misc/tensorflow/*.cc" "${CMAKE_CURRENT_LIST_DIR}/misc/caffe/opencv-caffe.pb.cc" "${CMAKE_CURRENT_LIST_DIR}/misc/onnx/opencv-onnx.pb.cc")
file(GLOB fw_hdrs "${CMAKE_CURRENT_LIST_DIR}/misc/tensorflow/*.h" "${CMAKE_CURRENT_LIST_DIR}/misc/caffe/opencv-caffe.pb.h" "${CMAKE_CURRENT_LIST_DIR}/misc/onnx/opencv-onnx.pb.h")
set(fw_inc "${CMAKE_CURRENT_LIST_DIR}/misc/caffe" "${CMAKE_CURRENT_LIST_DIR}/misc/tensorflow" "${CMAKE_CURRENT_LIST_DIR}/misc/onnx")
endif()
set(include_dirs ${fw_inc})

View File

@ -141,6 +141,9 @@ public:
template<typename T>
const T &set(const String &key, const T &value);
//! Erase @p key from the dictionary.
void erase(const String &key);
friend std::ostream &operator<<(std::ostream &stream, const Dict &dict);
std::map<String, DictValue>::const_iterator begin() const;

View File

@ -807,6 +807,18 @@ CV__DNN_INLINE_NS_BEGIN
*/
CV_EXPORTS_W Net readNetFromModelOptimizer(const String &xml, const String &bin);
/** @brief Reads a network model <a href="https://onnx.ai/">ONNX</a>.
* @param onnxFile path to the .onnx file with text description of the network architecture.
* @returns Network object that ready to do forward, throw an exception in failure cases.
*/
CV_EXPORTS_W Net readNetFromONNX(const String &onnxFile);
/** @brief Creates blob from .pb file.
* @param path to the .pb file with input tensor.
* @returns Mat.
*/
CV_EXPORTS_W Mat readTensorFromONNX(const String& path);
/** @brief Creates 4-dimensional blob from image. Optionally resizes and crops @p image from center,
* subtract @p mean values, scales values by @p scalefactor, swap Blue and Red channels.
* @param image input image (with 1-, 3- or 4-channels).
@ -915,6 +927,11 @@ CV__DNN_INLINE_NS_BEGIN
CV_OUT std::vector<int>& indices,
const float eta = 1.f, const int top_k = 0);
CV_EXPORTS_W void NMSBoxes(const std::vector<Rect2d>& bboxes, const std::vector<float>& scores,
const float score_threshold, const float nms_threshold,
CV_OUT std::vector<int>& indices,
const float eta = 1.f, const int top_k = 0);
CV_EXPORTS_AS(NMSBoxesRotated) void NMSBoxes(const std::vector<RotatedRect>& bboxes, const std::vector<float>& scores,
const float score_threshold, const float nms_threshold,
CV_OUT std::vector<int>& indices,

View File

@ -360,6 +360,11 @@ inline const T &Dict::set(const String &key, const T &value)
return value;
}
inline void Dict::erase(const String &key)
{
dict.erase(key);
}
inline std::ostream &operator<<(std::ostream &stream, const Dict &dict)
{
Dict::_Dict::const_iterator it;

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -65,7 +65,7 @@ inline void InitDefaults() {
InitDefaultsGradientDef();
}
} // namespace protobuf_function_2eproto
namespace tensorflow {
namespace opencv_tensorflow {
class FunctionDef;
class FunctionDefDefaultTypeInternal;
extern FunctionDefDefaultTypeInternal _FunctionDef_default_instance_;
@ -81,12 +81,12 @@ extern FunctionDef_Node_AttrEntry_DoNotUseDefaultTypeInternal _FunctionDef_Node_
class GradientDef;
class GradientDefDefaultTypeInternal;
extern GradientDefDefaultTypeInternal _GradientDef_default_instance_;
} // namespace tensorflow
namespace tensorflow {
} // namespace opencv_tensorflow
namespace opencv_tensorflow {
// ===================================================================
class FunctionDefLibrary : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:tensorflow.FunctionDefLibrary) */ {
class FunctionDefLibrary : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_tensorflow.FunctionDefLibrary) */ {
public:
FunctionDefLibrary();
virtual ~FunctionDefLibrary();
@ -180,39 +180,39 @@ class FunctionDefLibrary : public ::google::protobuf::Message /* @@protoc_insert
// accessors -------------------------------------------------------
// repeated .tensorflow.FunctionDef function = 1;
// repeated .opencv_tensorflow.FunctionDef function = 1;
int function_size() const;
void clear_function();
static const int kFunctionFieldNumber = 1;
const ::tensorflow::FunctionDef& function(int index) const;
::tensorflow::FunctionDef* mutable_function(int index);
::tensorflow::FunctionDef* add_function();
::google::protobuf::RepeatedPtrField< ::tensorflow::FunctionDef >*
const ::opencv_tensorflow::FunctionDef& function(int index) const;
::opencv_tensorflow::FunctionDef* mutable_function(int index);
::opencv_tensorflow::FunctionDef* add_function();
::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::FunctionDef >*
mutable_function();
const ::google::protobuf::RepeatedPtrField< ::tensorflow::FunctionDef >&
const ::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::FunctionDef >&
function() const;
// repeated .tensorflow.GradientDef gradient = 2;
// repeated .opencv_tensorflow.GradientDef gradient = 2;
int gradient_size() const;
void clear_gradient();
static const int kGradientFieldNumber = 2;
const ::tensorflow::GradientDef& gradient(int index) const;
::tensorflow::GradientDef* mutable_gradient(int index);
::tensorflow::GradientDef* add_gradient();
::google::protobuf::RepeatedPtrField< ::tensorflow::GradientDef >*
const ::opencv_tensorflow::GradientDef& gradient(int index) const;
::opencv_tensorflow::GradientDef* mutable_gradient(int index);
::opencv_tensorflow::GradientDef* add_gradient();
::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::GradientDef >*
mutable_gradient();
const ::google::protobuf::RepeatedPtrField< ::tensorflow::GradientDef >&
const ::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::GradientDef >&
gradient() const;
// @@protoc_insertion_point(class_scope:tensorflow.FunctionDefLibrary)
// @@protoc_insertion_point(class_scope:opencv_tensorflow.FunctionDefLibrary)
private:
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::RepeatedPtrField< ::tensorflow::FunctionDef > function_;
::google::protobuf::RepeatedPtrField< ::tensorflow::GradientDef > gradient_;
::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::FunctionDef > function_;
::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::GradientDef > gradient_;
mutable int _cached_size_;
friend struct ::protobuf_function_2eproto::TableStruct;
friend void ::protobuf_function_2eproto::InitDefaultsFunctionDefLibraryImpl();
@ -220,13 +220,13 @@ class FunctionDefLibrary : public ::google::protobuf::Message /* @@protoc_insert
// -------------------------------------------------------------------
class FunctionDef_Node_AttrEntry_DoNotUse : public ::google::protobuf::internal::MapEntry<FunctionDef_Node_AttrEntry_DoNotUse,
::std::string, ::tensorflow::AttrValue,
::std::string, ::opencv_tensorflow::AttrValue,
::google::protobuf::internal::WireFormatLite::TYPE_STRING,
::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE,
0 > {
public:
typedef ::google::protobuf::internal::MapEntry<FunctionDef_Node_AttrEntry_DoNotUse,
::std::string, ::tensorflow::AttrValue,
::std::string, ::opencv_tensorflow::AttrValue,
::google::protobuf::internal::WireFormatLite::TYPE_STRING,
::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE,
0 > SuperType;
@ -240,7 +240,7 @@ public:
// -------------------------------------------------------------------
class FunctionDef_Node : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:tensorflow.FunctionDef.Node) */ {
class FunctionDef_Node : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_tensorflow.FunctionDef.Node) */ {
public:
FunctionDef_Node();
virtual ~FunctionDef_Node();
@ -401,13 +401,13 @@ class FunctionDef_Node : public ::google::protobuf::Message /* @@protoc_insertio
const ::google::protobuf::RepeatedPtrField< ::std::string>& dep() const;
::google::protobuf::RepeatedPtrField< ::std::string>* mutable_dep();
// map<string, .tensorflow.AttrValue> attr = 5;
// map<string, .opencv_tensorflow.AttrValue> attr = 5;
int attr_size() const;
void clear_attr();
static const int kAttrFieldNumber = 5;
const ::google::protobuf::Map< ::std::string, ::tensorflow::AttrValue >&
const ::google::protobuf::Map< ::std::string, ::opencv_tensorflow::AttrValue >&
attr() const;
::google::protobuf::Map< ::std::string, ::tensorflow::AttrValue >*
::google::protobuf::Map< ::std::string, ::opencv_tensorflow::AttrValue >*
mutable_attr();
// string op = 2;
@ -433,7 +433,7 @@ class FunctionDef_Node : public ::google::protobuf::Message /* @@protoc_insertio
void unsafe_arena_set_allocated_op(
::std::string* op);
// @@protoc_insertion_point(class_scope:tensorflow.FunctionDef.Node)
// @@protoc_insertion_point(class_scope:opencv_tensorflow.FunctionDef.Node)
private:
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
@ -445,7 +445,7 @@ class FunctionDef_Node : public ::google::protobuf::Message /* @@protoc_insertio
::google::protobuf::RepeatedPtrField< ::std::string> dep_;
::google::protobuf::internal::MapField<
FunctionDef_Node_AttrEntry_DoNotUse,
::std::string, ::tensorflow::AttrValue,
::std::string, ::opencv_tensorflow::AttrValue,
::google::protobuf::internal::WireFormatLite::TYPE_STRING,
::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE,
0 > attr_;
@ -456,7 +456,7 @@ class FunctionDef_Node : public ::google::protobuf::Message /* @@protoc_insertio
};
// -------------------------------------------------------------------
class FunctionDef : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:tensorflow.FunctionDef) */ {
class FunctionDef : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_tensorflow.FunctionDef) */ {
public:
FunctionDef();
virtual ~FunctionDef();
@ -552,49 +552,49 @@ class FunctionDef : public ::google::protobuf::Message /* @@protoc_insertion_poi
// accessors -------------------------------------------------------
// repeated .tensorflow.FunctionDef.Node node = 2;
// repeated .opencv_tensorflow.FunctionDef.Node node = 2;
int node_size() const;
void clear_node();
static const int kNodeFieldNumber = 2;
const ::tensorflow::FunctionDef_Node& node(int index) const;
::tensorflow::FunctionDef_Node* mutable_node(int index);
::tensorflow::FunctionDef_Node* add_node();
::google::protobuf::RepeatedPtrField< ::tensorflow::FunctionDef_Node >*
const ::opencv_tensorflow::FunctionDef_Node& node(int index) const;
::opencv_tensorflow::FunctionDef_Node* mutable_node(int index);
::opencv_tensorflow::FunctionDef_Node* add_node();
::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::FunctionDef_Node >*
mutable_node();
const ::google::protobuf::RepeatedPtrField< ::tensorflow::FunctionDef_Node >&
const ::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::FunctionDef_Node >&
node() const;
// .tensorflow.OpDef signature = 1;
// .opencv_tensorflow.OpDef signature = 1;
bool has_signature() const;
void clear_signature();
static const int kSignatureFieldNumber = 1;
private:
void _slow_mutable_signature();
public:
const ::tensorflow::OpDef& signature() const;
::tensorflow::OpDef* release_signature();
::tensorflow::OpDef* mutable_signature();
void set_allocated_signature(::tensorflow::OpDef* signature);
const ::opencv_tensorflow::OpDef& signature() const;
::opencv_tensorflow::OpDef* release_signature();
::opencv_tensorflow::OpDef* mutable_signature();
void set_allocated_signature(::opencv_tensorflow::OpDef* signature);
void unsafe_arena_set_allocated_signature(
::tensorflow::OpDef* signature);
::tensorflow::OpDef* unsafe_arena_release_signature();
::opencv_tensorflow::OpDef* signature);
::opencv_tensorflow::OpDef* unsafe_arena_release_signature();
// @@protoc_insertion_point(class_scope:tensorflow.FunctionDef)
// @@protoc_insertion_point(class_scope:opencv_tensorflow.FunctionDef)
private:
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::RepeatedPtrField< ::tensorflow::FunctionDef_Node > node_;
::tensorflow::OpDef* signature_;
::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::FunctionDef_Node > node_;
::opencv_tensorflow::OpDef* signature_;
mutable int _cached_size_;
friend struct ::protobuf_function_2eproto::TableStruct;
friend void ::protobuf_function_2eproto::InitDefaultsFunctionDefImpl();
};
// -------------------------------------------------------------------
class GradientDef : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:tensorflow.GradientDef) */ {
class GradientDef : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_tensorflow.GradientDef) */ {
public:
GradientDef();
virtual ~GradientDef();
@ -734,7 +734,7 @@ class GradientDef : public ::google::protobuf::Message /* @@protoc_insertion_poi
void unsafe_arena_set_allocated_gradient_func(
::std::string* gradient_func);
// @@protoc_insertion_point(class_scope:tensorflow.GradientDef)
// @@protoc_insertion_point(class_scope:opencv_tensorflow.GradientDef)
private:
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
@ -758,63 +758,63 @@ class GradientDef : public ::google::protobuf::Message /* @@protoc_insertion_poi
#endif // __GNUC__
// FunctionDefLibrary
// repeated .tensorflow.FunctionDef function = 1;
// repeated .opencv_tensorflow.FunctionDef function = 1;
inline int FunctionDefLibrary::function_size() const {
return function_.size();
}
inline void FunctionDefLibrary::clear_function() {
function_.Clear();
}
inline const ::tensorflow::FunctionDef& FunctionDefLibrary::function(int index) const {
// @@protoc_insertion_point(field_get:tensorflow.FunctionDefLibrary.function)
inline const ::opencv_tensorflow::FunctionDef& FunctionDefLibrary::function(int index) const {
// @@protoc_insertion_point(field_get:opencv_tensorflow.FunctionDefLibrary.function)
return function_.Get(index);
}
inline ::tensorflow::FunctionDef* FunctionDefLibrary::mutable_function(int index) {
// @@protoc_insertion_point(field_mutable:tensorflow.FunctionDefLibrary.function)
inline ::opencv_tensorflow::FunctionDef* FunctionDefLibrary::mutable_function(int index) {
// @@protoc_insertion_point(field_mutable:opencv_tensorflow.FunctionDefLibrary.function)
return function_.Mutable(index);
}
inline ::tensorflow::FunctionDef* FunctionDefLibrary::add_function() {
// @@protoc_insertion_point(field_add:tensorflow.FunctionDefLibrary.function)
inline ::opencv_tensorflow::FunctionDef* FunctionDefLibrary::add_function() {
// @@protoc_insertion_point(field_add:opencv_tensorflow.FunctionDefLibrary.function)
return function_.Add();
}
inline ::google::protobuf::RepeatedPtrField< ::tensorflow::FunctionDef >*
inline ::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::FunctionDef >*
FunctionDefLibrary::mutable_function() {
// @@protoc_insertion_point(field_mutable_list:tensorflow.FunctionDefLibrary.function)
// @@protoc_insertion_point(field_mutable_list:opencv_tensorflow.FunctionDefLibrary.function)
return &function_;
}
inline const ::google::protobuf::RepeatedPtrField< ::tensorflow::FunctionDef >&
inline const ::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::FunctionDef >&
FunctionDefLibrary::function() const {
// @@protoc_insertion_point(field_list:tensorflow.FunctionDefLibrary.function)
// @@protoc_insertion_point(field_list:opencv_tensorflow.FunctionDefLibrary.function)
return function_;
}
// repeated .tensorflow.GradientDef gradient = 2;
// repeated .opencv_tensorflow.GradientDef gradient = 2;
inline int FunctionDefLibrary::gradient_size() const {
return gradient_.size();
}
inline void FunctionDefLibrary::clear_gradient() {
gradient_.Clear();
}
inline const ::tensorflow::GradientDef& FunctionDefLibrary::gradient(int index) const {
// @@protoc_insertion_point(field_get:tensorflow.FunctionDefLibrary.gradient)
inline const ::opencv_tensorflow::GradientDef& FunctionDefLibrary::gradient(int index) const {
// @@protoc_insertion_point(field_get:opencv_tensorflow.FunctionDefLibrary.gradient)
return gradient_.Get(index);
}
inline ::tensorflow::GradientDef* FunctionDefLibrary::mutable_gradient(int index) {
// @@protoc_insertion_point(field_mutable:tensorflow.FunctionDefLibrary.gradient)
inline ::opencv_tensorflow::GradientDef* FunctionDefLibrary::mutable_gradient(int index) {
// @@protoc_insertion_point(field_mutable:opencv_tensorflow.FunctionDefLibrary.gradient)
return gradient_.Mutable(index);
}
inline ::tensorflow::GradientDef* FunctionDefLibrary::add_gradient() {
// @@protoc_insertion_point(field_add:tensorflow.FunctionDefLibrary.gradient)
inline ::opencv_tensorflow::GradientDef* FunctionDefLibrary::add_gradient() {
// @@protoc_insertion_point(field_add:opencv_tensorflow.FunctionDefLibrary.gradient)
return gradient_.Add();
}
inline ::google::protobuf::RepeatedPtrField< ::tensorflow::GradientDef >*
inline ::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::GradientDef >*
FunctionDefLibrary::mutable_gradient() {
// @@protoc_insertion_point(field_mutable_list:tensorflow.FunctionDefLibrary.gradient)
// @@protoc_insertion_point(field_mutable_list:opencv_tensorflow.FunctionDefLibrary.gradient)
return &gradient_;
}
inline const ::google::protobuf::RepeatedPtrField< ::tensorflow::GradientDef >&
inline const ::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::GradientDef >&
FunctionDefLibrary::gradient() const {
// @@protoc_insertion_point(field_list:tensorflow.FunctionDefLibrary.gradient)
// @@protoc_insertion_point(field_list:opencv_tensorflow.FunctionDefLibrary.gradient)
return gradient_;
}
@ -832,64 +832,64 @@ inline void FunctionDef_Node::clear_ret() {
ret_.Clear();
}
inline const ::std::string& FunctionDef_Node::ret(int index) const {
// @@protoc_insertion_point(field_get:tensorflow.FunctionDef.Node.ret)
// @@protoc_insertion_point(field_get:opencv_tensorflow.FunctionDef.Node.ret)
return ret_.Get(index);
}
inline ::std::string* FunctionDef_Node::mutable_ret(int index) {
// @@protoc_insertion_point(field_mutable:tensorflow.FunctionDef.Node.ret)
// @@protoc_insertion_point(field_mutable:opencv_tensorflow.FunctionDef.Node.ret)
return ret_.Mutable(index);
}
inline void FunctionDef_Node::set_ret(int index, const ::std::string& value) {
// @@protoc_insertion_point(field_set:tensorflow.FunctionDef.Node.ret)
// @@protoc_insertion_point(field_set:opencv_tensorflow.FunctionDef.Node.ret)
ret_.Mutable(index)->assign(value);
}
#if LANG_CXX11
inline void FunctionDef_Node::set_ret(int index, ::std::string&& value) {
// @@protoc_insertion_point(field_set:tensorflow.FunctionDef.Node.ret)
// @@protoc_insertion_point(field_set:opencv_tensorflow.FunctionDef.Node.ret)
ret_.Mutable(index)->assign(std::move(value));
}
#endif
inline void FunctionDef_Node::set_ret(int index, const char* value) {
GOOGLE_DCHECK(value != NULL);
ret_.Mutable(index)->assign(value);
// @@protoc_insertion_point(field_set_char:tensorflow.FunctionDef.Node.ret)
// @@protoc_insertion_point(field_set_char:opencv_tensorflow.FunctionDef.Node.ret)
}
inline void FunctionDef_Node::set_ret(int index, const char* value, size_t size) {
ret_.Mutable(index)->assign(
reinterpret_cast<const char*>(value), size);
// @@protoc_insertion_point(field_set_pointer:tensorflow.FunctionDef.Node.ret)
// @@protoc_insertion_point(field_set_pointer:opencv_tensorflow.FunctionDef.Node.ret)
}
inline ::std::string* FunctionDef_Node::add_ret() {
// @@protoc_insertion_point(field_add_mutable:tensorflow.FunctionDef.Node.ret)
// @@protoc_insertion_point(field_add_mutable:opencv_tensorflow.FunctionDef.Node.ret)
return ret_.Add();
}
inline void FunctionDef_Node::add_ret(const ::std::string& value) {
ret_.Add()->assign(value);
// @@protoc_insertion_point(field_add:tensorflow.FunctionDef.Node.ret)
// @@protoc_insertion_point(field_add:opencv_tensorflow.FunctionDef.Node.ret)
}
#if LANG_CXX11
inline void FunctionDef_Node::add_ret(::std::string&& value) {
ret_.Add(std::move(value));
// @@protoc_insertion_point(field_add:tensorflow.FunctionDef.Node.ret)
// @@protoc_insertion_point(field_add:opencv_tensorflow.FunctionDef.Node.ret)
}
#endif
inline void FunctionDef_Node::add_ret(const char* value) {
GOOGLE_DCHECK(value != NULL);
ret_.Add()->assign(value);
// @@protoc_insertion_point(field_add_char:tensorflow.FunctionDef.Node.ret)
// @@protoc_insertion_point(field_add_char:opencv_tensorflow.FunctionDef.Node.ret)
}
inline void FunctionDef_Node::add_ret(const char* value, size_t size) {
ret_.Add()->assign(reinterpret_cast<const char*>(value), size);
// @@protoc_insertion_point(field_add_pointer:tensorflow.FunctionDef.Node.ret)
// @@protoc_insertion_point(field_add_pointer:opencv_tensorflow.FunctionDef.Node.ret)
}
inline const ::google::protobuf::RepeatedPtrField< ::std::string>&
FunctionDef_Node::ret() const {
// @@protoc_insertion_point(field_list:tensorflow.FunctionDef.Node.ret)
// @@protoc_insertion_point(field_list:opencv_tensorflow.FunctionDef.Node.ret)
return ret_;
}
inline ::google::protobuf::RepeatedPtrField< ::std::string>*
FunctionDef_Node::mutable_ret() {
// @@protoc_insertion_point(field_mutable_list:tensorflow.FunctionDef.Node.ret)
// @@protoc_insertion_point(field_mutable_list:opencv_tensorflow.FunctionDef.Node.ret)
return &ret_;
}
@ -898,20 +898,20 @@ inline void FunctionDef_Node::clear_op() {
op_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
inline const ::std::string& FunctionDef_Node::op() const {
// @@protoc_insertion_point(field_get:tensorflow.FunctionDef.Node.op)
// @@protoc_insertion_point(field_get:opencv_tensorflow.FunctionDef.Node.op)
return op_.Get();
}
inline void FunctionDef_Node::set_op(const ::std::string& value) {
op_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
// @@protoc_insertion_point(field_set:tensorflow.FunctionDef.Node.op)
// @@protoc_insertion_point(field_set:opencv_tensorflow.FunctionDef.Node.op)
}
#if LANG_CXX11
inline void FunctionDef_Node::set_op(::std::string&& value) {
op_.Set(
&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_rvalue:tensorflow.FunctionDef.Node.op)
// @@protoc_insertion_point(field_set_rvalue:opencv_tensorflow.FunctionDef.Node.op)
}
#endif
inline void FunctionDef_Node::set_op(const char* value) {
@ -919,22 +919,22 @@ inline void FunctionDef_Node::set_op(const char* value) {
op_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_char:tensorflow.FunctionDef.Node.op)
// @@protoc_insertion_point(field_set_char:opencv_tensorflow.FunctionDef.Node.op)
}
inline void FunctionDef_Node::set_op(const char* value,
size_t size) {
op_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_pointer:tensorflow.FunctionDef.Node.op)
// @@protoc_insertion_point(field_set_pointer:opencv_tensorflow.FunctionDef.Node.op)
}
inline ::std::string* FunctionDef_Node::mutable_op() {
// @@protoc_insertion_point(field_mutable:tensorflow.FunctionDef.Node.op)
// @@protoc_insertion_point(field_mutable:opencv_tensorflow.FunctionDef.Node.op)
return op_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
inline ::std::string* FunctionDef_Node::release_op() {
// @@protoc_insertion_point(field_release:tensorflow.FunctionDef.Node.op)
// @@protoc_insertion_point(field_release:opencv_tensorflow.FunctionDef.Node.op)
return op_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
@ -946,10 +946,10 @@ inline void FunctionDef_Node::set_allocated_op(::std::string* op) {
}
op_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), op,
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_allocated:tensorflow.FunctionDef.Node.op)
// @@protoc_insertion_point(field_set_allocated:opencv_tensorflow.FunctionDef.Node.op)
}
inline ::std::string* FunctionDef_Node::unsafe_arena_release_op() {
// @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.FunctionDef.Node.op)
// @@protoc_insertion_point(field_unsafe_arena_release:opencv_tensorflow.FunctionDef.Node.op)
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
return op_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
@ -965,7 +965,7 @@ inline void FunctionDef_Node::unsafe_arena_set_allocated_op(
}
op_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
op, GetArenaNoVirtual());
// @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.FunctionDef.Node.op)
// @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_tensorflow.FunctionDef.Node.op)
}
// repeated string arg = 3;
@ -976,64 +976,64 @@ inline void FunctionDef_Node::clear_arg() {
arg_.Clear();
}
inline const ::std::string& FunctionDef_Node::arg(int index) const {
// @@protoc_insertion_point(field_get:tensorflow.FunctionDef.Node.arg)
// @@protoc_insertion_point(field_get:opencv_tensorflow.FunctionDef.Node.arg)
return arg_.Get(index);
}
inline ::std::string* FunctionDef_Node::mutable_arg(int index) {
// @@protoc_insertion_point(field_mutable:tensorflow.FunctionDef.Node.arg)
// @@protoc_insertion_point(field_mutable:opencv_tensorflow.FunctionDef.Node.arg)
return arg_.Mutable(index);
}
inline void FunctionDef_Node::set_arg(int index, const ::std::string& value) {
// @@protoc_insertion_point(field_set:tensorflow.FunctionDef.Node.arg)
// @@protoc_insertion_point(field_set:opencv_tensorflow.FunctionDef.Node.arg)
arg_.Mutable(index)->assign(value);
}
#if LANG_CXX11
inline void FunctionDef_Node::set_arg(int index, ::std::string&& value) {
// @@protoc_insertion_point(field_set:tensorflow.FunctionDef.Node.arg)
// @@protoc_insertion_point(field_set:opencv_tensorflow.FunctionDef.Node.arg)
arg_.Mutable(index)->assign(std::move(value));
}
#endif
inline void FunctionDef_Node::set_arg(int index, const char* value) {
GOOGLE_DCHECK(value != NULL);
arg_.Mutable(index)->assign(value);
// @@protoc_insertion_point(field_set_char:tensorflow.FunctionDef.Node.arg)
// @@protoc_insertion_point(field_set_char:opencv_tensorflow.FunctionDef.Node.arg)
}
inline void FunctionDef_Node::set_arg(int index, const char* value, size_t size) {
arg_.Mutable(index)->assign(
reinterpret_cast<const char*>(value), size);
// @@protoc_insertion_point(field_set_pointer:tensorflow.FunctionDef.Node.arg)
// @@protoc_insertion_point(field_set_pointer:opencv_tensorflow.FunctionDef.Node.arg)
}
inline ::std::string* FunctionDef_Node::add_arg() {
// @@protoc_insertion_point(field_add_mutable:tensorflow.FunctionDef.Node.arg)
// @@protoc_insertion_point(field_add_mutable:opencv_tensorflow.FunctionDef.Node.arg)
return arg_.Add();
}
inline void FunctionDef_Node::add_arg(const ::std::string& value) {
arg_.Add()->assign(value);
// @@protoc_insertion_point(field_add:tensorflow.FunctionDef.Node.arg)
// @@protoc_insertion_point(field_add:opencv_tensorflow.FunctionDef.Node.arg)
}
#if LANG_CXX11
inline void FunctionDef_Node::add_arg(::std::string&& value) {
arg_.Add(std::move(value));
// @@protoc_insertion_point(field_add:tensorflow.FunctionDef.Node.arg)
// @@protoc_insertion_point(field_add:opencv_tensorflow.FunctionDef.Node.arg)
}
#endif
inline void FunctionDef_Node::add_arg(const char* value) {
GOOGLE_DCHECK(value != NULL);
arg_.Add()->assign(value);
// @@protoc_insertion_point(field_add_char:tensorflow.FunctionDef.Node.arg)
// @@protoc_insertion_point(field_add_char:opencv_tensorflow.FunctionDef.Node.arg)
}
inline void FunctionDef_Node::add_arg(const char* value, size_t size) {
arg_.Add()->assign(reinterpret_cast<const char*>(value), size);
// @@protoc_insertion_point(field_add_pointer:tensorflow.FunctionDef.Node.arg)
// @@protoc_insertion_point(field_add_pointer:opencv_tensorflow.FunctionDef.Node.arg)
}
inline const ::google::protobuf::RepeatedPtrField< ::std::string>&
FunctionDef_Node::arg() const {
// @@protoc_insertion_point(field_list:tensorflow.FunctionDef.Node.arg)
// @@protoc_insertion_point(field_list:opencv_tensorflow.FunctionDef.Node.arg)
return arg_;
}
inline ::google::protobuf::RepeatedPtrField< ::std::string>*
FunctionDef_Node::mutable_arg() {
// @@protoc_insertion_point(field_mutable_list:tensorflow.FunctionDef.Node.arg)
// @@protoc_insertion_point(field_mutable_list:opencv_tensorflow.FunctionDef.Node.arg)
return &arg_;
}
@ -1045,79 +1045,79 @@ inline void FunctionDef_Node::clear_dep() {
dep_.Clear();
}
inline const ::std::string& FunctionDef_Node::dep(int index) const {
// @@protoc_insertion_point(field_get:tensorflow.FunctionDef.Node.dep)
// @@protoc_insertion_point(field_get:opencv_tensorflow.FunctionDef.Node.dep)
return dep_.Get(index);
}
inline ::std::string* FunctionDef_Node::mutable_dep(int index) {
// @@protoc_insertion_point(field_mutable:tensorflow.FunctionDef.Node.dep)
// @@protoc_insertion_point(field_mutable:opencv_tensorflow.FunctionDef.Node.dep)
return dep_.Mutable(index);
}
inline void FunctionDef_Node::set_dep(int index, const ::std::string& value) {
// @@protoc_insertion_point(field_set:tensorflow.FunctionDef.Node.dep)
// @@protoc_insertion_point(field_set:opencv_tensorflow.FunctionDef.Node.dep)
dep_.Mutable(index)->assign(value);
}
#if LANG_CXX11
inline void FunctionDef_Node::set_dep(int index, ::std::string&& value) {
// @@protoc_insertion_point(field_set:tensorflow.FunctionDef.Node.dep)
// @@protoc_insertion_point(field_set:opencv_tensorflow.FunctionDef.Node.dep)
dep_.Mutable(index)->assign(std::move(value));
}
#endif
inline void FunctionDef_Node::set_dep(int index, const char* value) {
GOOGLE_DCHECK(value != NULL);
dep_.Mutable(index)->assign(value);
// @@protoc_insertion_point(field_set_char:tensorflow.FunctionDef.Node.dep)
// @@protoc_insertion_point(field_set_char:opencv_tensorflow.FunctionDef.Node.dep)
}
inline void FunctionDef_Node::set_dep(int index, const char* value, size_t size) {
dep_.Mutable(index)->assign(
reinterpret_cast<const char*>(value), size);
// @@protoc_insertion_point(field_set_pointer:tensorflow.FunctionDef.Node.dep)
// @@protoc_insertion_point(field_set_pointer:opencv_tensorflow.FunctionDef.Node.dep)
}
inline ::std::string* FunctionDef_Node::add_dep() {
// @@protoc_insertion_point(field_add_mutable:tensorflow.FunctionDef.Node.dep)
// @@protoc_insertion_point(field_add_mutable:opencv_tensorflow.FunctionDef.Node.dep)
return dep_.Add();
}
inline void FunctionDef_Node::add_dep(const ::std::string& value) {
dep_.Add()->assign(value);
// @@protoc_insertion_point(field_add:tensorflow.FunctionDef.Node.dep)
// @@protoc_insertion_point(field_add:opencv_tensorflow.FunctionDef.Node.dep)
}
#if LANG_CXX11
inline void FunctionDef_Node::add_dep(::std::string&& value) {
dep_.Add(std::move(value));
// @@protoc_insertion_point(field_add:tensorflow.FunctionDef.Node.dep)
// @@protoc_insertion_point(field_add:opencv_tensorflow.FunctionDef.Node.dep)
}
#endif
inline void FunctionDef_Node::add_dep(const char* value) {
GOOGLE_DCHECK(value != NULL);
dep_.Add()->assign(value);
// @@protoc_insertion_point(field_add_char:tensorflow.FunctionDef.Node.dep)
// @@protoc_insertion_point(field_add_char:opencv_tensorflow.FunctionDef.Node.dep)
}
inline void FunctionDef_Node::add_dep(const char* value, size_t size) {
dep_.Add()->assign(reinterpret_cast<const char*>(value), size);
// @@protoc_insertion_point(field_add_pointer:tensorflow.FunctionDef.Node.dep)
// @@protoc_insertion_point(field_add_pointer:opencv_tensorflow.FunctionDef.Node.dep)
}
inline const ::google::protobuf::RepeatedPtrField< ::std::string>&
FunctionDef_Node::dep() const {
// @@protoc_insertion_point(field_list:tensorflow.FunctionDef.Node.dep)
// @@protoc_insertion_point(field_list:opencv_tensorflow.FunctionDef.Node.dep)
return dep_;
}
inline ::google::protobuf::RepeatedPtrField< ::std::string>*
FunctionDef_Node::mutable_dep() {
// @@protoc_insertion_point(field_mutable_list:tensorflow.FunctionDef.Node.dep)
// @@protoc_insertion_point(field_mutable_list:opencv_tensorflow.FunctionDef.Node.dep)
return &dep_;
}
// map<string, .tensorflow.AttrValue> attr = 5;
// map<string, .opencv_tensorflow.AttrValue> attr = 5;
inline int FunctionDef_Node::attr_size() const {
return attr_.size();
}
inline const ::google::protobuf::Map< ::std::string, ::tensorflow::AttrValue >&
inline const ::google::protobuf::Map< ::std::string, ::opencv_tensorflow::AttrValue >&
FunctionDef_Node::attr() const {
// @@protoc_insertion_point(field_map:tensorflow.FunctionDef.Node.attr)
// @@protoc_insertion_point(field_map:opencv_tensorflow.FunctionDef.Node.attr)
return attr_.GetMap();
}
inline ::google::protobuf::Map< ::std::string, ::tensorflow::AttrValue >*
inline ::google::protobuf::Map< ::std::string, ::opencv_tensorflow::AttrValue >*
FunctionDef_Node::mutable_attr() {
// @@protoc_insertion_point(field_mutable_map:tensorflow.FunctionDef.Node.attr)
// @@protoc_insertion_point(field_mutable_map:opencv_tensorflow.FunctionDef.Node.attr)
return attr_.MutableMap();
}
@ -1125,42 +1125,42 @@ FunctionDef_Node::mutable_attr() {
// FunctionDef
// .tensorflow.OpDef signature = 1;
// .opencv_tensorflow.OpDef signature = 1;
inline bool FunctionDef::has_signature() const {
return this != internal_default_instance() && signature_ != NULL;
}
inline const ::tensorflow::OpDef& FunctionDef::signature() const {
const ::tensorflow::OpDef* p = signature_;
// @@protoc_insertion_point(field_get:tensorflow.FunctionDef.signature)
return p != NULL ? *p : *reinterpret_cast<const ::tensorflow::OpDef*>(
&::tensorflow::_OpDef_default_instance_);
inline const ::opencv_tensorflow::OpDef& FunctionDef::signature() const {
const ::opencv_tensorflow::OpDef* p = signature_;
// @@protoc_insertion_point(field_get:opencv_tensorflow.FunctionDef.signature)
return p != NULL ? *p : *reinterpret_cast<const ::opencv_tensorflow::OpDef*>(
&::opencv_tensorflow::_OpDef_default_instance_);
}
inline ::tensorflow::OpDef* FunctionDef::release_signature() {
// @@protoc_insertion_point(field_release:tensorflow.FunctionDef.signature)
inline ::opencv_tensorflow::OpDef* FunctionDef::release_signature() {
// @@protoc_insertion_point(field_release:opencv_tensorflow.FunctionDef.signature)
::tensorflow::OpDef* temp = signature_;
::opencv_tensorflow::OpDef* temp = signature_;
if (GetArenaNoVirtual() != NULL) {
temp = ::google::protobuf::internal::DuplicateIfNonNull(temp, NULL);
}
signature_ = NULL;
return temp;
}
inline ::tensorflow::OpDef* FunctionDef::unsafe_arena_release_signature() {
// @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.FunctionDef.signature)
inline ::opencv_tensorflow::OpDef* FunctionDef::unsafe_arena_release_signature() {
// @@protoc_insertion_point(field_unsafe_arena_release:opencv_tensorflow.FunctionDef.signature)
::tensorflow::OpDef* temp = signature_;
::opencv_tensorflow::OpDef* temp = signature_;
signature_ = NULL;
return temp;
}
inline ::tensorflow::OpDef* FunctionDef::mutable_signature() {
inline ::opencv_tensorflow::OpDef* FunctionDef::mutable_signature() {
if (signature_ == NULL) {
_slow_mutable_signature();
}
// @@protoc_insertion_point(field_mutable:tensorflow.FunctionDef.signature)
// @@protoc_insertion_point(field_mutable:opencv_tensorflow.FunctionDef.signature)
return signature_;
}
inline void FunctionDef::set_allocated_signature(::tensorflow::OpDef* signature) {
inline void FunctionDef::set_allocated_signature(::opencv_tensorflow::OpDef* signature) {
::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
if (message_arena == NULL) {
delete reinterpret_cast< ::google::protobuf::MessageLite*>(signature_);
@ -1177,36 +1177,36 @@ inline void FunctionDef::set_allocated_signature(::tensorflow::OpDef* signature)
}
signature_ = signature;
// @@protoc_insertion_point(field_set_allocated:tensorflow.FunctionDef.signature)
// @@protoc_insertion_point(field_set_allocated:opencv_tensorflow.FunctionDef.signature)
}
// repeated .tensorflow.FunctionDef.Node node = 2;
// repeated .opencv_tensorflow.FunctionDef.Node node = 2;
inline int FunctionDef::node_size() const {
return node_.size();
}
inline void FunctionDef::clear_node() {
node_.Clear();
}
inline const ::tensorflow::FunctionDef_Node& FunctionDef::node(int index) const {
// @@protoc_insertion_point(field_get:tensorflow.FunctionDef.node)
inline const ::opencv_tensorflow::FunctionDef_Node& FunctionDef::node(int index) const {
// @@protoc_insertion_point(field_get:opencv_tensorflow.FunctionDef.node)
return node_.Get(index);
}
inline ::tensorflow::FunctionDef_Node* FunctionDef::mutable_node(int index) {
// @@protoc_insertion_point(field_mutable:tensorflow.FunctionDef.node)
inline ::opencv_tensorflow::FunctionDef_Node* FunctionDef::mutable_node(int index) {
// @@protoc_insertion_point(field_mutable:opencv_tensorflow.FunctionDef.node)
return node_.Mutable(index);
}
inline ::tensorflow::FunctionDef_Node* FunctionDef::add_node() {
// @@protoc_insertion_point(field_add:tensorflow.FunctionDef.node)
inline ::opencv_tensorflow::FunctionDef_Node* FunctionDef::add_node() {
// @@protoc_insertion_point(field_add:opencv_tensorflow.FunctionDef.node)
return node_.Add();
}
inline ::google::protobuf::RepeatedPtrField< ::tensorflow::FunctionDef_Node >*
inline ::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::FunctionDef_Node >*
FunctionDef::mutable_node() {
// @@protoc_insertion_point(field_mutable_list:tensorflow.FunctionDef.node)
// @@protoc_insertion_point(field_mutable_list:opencv_tensorflow.FunctionDef.node)
return &node_;
}
inline const ::google::protobuf::RepeatedPtrField< ::tensorflow::FunctionDef_Node >&
inline const ::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::FunctionDef_Node >&
FunctionDef::node() const {
// @@protoc_insertion_point(field_list:tensorflow.FunctionDef.node)
// @@protoc_insertion_point(field_list:opencv_tensorflow.FunctionDef.node)
return node_;
}
@ -1219,20 +1219,20 @@ inline void GradientDef::clear_function_name() {
function_name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
inline const ::std::string& GradientDef::function_name() const {
// @@protoc_insertion_point(field_get:tensorflow.GradientDef.function_name)
// @@protoc_insertion_point(field_get:opencv_tensorflow.GradientDef.function_name)
return function_name_.Get();
}
inline void GradientDef::set_function_name(const ::std::string& value) {
function_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
// @@protoc_insertion_point(field_set:tensorflow.GradientDef.function_name)
// @@protoc_insertion_point(field_set:opencv_tensorflow.GradientDef.function_name)
}
#if LANG_CXX11
inline void GradientDef::set_function_name(::std::string&& value) {
function_name_.Set(
&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_rvalue:tensorflow.GradientDef.function_name)
// @@protoc_insertion_point(field_set_rvalue:opencv_tensorflow.GradientDef.function_name)
}
#endif
inline void GradientDef::set_function_name(const char* value) {
@ -1240,22 +1240,22 @@ inline void GradientDef::set_function_name(const char* value) {
function_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_char:tensorflow.GradientDef.function_name)
// @@protoc_insertion_point(field_set_char:opencv_tensorflow.GradientDef.function_name)
}
inline void GradientDef::set_function_name(const char* value,
size_t size) {
function_name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_pointer:tensorflow.GradientDef.function_name)
// @@protoc_insertion_point(field_set_pointer:opencv_tensorflow.GradientDef.function_name)
}
inline ::std::string* GradientDef::mutable_function_name() {
// @@protoc_insertion_point(field_mutable:tensorflow.GradientDef.function_name)
// @@protoc_insertion_point(field_mutable:opencv_tensorflow.GradientDef.function_name)
return function_name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
inline ::std::string* GradientDef::release_function_name() {
// @@protoc_insertion_point(field_release:tensorflow.GradientDef.function_name)
// @@protoc_insertion_point(field_release:opencv_tensorflow.GradientDef.function_name)
return function_name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
@ -1267,10 +1267,10 @@ inline void GradientDef::set_allocated_function_name(::std::string* function_nam
}
function_name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), function_name,
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_allocated:tensorflow.GradientDef.function_name)
// @@protoc_insertion_point(field_set_allocated:opencv_tensorflow.GradientDef.function_name)
}
inline ::std::string* GradientDef::unsafe_arena_release_function_name() {
// @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.GradientDef.function_name)
// @@protoc_insertion_point(field_unsafe_arena_release:opencv_tensorflow.GradientDef.function_name)
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
return function_name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
@ -1286,7 +1286,7 @@ inline void GradientDef::unsafe_arena_set_allocated_function_name(
}
function_name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
function_name, GetArenaNoVirtual());
// @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.GradientDef.function_name)
// @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_tensorflow.GradientDef.function_name)
}
// string gradient_func = 2;
@ -1294,20 +1294,20 @@ inline void GradientDef::clear_gradient_func() {
gradient_func_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
inline const ::std::string& GradientDef::gradient_func() const {
// @@protoc_insertion_point(field_get:tensorflow.GradientDef.gradient_func)
// @@protoc_insertion_point(field_get:opencv_tensorflow.GradientDef.gradient_func)
return gradient_func_.Get();
}
inline void GradientDef::set_gradient_func(const ::std::string& value) {
gradient_func_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
// @@protoc_insertion_point(field_set:tensorflow.GradientDef.gradient_func)
// @@protoc_insertion_point(field_set:opencv_tensorflow.GradientDef.gradient_func)
}
#if LANG_CXX11
inline void GradientDef::set_gradient_func(::std::string&& value) {
gradient_func_.Set(
&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_rvalue:tensorflow.GradientDef.gradient_func)
// @@protoc_insertion_point(field_set_rvalue:opencv_tensorflow.GradientDef.gradient_func)
}
#endif
inline void GradientDef::set_gradient_func(const char* value) {
@ -1315,22 +1315,22 @@ inline void GradientDef::set_gradient_func(const char* value) {
gradient_func_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_char:tensorflow.GradientDef.gradient_func)
// @@protoc_insertion_point(field_set_char:opencv_tensorflow.GradientDef.gradient_func)
}
inline void GradientDef::set_gradient_func(const char* value,
size_t size) {
gradient_func_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_pointer:tensorflow.GradientDef.gradient_func)
// @@protoc_insertion_point(field_set_pointer:opencv_tensorflow.GradientDef.gradient_func)
}
inline ::std::string* GradientDef::mutable_gradient_func() {
// @@protoc_insertion_point(field_mutable:tensorflow.GradientDef.gradient_func)
// @@protoc_insertion_point(field_mutable:opencv_tensorflow.GradientDef.gradient_func)
return gradient_func_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
inline ::std::string* GradientDef::release_gradient_func() {
// @@protoc_insertion_point(field_release:tensorflow.GradientDef.gradient_func)
// @@protoc_insertion_point(field_release:opencv_tensorflow.GradientDef.gradient_func)
return gradient_func_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
@ -1342,10 +1342,10 @@ inline void GradientDef::set_allocated_gradient_func(::std::string* gradient_fun
}
gradient_func_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), gradient_func,
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_allocated:tensorflow.GradientDef.gradient_func)
// @@protoc_insertion_point(field_set_allocated:opencv_tensorflow.GradientDef.gradient_func)
}
inline ::std::string* GradientDef::unsafe_arena_release_gradient_func() {
// @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.GradientDef.gradient_func)
// @@protoc_insertion_point(field_unsafe_arena_release:opencv_tensorflow.GradientDef.gradient_func)
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
return gradient_func_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
@ -1361,7 +1361,7 @@ inline void GradientDef::unsafe_arena_set_allocated_gradient_func(
}
gradient_func_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
gradient_func, GetArenaNoVirtual());
// @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.GradientDef.gradient_func)
// @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_tensorflow.GradientDef.gradient_func)
}
#ifdef __GNUC__
@ -1378,7 +1378,7 @@ inline void GradientDef::unsafe_arena_set_allocated_gradient_func(
// @@protoc_insertion_point(namespace_scope)
} // namespace tensorflow
} // namespace opencv_tensorflow
// @@protoc_insertion_point(global_scope)

View File

@ -19,7 +19,7 @@
#include "third_party/protobuf/version.h"
#endif
// @@protoc_insertion_point(includes)
namespace tensorflow {
namespace opencv_tensorflow {
class GraphDefDefaultTypeInternal {
public:
::google::protobuf::internal::ExplicitlyConstructed<GraphDef>
@ -35,7 +35,7 @@ class NodeDefDefaultTypeInternal {
::google::protobuf::internal::ExplicitlyConstructed<NodeDef>
_instance;
} _NodeDef_default_instance_;
} // namespace tensorflow
} // namespace opencv_tensorflow
namespace protobuf_graph_2eproto {
void InitDefaultsGraphDefImpl() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
@ -49,11 +49,11 @@ void InitDefaultsGraphDefImpl() {
protobuf_versions_2eproto::InitDefaultsVersionDef();
protobuf_function_2eproto::InitDefaultsFunctionDefLibrary();
{
void* ptr = &::tensorflow::_GraphDef_default_instance_;
new (ptr) ::tensorflow::GraphDef();
void* ptr = &::opencv_tensorflow::_GraphDef_default_instance_;
new (ptr) ::opencv_tensorflow::GraphDef();
::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
}
::tensorflow::GraphDef::InitAsDefaultInstance();
::opencv_tensorflow::GraphDef::InitAsDefaultInstance();
}
void InitDefaultsGraphDef() {
@ -71,10 +71,10 @@ void InitDefaultsNodeDef_AttrEntry_DoNotUseImpl() {
#endif // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
protobuf_attr_5fvalue_2eproto::InitDefaultsAttrValue();
{
void* ptr = &::tensorflow::_NodeDef_AttrEntry_DoNotUse_default_instance_;
new (ptr) ::tensorflow::NodeDef_AttrEntry_DoNotUse();
void* ptr = &::opencv_tensorflow::_NodeDef_AttrEntry_DoNotUse_default_instance_;
new (ptr) ::opencv_tensorflow::NodeDef_AttrEntry_DoNotUse();
}
::tensorflow::NodeDef_AttrEntry_DoNotUse::InitAsDefaultInstance();
::opencv_tensorflow::NodeDef_AttrEntry_DoNotUse::InitAsDefaultInstance();
}
void InitDefaultsNodeDef_AttrEntry_DoNotUse() {
@ -92,11 +92,11 @@ void InitDefaultsNodeDefImpl() {
#endif // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
protobuf_graph_2eproto::InitDefaultsNodeDef_AttrEntry_DoNotUse();
{
void* ptr = &::tensorflow::_NodeDef_default_instance_;
new (ptr) ::tensorflow::NodeDef();
void* ptr = &::opencv_tensorflow::_NodeDef_default_instance_;
new (ptr) ::opencv_tensorflow::NodeDef();
::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
}
::tensorflow::NodeDef::InitAsDefaultInstance();
::opencv_tensorflow::NodeDef::InitAsDefaultInstance();
}
void InitDefaultsNodeDef() {
@ -108,44 +108,44 @@ void InitDefaultsNodeDef() {
const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
~0u, // no _has_bits_
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tensorflow::GraphDef, _internal_metadata_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::GraphDef, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tensorflow::GraphDef, node_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tensorflow::GraphDef, versions_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tensorflow::GraphDef, version_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tensorflow::GraphDef, library_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tensorflow::NodeDef_AttrEntry_DoNotUse, _has_bits_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tensorflow::NodeDef_AttrEntry_DoNotUse, _internal_metadata_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::GraphDef, node_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::GraphDef, versions_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::GraphDef, version_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::GraphDef, library_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::NodeDef_AttrEntry_DoNotUse, _has_bits_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::NodeDef_AttrEntry_DoNotUse, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tensorflow::NodeDef_AttrEntry_DoNotUse, key_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tensorflow::NodeDef_AttrEntry_DoNotUse, value_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::NodeDef_AttrEntry_DoNotUse, key_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::NodeDef_AttrEntry_DoNotUse, value_),
0,
1,
~0u, // no _has_bits_
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tensorflow::NodeDef, _internal_metadata_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::NodeDef, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tensorflow::NodeDef, name_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tensorflow::NodeDef, op_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tensorflow::NodeDef, input_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tensorflow::NodeDef, device_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tensorflow::NodeDef, attr_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::NodeDef, name_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::NodeDef, op_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::NodeDef, input_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::NodeDef, device_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::NodeDef, attr_),
};
static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
{ 0, -1, sizeof(::tensorflow::GraphDef)},
{ 9, 16, sizeof(::tensorflow::NodeDef_AttrEntry_DoNotUse)},
{ 18, -1, sizeof(::tensorflow::NodeDef)},
{ 0, -1, sizeof(::opencv_tensorflow::GraphDef)},
{ 9, 16, sizeof(::opencv_tensorflow::NodeDef_AttrEntry_DoNotUse)},
{ 18, -1, sizeof(::opencv_tensorflow::NodeDef)},
};
static ::google::protobuf::Message const * const file_default_instances[] = {
reinterpret_cast<const ::google::protobuf::Message*>(&::tensorflow::_GraphDef_default_instance_),
reinterpret_cast<const ::google::protobuf::Message*>(&::tensorflow::_NodeDef_AttrEntry_DoNotUse_default_instance_),
reinterpret_cast<const ::google::protobuf::Message*>(&::tensorflow::_NodeDef_default_instance_),
reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_tensorflow::_GraphDef_default_instance_),
reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_tensorflow::_NodeDef_AttrEntry_DoNotUse_default_instance_),
reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_tensorflow::_NodeDef_default_instance_),
};
void protobuf_AssignDescriptors() {
@ -170,21 +170,22 @@ void protobuf_RegisterTypes(const ::std::string&) {
void AddDescriptorsImpl() {
InitDefaults();
static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
"\n\013graph.proto\022\ntensorflow\032\020attr_value.pr"
"oto\032\016function.proto\032\016versions.proto\"\235\001\n\010"
"GraphDef\022!\n\004node\030\001 \003(\0132\023.tensorflow.Node"
"Def\022(\n\010versions\030\004 \001(\0132\026.tensorflow.Versi"
"onDef\022\023\n\007version\030\003 \001(\005B\002\030\001\022/\n\007library\030\002 "
"\001(\0132\036.tensorflow.FunctionDefLibrary\"\263\001\n\007"
"NodeDef\022\014\n\004name\030\001 \001(\t\022\n\n\002op\030\002 \001(\t\022\r\n\005inp"
"ut\030\003 \003(\t\022\016\n\006device\030\004 \001(\t\022+\n\004attr\030\005 \003(\0132\035"
".tensorflow.NodeDef.AttrEntry\032B\n\tAttrEnt"
"ry\022\013\n\003key\030\001 \001(\t\022$\n\005value\030\002 \001(\0132\025.tensorf"
"low.AttrValue:\0028\001B,\n\030org.tensorflow.fram"
"eworkB\013GraphProtosP\001\370\001\001b\006proto3"
"\n\013graph.proto\022\021opencv_tensorflow\032\020attr_v"
"alue.proto\032\016function.proto\032\016versions.pro"
"to\"\262\001\n\010GraphDef\022(\n\004node\030\001 \003(\0132\032.opencv_t"
"ensorflow.NodeDef\022/\n\010versions\030\004 \001(\0132\035.op"
"encv_tensorflow.VersionDef\022\023\n\007version\030\003 "
"\001(\005B\002\030\001\0226\n\007library\030\002 \001(\0132%.opencv_tensor"
"flow.FunctionDefLibrary\"\301\001\n\007NodeDef\022\014\n\004n"
"ame\030\001 \001(\t\022\n\n\002op\030\002 \001(\t\022\r\n\005input\030\003 \003(\t\022\016\n\006"
"device\030\004 \001(\t\0222\n\004attr\030\005 \003(\0132$.opencv_tens"
"orflow.NodeDef.AttrEntry\032I\n\tAttrEntry\022\013\n"
"\003key\030\001 \001(\t\022+\n\005value\030\002 \001(\0132\034.opencv_tenso"
"rflow.AttrValue:\0028\001B,\n\030org.tensorflow.fr"
"ameworkB\013GraphProtosP\001\370\001\001b\006proto3"
};
::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
descriptor, 471);
descriptor, 513);
::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
"graph.proto", &protobuf_RegisterTypes);
::protobuf_attr_5fvalue_2eproto::AddDescriptors();
@ -203,22 +204,22 @@ struct StaticDescriptorInitializer {
}
} static_descriptor_initializer;
} // namespace protobuf_graph_2eproto
namespace tensorflow {
namespace opencv_tensorflow {
// ===================================================================
void GraphDef::InitAsDefaultInstance() {
::tensorflow::_GraphDef_default_instance_._instance.get_mutable()->versions_ = const_cast< ::tensorflow::VersionDef*>(
::tensorflow::VersionDef::internal_default_instance());
::tensorflow::_GraphDef_default_instance_._instance.get_mutable()->library_ = const_cast< ::tensorflow::FunctionDefLibrary*>(
::tensorflow::FunctionDefLibrary::internal_default_instance());
::opencv_tensorflow::_GraphDef_default_instance_._instance.get_mutable()->versions_ = const_cast< ::opencv_tensorflow::VersionDef*>(
::opencv_tensorflow::VersionDef::internal_default_instance());
::opencv_tensorflow::_GraphDef_default_instance_._instance.get_mutable()->library_ = const_cast< ::opencv_tensorflow::FunctionDefLibrary*>(
::opencv_tensorflow::FunctionDefLibrary::internal_default_instance());
}
void GraphDef::_slow_mutable_versions() {
versions_ = ::google::protobuf::Arena::CreateMessage< ::tensorflow::VersionDef >(
versions_ = ::google::protobuf::Arena::CreateMessage< ::opencv_tensorflow::VersionDef >(
GetArenaNoVirtual());
}
void GraphDef::unsafe_arena_set_allocated_versions(
::tensorflow::VersionDef* versions) {
::opencv_tensorflow::VersionDef* versions) {
if (GetArenaNoVirtual() == NULL) {
delete versions_;
}
@ -228,7 +229,7 @@ void GraphDef::unsafe_arena_set_allocated_versions(
} else {
}
// @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.GraphDef.versions)
// @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_tensorflow.GraphDef.versions)
}
void GraphDef::clear_versions() {
if (GetArenaNoVirtual() == NULL && versions_ != NULL) {
@ -237,11 +238,11 @@ void GraphDef::clear_versions() {
versions_ = NULL;
}
void GraphDef::_slow_mutable_library() {
library_ = ::google::protobuf::Arena::CreateMessage< ::tensorflow::FunctionDefLibrary >(
library_ = ::google::protobuf::Arena::CreateMessage< ::opencv_tensorflow::FunctionDefLibrary >(
GetArenaNoVirtual());
}
void GraphDef::unsafe_arena_set_allocated_library(
::tensorflow::FunctionDefLibrary* library) {
::opencv_tensorflow::FunctionDefLibrary* library) {
if (GetArenaNoVirtual() == NULL) {
delete library_;
}
@ -251,7 +252,7 @@ void GraphDef::unsafe_arena_set_allocated_library(
} else {
}
// @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.GraphDef.library)
// @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_tensorflow.GraphDef.library)
}
void GraphDef::clear_library() {
if (GetArenaNoVirtual() == NULL && library_ != NULL) {
@ -272,7 +273,7 @@ GraphDef::GraphDef()
::protobuf_graph_2eproto::InitDefaultsGraphDef();
}
SharedCtor();
// @@protoc_insertion_point(constructor:tensorflow.GraphDef)
// @@protoc_insertion_point(constructor:opencv_tensorflow.GraphDef)
}
GraphDef::GraphDef(::google::protobuf::Arena* arena)
: ::google::protobuf::Message(),
@ -281,7 +282,7 @@ GraphDef::GraphDef(::google::protobuf::Arena* arena)
::protobuf_graph_2eproto::InitDefaultsGraphDef();
SharedCtor();
RegisterArenaDtor(arena);
// @@protoc_insertion_point(arena_constructor:tensorflow.GraphDef)
// @@protoc_insertion_point(arena_constructor:opencv_tensorflow.GraphDef)
}
GraphDef::GraphDef(const GraphDef& from)
: ::google::protobuf::Message(),
@ -290,17 +291,17 @@ GraphDef::GraphDef(const GraphDef& from)
_cached_size_(0) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
if (from.has_library()) {
library_ = new ::tensorflow::FunctionDefLibrary(*from.library_);
library_ = new ::opencv_tensorflow::FunctionDefLibrary(*from.library_);
} else {
library_ = NULL;
}
if (from.has_versions()) {
versions_ = new ::tensorflow::VersionDef(*from.versions_);
versions_ = new ::opencv_tensorflow::VersionDef(*from.versions_);
} else {
versions_ = NULL;
}
version_ = from.version_;
// @@protoc_insertion_point(copy_constructor:tensorflow.GraphDef)
// @@protoc_insertion_point(copy_constructor:opencv_tensorflow.GraphDef)
}
void GraphDef::SharedCtor() {
@ -311,7 +312,7 @@ void GraphDef::SharedCtor() {
}
GraphDef::~GraphDef() {
// @@protoc_insertion_point(destructor:tensorflow.GraphDef)
// @@protoc_insertion_point(destructor:opencv_tensorflow.GraphDef)
SharedDtor();
}
@ -347,7 +348,7 @@ GraphDef* GraphDef::New(::google::protobuf::Arena* arena) const {
}
void GraphDef::Clear() {
// @@protoc_insertion_point(message_clear_start:tensorflow.GraphDef)
// @@protoc_insertion_point(message_clear_start:opencv_tensorflow.GraphDef)
::google::protobuf::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
@ -369,13 +370,13 @@ bool GraphDef::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
::google::protobuf::uint32 tag;
// @@protoc_insertion_point(parse_start:tensorflow.GraphDef)
// @@protoc_insertion_point(parse_start:opencv_tensorflow.GraphDef)
for (;;) {
::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
tag = p.first;
if (!p.second) goto handle_unusual;
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// repeated .tensorflow.NodeDef node = 1;
// repeated .opencv_tensorflow.NodeDef node = 1;
case 1: {
if (static_cast< ::google::protobuf::uint8>(tag) ==
static_cast< ::google::protobuf::uint8>(10u /* 10 & 0xFF */)) {
@ -386,7 +387,7 @@ bool GraphDef::MergePartialFromCodedStream(
break;
}
// .tensorflow.FunctionDefLibrary library = 2;
// .opencv_tensorflow.FunctionDefLibrary library = 2;
case 2: {
if (static_cast< ::google::protobuf::uint8>(tag) ==
static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
@ -412,7 +413,7 @@ bool GraphDef::MergePartialFromCodedStream(
break;
}
// .tensorflow.VersionDef versions = 4;
// .opencv_tensorflow.VersionDef versions = 4;
case 4: {
if (static_cast< ::google::protobuf::uint8>(tag) ==
static_cast< ::google::protobuf::uint8>(34u /* 34 & 0xFF */)) {
@ -436,28 +437,28 @@ bool GraphDef::MergePartialFromCodedStream(
}
}
success:
// @@protoc_insertion_point(parse_success:tensorflow.GraphDef)
// @@protoc_insertion_point(parse_success:opencv_tensorflow.GraphDef)
return true;
failure:
// @@protoc_insertion_point(parse_failure:tensorflow.GraphDef)
// @@protoc_insertion_point(parse_failure:opencv_tensorflow.GraphDef)
return false;
#undef DO_
}
void GraphDef::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// @@protoc_insertion_point(serialize_start:tensorflow.GraphDef)
// @@protoc_insertion_point(serialize_start:opencv_tensorflow.GraphDef)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// repeated .tensorflow.NodeDef node = 1;
// repeated .opencv_tensorflow.NodeDef node = 1;
for (unsigned int i = 0,
n = static_cast<unsigned int>(this->node_size()); i < n; i++) {
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
1, this->node(static_cast<int>(i)), output);
}
// .tensorflow.FunctionDefLibrary library = 2;
// .opencv_tensorflow.FunctionDefLibrary library = 2;
if (this->has_library()) {
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
2, *this->library_, output);
@ -468,7 +469,7 @@ void GraphDef::SerializeWithCachedSizes(
::google::protobuf::internal::WireFormatLite::WriteInt32(3, this->version(), output);
}
// .tensorflow.VersionDef versions = 4;
// .opencv_tensorflow.VersionDef versions = 4;
if (this->has_versions()) {
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
4, *this->versions_, output);
@ -478,17 +479,17 @@ void GraphDef::SerializeWithCachedSizes(
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
(::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output);
}
// @@protoc_insertion_point(serialize_end:tensorflow.GraphDef)
// @@protoc_insertion_point(serialize_end:opencv_tensorflow.GraphDef)
}
::google::protobuf::uint8* GraphDef::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
(void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:tensorflow.GraphDef)
// @@protoc_insertion_point(serialize_to_array_start:opencv_tensorflow.GraphDef)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// repeated .tensorflow.NodeDef node = 1;
// repeated .opencv_tensorflow.NodeDef node = 1;
for (unsigned int i = 0,
n = static_cast<unsigned int>(this->node_size()); i < n; i++) {
target = ::google::protobuf::internal::WireFormatLite::
@ -496,7 +497,7 @@ void GraphDef::SerializeWithCachedSizes(
1, this->node(static_cast<int>(i)), deterministic, target);
}
// .tensorflow.FunctionDefLibrary library = 2;
// .opencv_tensorflow.FunctionDefLibrary library = 2;
if (this->has_library()) {
target = ::google::protobuf::internal::WireFormatLite::
InternalWriteMessageToArray(
@ -508,7 +509,7 @@ void GraphDef::SerializeWithCachedSizes(
target = ::google::protobuf::internal::WireFormatLite::WriteInt32ToArray(3, this->version(), target);
}
// .tensorflow.VersionDef versions = 4;
// .opencv_tensorflow.VersionDef versions = 4;
if (this->has_versions()) {
target = ::google::protobuf::internal::WireFormatLite::
InternalWriteMessageToArray(
@ -519,12 +520,12 @@ void GraphDef::SerializeWithCachedSizes(
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
(::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target);
}
// @@protoc_insertion_point(serialize_to_array_end:tensorflow.GraphDef)
// @@protoc_insertion_point(serialize_to_array_end:opencv_tensorflow.GraphDef)
return target;
}
size_t GraphDef::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:tensorflow.GraphDef)
// @@protoc_insertion_point(message_byte_size_start:opencv_tensorflow.GraphDef)
size_t total_size = 0;
if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
@ -532,7 +533,7 @@ size_t GraphDef::ByteSizeLong() const {
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
(::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()));
}
// repeated .tensorflow.NodeDef node = 1;
// repeated .opencv_tensorflow.NodeDef node = 1;
{
unsigned int count = static_cast<unsigned int>(this->node_size());
total_size += 1UL * count;
@ -543,14 +544,14 @@ size_t GraphDef::ByteSizeLong() const {
}
}
// .tensorflow.FunctionDefLibrary library = 2;
// .opencv_tensorflow.FunctionDefLibrary library = 2;
if (this->has_library()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::MessageSize(
*this->library_);
}
// .tensorflow.VersionDef versions = 4;
// .opencv_tensorflow.VersionDef versions = 4;
if (this->has_versions()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::MessageSize(
@ -572,22 +573,22 @@ size_t GraphDef::ByteSizeLong() const {
}
void GraphDef::MergeFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:tensorflow.GraphDef)
// @@protoc_insertion_point(generalized_merge_from_start:opencv_tensorflow.GraphDef)
GOOGLE_DCHECK_NE(&from, this);
const GraphDef* source =
::google::protobuf::internal::DynamicCastToGenerated<const GraphDef>(
&from);
if (source == NULL) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:tensorflow.GraphDef)
// @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_tensorflow.GraphDef)
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:tensorflow.GraphDef)
// @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_tensorflow.GraphDef)
MergeFrom(*source);
}
}
void GraphDef::MergeFrom(const GraphDef& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.GraphDef)
// @@protoc_insertion_point(class_specific_merge_from_start:opencv_tensorflow.GraphDef)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::google::protobuf::uint32 cached_has_bits = 0;
@ -595,10 +596,10 @@ void GraphDef::MergeFrom(const GraphDef& from) {
node_.MergeFrom(from.node_);
if (from.has_library()) {
mutable_library()->::tensorflow::FunctionDefLibrary::MergeFrom(from.library());
mutable_library()->::opencv_tensorflow::FunctionDefLibrary::MergeFrom(from.library());
}
if (from.has_versions()) {
mutable_versions()->::tensorflow::VersionDef::MergeFrom(from.versions());
mutable_versions()->::opencv_tensorflow::VersionDef::MergeFrom(from.versions());
}
if (from.version() != 0) {
set_version(from.version());
@ -606,14 +607,14 @@ void GraphDef::MergeFrom(const GraphDef& from) {
}
void GraphDef::CopyFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:tensorflow.GraphDef)
// @@protoc_insertion_point(generalized_copy_from_start:opencv_tensorflow.GraphDef)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void GraphDef::CopyFrom(const GraphDef& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.GraphDef)
// @@protoc_insertion_point(class_specific_copy_from_start:opencv_tensorflow.GraphDef)
if (&from == this) return;
Clear();
MergeFrom(from);
@ -696,7 +697,7 @@ NodeDef::NodeDef()
::protobuf_graph_2eproto::InitDefaultsNodeDef();
}
SharedCtor();
// @@protoc_insertion_point(constructor:tensorflow.NodeDef)
// @@protoc_insertion_point(constructor:opencv_tensorflow.NodeDef)
}
NodeDef::NodeDef(::google::protobuf::Arena* arena)
: ::google::protobuf::Message(),
@ -706,7 +707,7 @@ NodeDef::NodeDef(::google::protobuf::Arena* arena)
::protobuf_graph_2eproto::InitDefaultsNodeDef();
SharedCtor();
RegisterArenaDtor(arena);
// @@protoc_insertion_point(arena_constructor:tensorflow.NodeDef)
// @@protoc_insertion_point(arena_constructor:opencv_tensorflow.NodeDef)
}
NodeDef::NodeDef(const NodeDef& from)
: ::google::protobuf::Message(),
@ -730,7 +731,7 @@ NodeDef::NodeDef(const NodeDef& from)
device_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), from.device(),
GetArenaNoVirtual());
}
// @@protoc_insertion_point(copy_constructor:tensorflow.NodeDef)
// @@protoc_insertion_point(copy_constructor:opencv_tensorflow.NodeDef)
}
void NodeDef::SharedCtor() {
@ -741,7 +742,7 @@ void NodeDef::SharedCtor() {
}
NodeDef::~NodeDef() {
// @@protoc_insertion_point(destructor:tensorflow.NodeDef)
// @@protoc_insertion_point(destructor:opencv_tensorflow.NodeDef)
SharedDtor();
}
@ -778,7 +779,7 @@ NodeDef* NodeDef::New(::google::protobuf::Arena* arena) const {
}
void NodeDef::Clear() {
// @@protoc_insertion_point(message_clear_start:tensorflow.NodeDef)
// @@protoc_insertion_point(message_clear_start:opencv_tensorflow.NodeDef)
::google::protobuf::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
@ -795,7 +796,7 @@ bool NodeDef::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
::google::protobuf::uint32 tag;
// @@protoc_insertion_point(parse_start:tensorflow.NodeDef)
// @@protoc_insertion_point(parse_start:opencv_tensorflow.NodeDef)
for (;;) {
::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
tag = p.first;
@ -810,7 +811,7 @@ bool NodeDef::MergePartialFromCodedStream(
DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
this->name().data(), static_cast<int>(this->name().length()),
::google::protobuf::internal::WireFormatLite::PARSE,
"tensorflow.NodeDef.name"));
"opencv_tensorflow.NodeDef.name"));
} else {
goto handle_unusual;
}
@ -826,7 +827,7 @@ bool NodeDef::MergePartialFromCodedStream(
DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
this->op().data(), static_cast<int>(this->op().length()),
::google::protobuf::internal::WireFormatLite::PARSE,
"tensorflow.NodeDef.op"));
"opencv_tensorflow.NodeDef.op"));
} else {
goto handle_unusual;
}
@ -843,7 +844,7 @@ bool NodeDef::MergePartialFromCodedStream(
this->input(this->input_size() - 1).data(),
static_cast<int>(this->input(this->input_size() - 1).length()),
::google::protobuf::internal::WireFormatLite::PARSE,
"tensorflow.NodeDef.input"));
"opencv_tensorflow.NodeDef.input"));
} else {
goto handle_unusual;
}
@ -859,30 +860,30 @@ bool NodeDef::MergePartialFromCodedStream(
DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
this->device().data(), static_cast<int>(this->device().length()),
::google::protobuf::internal::WireFormatLite::PARSE,
"tensorflow.NodeDef.device"));
"opencv_tensorflow.NodeDef.device"));
} else {
goto handle_unusual;
}
break;
}
// map<string, .tensorflow.AttrValue> attr = 5;
// map<string, .opencv_tensorflow.AttrValue> attr = 5;
case 5: {
if (static_cast< ::google::protobuf::uint8>(tag) ==
static_cast< ::google::protobuf::uint8>(42u /* 42 & 0xFF */)) {
NodeDef_AttrEntry_DoNotUse::Parser< ::google::protobuf::internal::MapField<
NodeDef_AttrEntry_DoNotUse,
::std::string, ::tensorflow::AttrValue,
::std::string, ::opencv_tensorflow::AttrValue,
::google::protobuf::internal::WireFormatLite::TYPE_STRING,
::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE,
0 >,
::google::protobuf::Map< ::std::string, ::tensorflow::AttrValue > > parser(&attr_);
::google::protobuf::Map< ::std::string, ::opencv_tensorflow::AttrValue > > parser(&attr_);
DO_(::google::protobuf::internal::WireFormatLite::ReadMessageNoVirtual(
input, &parser));
DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
parser.key().data(), static_cast<int>(parser.key().length()),
::google::protobuf::internal::WireFormatLite::PARSE,
"tensorflow.NodeDef.AttrEntry.key"));
"opencv_tensorflow.NodeDef.AttrEntry.key"));
} else {
goto handle_unusual;
}
@ -901,17 +902,17 @@ bool NodeDef::MergePartialFromCodedStream(
}
}
success:
// @@protoc_insertion_point(parse_success:tensorflow.NodeDef)
// @@protoc_insertion_point(parse_success:opencv_tensorflow.NodeDef)
return true;
failure:
// @@protoc_insertion_point(parse_failure:tensorflow.NodeDef)
// @@protoc_insertion_point(parse_failure:opencv_tensorflow.NodeDef)
return false;
#undef DO_
}
void NodeDef::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// @@protoc_insertion_point(serialize_start:tensorflow.NodeDef)
// @@protoc_insertion_point(serialize_start:opencv_tensorflow.NodeDef)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
@ -920,7 +921,7 @@ void NodeDef::SerializeWithCachedSizes(
::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
this->name().data(), static_cast<int>(this->name().length()),
::google::protobuf::internal::WireFormatLite::SERIALIZE,
"tensorflow.NodeDef.name");
"opencv_tensorflow.NodeDef.name");
::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
1, this->name(), output);
}
@ -930,7 +931,7 @@ void NodeDef::SerializeWithCachedSizes(
::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
this->op().data(), static_cast<int>(this->op().length()),
::google::protobuf::internal::WireFormatLite::SERIALIZE,
"tensorflow.NodeDef.op");
"opencv_tensorflow.NodeDef.op");
::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
2, this->op(), output);
}
@ -940,7 +941,7 @@ void NodeDef::SerializeWithCachedSizes(
::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
this->input(i).data(), static_cast<int>(this->input(i).length()),
::google::protobuf::internal::WireFormatLite::SERIALIZE,
"tensorflow.NodeDef.input");
"opencv_tensorflow.NodeDef.input");
::google::protobuf::internal::WireFormatLite::WriteString(
3, this->input(i), output);
}
@ -950,14 +951,14 @@ void NodeDef::SerializeWithCachedSizes(
::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
this->device().data(), static_cast<int>(this->device().length()),
::google::protobuf::internal::WireFormatLite::SERIALIZE,
"tensorflow.NodeDef.device");
"opencv_tensorflow.NodeDef.device");
::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
4, this->device(), output);
}
// map<string, .tensorflow.AttrValue> attr = 5;
// map<string, .opencv_tensorflow.AttrValue> attr = 5;
if (!this->attr().empty()) {
typedef ::google::protobuf::Map< ::std::string, ::tensorflow::AttrValue >::const_pointer
typedef ::google::protobuf::Map< ::std::string, ::opencv_tensorflow::AttrValue >::const_pointer
ConstPtr;
typedef ConstPtr SortItem;
typedef ::google::protobuf::internal::CompareByDerefFirst<SortItem> Less;
@ -966,7 +967,7 @@ void NodeDef::SerializeWithCachedSizes(
::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
p->first.data(), static_cast<int>(p->first.length()),
::google::protobuf::internal::WireFormatLite::SERIALIZE,
"tensorflow.NodeDef.AttrEntry.key");
"opencv_tensorflow.NodeDef.AttrEntry.key");
}
};
@ -974,9 +975,9 @@ void NodeDef::SerializeWithCachedSizes(
this->attr().size() > 1) {
::google::protobuf::scoped_array<SortItem> items(
new SortItem[this->attr().size()]);
typedef ::google::protobuf::Map< ::std::string, ::tensorflow::AttrValue >::size_type size_type;
typedef ::google::protobuf::Map< ::std::string, ::opencv_tensorflow::AttrValue >::size_type size_type;
size_type n = 0;
for (::google::protobuf::Map< ::std::string, ::tensorflow::AttrValue >::const_iterator
for (::google::protobuf::Map< ::std::string, ::opencv_tensorflow::AttrValue >::const_iterator
it = this->attr().begin();
it != this->attr().end(); ++it, ++n) {
items[static_cast<ptrdiff_t>(n)] = SortItem(&*it);
@ -995,7 +996,7 @@ void NodeDef::SerializeWithCachedSizes(
}
} else {
::google::protobuf::scoped_ptr<NodeDef_AttrEntry_DoNotUse> entry;
for (::google::protobuf::Map< ::std::string, ::tensorflow::AttrValue >::const_iterator
for (::google::protobuf::Map< ::std::string, ::opencv_tensorflow::AttrValue >::const_iterator
it = this->attr().begin();
it != this->attr().end(); ++it) {
entry.reset(attr_.NewEntryWrapper(
@ -1014,13 +1015,13 @@ void NodeDef::SerializeWithCachedSizes(
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
(::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output);
}
// @@protoc_insertion_point(serialize_end:tensorflow.NodeDef)
// @@protoc_insertion_point(serialize_end:opencv_tensorflow.NodeDef)
}
::google::protobuf::uint8* NodeDef::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
(void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:tensorflow.NodeDef)
// @@protoc_insertion_point(serialize_to_array_start:opencv_tensorflow.NodeDef)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
@ -1029,7 +1030,7 @@ void NodeDef::SerializeWithCachedSizes(
::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
this->name().data(), static_cast<int>(this->name().length()),
::google::protobuf::internal::WireFormatLite::SERIALIZE,
"tensorflow.NodeDef.name");
"opencv_tensorflow.NodeDef.name");
target =
::google::protobuf::internal::WireFormatLite::WriteStringToArray(
1, this->name(), target);
@ -1040,7 +1041,7 @@ void NodeDef::SerializeWithCachedSizes(
::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
this->op().data(), static_cast<int>(this->op().length()),
::google::protobuf::internal::WireFormatLite::SERIALIZE,
"tensorflow.NodeDef.op");
"opencv_tensorflow.NodeDef.op");
target =
::google::protobuf::internal::WireFormatLite::WriteStringToArray(
2, this->op(), target);
@ -1051,7 +1052,7 @@ void NodeDef::SerializeWithCachedSizes(
::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
this->input(i).data(), static_cast<int>(this->input(i).length()),
::google::protobuf::internal::WireFormatLite::SERIALIZE,
"tensorflow.NodeDef.input");
"opencv_tensorflow.NodeDef.input");
target = ::google::protobuf::internal::WireFormatLite::
WriteStringToArray(3, this->input(i), target);
}
@ -1061,15 +1062,15 @@ void NodeDef::SerializeWithCachedSizes(
::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
this->device().data(), static_cast<int>(this->device().length()),
::google::protobuf::internal::WireFormatLite::SERIALIZE,
"tensorflow.NodeDef.device");
"opencv_tensorflow.NodeDef.device");
target =
::google::protobuf::internal::WireFormatLite::WriteStringToArray(
4, this->device(), target);
}
// map<string, .tensorflow.AttrValue> attr = 5;
// map<string, .opencv_tensorflow.AttrValue> attr = 5;
if (!this->attr().empty()) {
typedef ::google::protobuf::Map< ::std::string, ::tensorflow::AttrValue >::const_pointer
typedef ::google::protobuf::Map< ::std::string, ::opencv_tensorflow::AttrValue >::const_pointer
ConstPtr;
typedef ConstPtr SortItem;
typedef ::google::protobuf::internal::CompareByDerefFirst<SortItem> Less;
@ -1078,7 +1079,7 @@ void NodeDef::SerializeWithCachedSizes(
::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
p->first.data(), static_cast<int>(p->first.length()),
::google::protobuf::internal::WireFormatLite::SERIALIZE,
"tensorflow.NodeDef.AttrEntry.key");
"opencv_tensorflow.NodeDef.AttrEntry.key");
}
};
@ -1086,9 +1087,9 @@ void NodeDef::SerializeWithCachedSizes(
this->attr().size() > 1) {
::google::protobuf::scoped_array<SortItem> items(
new SortItem[this->attr().size()]);
typedef ::google::protobuf::Map< ::std::string, ::tensorflow::AttrValue >::size_type size_type;
typedef ::google::protobuf::Map< ::std::string, ::opencv_tensorflow::AttrValue >::size_type size_type;
size_type n = 0;
for (::google::protobuf::Map< ::std::string, ::tensorflow::AttrValue >::const_iterator
for (::google::protobuf::Map< ::std::string, ::opencv_tensorflow::AttrValue >::const_iterator
it = this->attr().begin();
it != this->attr().end(); ++it, ++n) {
items[static_cast<ptrdiff_t>(n)] = SortItem(&*it);
@ -1109,7 +1110,7 @@ void NodeDef::SerializeWithCachedSizes(
}
} else {
::google::protobuf::scoped_ptr<NodeDef_AttrEntry_DoNotUse> entry;
for (::google::protobuf::Map< ::std::string, ::tensorflow::AttrValue >::const_iterator
for (::google::protobuf::Map< ::std::string, ::opencv_tensorflow::AttrValue >::const_iterator
it = this->attr().begin();
it != this->attr().end(); ++it) {
entry.reset(attr_.NewEntryWrapper(
@ -1130,12 +1131,12 @@ void NodeDef::SerializeWithCachedSizes(
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
(::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target);
}
// @@protoc_insertion_point(serialize_to_array_end:tensorflow.NodeDef)
// @@protoc_insertion_point(serialize_to_array_end:opencv_tensorflow.NodeDef)
return target;
}
size_t NodeDef::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:tensorflow.NodeDef)
// @@protoc_insertion_point(message_byte_size_start:opencv_tensorflow.NodeDef)
size_t total_size = 0;
if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
@ -1151,12 +1152,12 @@ size_t NodeDef::ByteSizeLong() const {
this->input(i));
}
// map<string, .tensorflow.AttrValue> attr = 5;
// map<string, .opencv_tensorflow.AttrValue> attr = 5;
total_size += 1 *
::google::protobuf::internal::FromIntSize(this->attr_size());
{
::google::protobuf::scoped_ptr<NodeDef_AttrEntry_DoNotUse> entry;
for (::google::protobuf::Map< ::std::string, ::tensorflow::AttrValue >::const_iterator
for (::google::protobuf::Map< ::std::string, ::opencv_tensorflow::AttrValue >::const_iterator
it = this->attr().begin();
it != this->attr().end(); ++it) {
if (entry.get() != NULL && entry->GetArena() != NULL) {
@ -1200,22 +1201,22 @@ size_t NodeDef::ByteSizeLong() const {
}
void NodeDef::MergeFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:tensorflow.NodeDef)
// @@protoc_insertion_point(generalized_merge_from_start:opencv_tensorflow.NodeDef)
GOOGLE_DCHECK_NE(&from, this);
const NodeDef* source =
::google::protobuf::internal::DynamicCastToGenerated<const NodeDef>(
&from);
if (source == NULL) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:tensorflow.NodeDef)
// @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_tensorflow.NodeDef)
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:tensorflow.NodeDef)
// @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_tensorflow.NodeDef)
MergeFrom(*source);
}
}
void NodeDef::MergeFrom(const NodeDef& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.NodeDef)
// @@protoc_insertion_point(class_specific_merge_from_start:opencv_tensorflow.NodeDef)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::google::protobuf::uint32 cached_has_bits = 0;
@ -1235,14 +1236,14 @@ void NodeDef::MergeFrom(const NodeDef& from) {
}
void NodeDef::CopyFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:tensorflow.NodeDef)
// @@protoc_insertion_point(generalized_copy_from_start:opencv_tensorflow.NodeDef)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void NodeDef::CopyFrom(const NodeDef& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.NodeDef)
// @@protoc_insertion_point(class_specific_copy_from_start:opencv_tensorflow.NodeDef)
if (&from == this) return;
Clear();
MergeFrom(from);
@ -1289,6 +1290,6 @@ void NodeDef::InternalSwap(NodeDef* other) {
// @@protoc_insertion_point(namespace_scope)
} // namespace tensorflow
} // namespace opencv_tensorflow
// @@protoc_insertion_point(global_scope)

View File

@ -60,7 +60,7 @@ inline void InitDefaults() {
InitDefaultsNodeDef();
}
} // namespace protobuf_graph_2eproto
namespace tensorflow {
namespace opencv_tensorflow {
class GraphDef;
class GraphDefDefaultTypeInternal;
extern GraphDefDefaultTypeInternal _GraphDef_default_instance_;
@ -70,12 +70,12 @@ extern NodeDefDefaultTypeInternal _NodeDef_default_instance_;
class NodeDef_AttrEntry_DoNotUse;
class NodeDef_AttrEntry_DoNotUseDefaultTypeInternal;
extern NodeDef_AttrEntry_DoNotUseDefaultTypeInternal _NodeDef_AttrEntry_DoNotUse_default_instance_;
} // namespace tensorflow
namespace tensorflow {
} // namespace opencv_tensorflow
namespace opencv_tensorflow {
// ===================================================================
class GraphDef : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:tensorflow.GraphDef) */ {
class GraphDef : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_tensorflow.GraphDef) */ {
public:
GraphDef();
virtual ~GraphDef();
@ -169,47 +169,47 @@ class GraphDef : public ::google::protobuf::Message /* @@protoc_insertion_point(
// accessors -------------------------------------------------------
// repeated .tensorflow.NodeDef node = 1;
// repeated .opencv_tensorflow.NodeDef node = 1;
int node_size() const;
void clear_node();
static const int kNodeFieldNumber = 1;
const ::tensorflow::NodeDef& node(int index) const;
::tensorflow::NodeDef* mutable_node(int index);
::tensorflow::NodeDef* add_node();
::google::protobuf::RepeatedPtrField< ::tensorflow::NodeDef >*
const ::opencv_tensorflow::NodeDef& node(int index) const;
::opencv_tensorflow::NodeDef* mutable_node(int index);
::opencv_tensorflow::NodeDef* add_node();
::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::NodeDef >*
mutable_node();
const ::google::protobuf::RepeatedPtrField< ::tensorflow::NodeDef >&
const ::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::NodeDef >&
node() const;
// .tensorflow.FunctionDefLibrary library = 2;
// .opencv_tensorflow.FunctionDefLibrary library = 2;
bool has_library() const;
void clear_library();
static const int kLibraryFieldNumber = 2;
private:
void _slow_mutable_library();
public:
const ::tensorflow::FunctionDefLibrary& library() const;
::tensorflow::FunctionDefLibrary* release_library();
::tensorflow::FunctionDefLibrary* mutable_library();
void set_allocated_library(::tensorflow::FunctionDefLibrary* library);
const ::opencv_tensorflow::FunctionDefLibrary& library() const;
::opencv_tensorflow::FunctionDefLibrary* release_library();
::opencv_tensorflow::FunctionDefLibrary* mutable_library();
void set_allocated_library(::opencv_tensorflow::FunctionDefLibrary* library);
void unsafe_arena_set_allocated_library(
::tensorflow::FunctionDefLibrary* library);
::tensorflow::FunctionDefLibrary* unsafe_arena_release_library();
::opencv_tensorflow::FunctionDefLibrary* library);
::opencv_tensorflow::FunctionDefLibrary* unsafe_arena_release_library();
// .tensorflow.VersionDef versions = 4;
// .opencv_tensorflow.VersionDef versions = 4;
bool has_versions() const;
void clear_versions();
static const int kVersionsFieldNumber = 4;
private:
void _slow_mutable_versions();
public:
const ::tensorflow::VersionDef& versions() const;
::tensorflow::VersionDef* release_versions();
::tensorflow::VersionDef* mutable_versions();
void set_allocated_versions(::tensorflow::VersionDef* versions);
const ::opencv_tensorflow::VersionDef& versions() const;
::opencv_tensorflow::VersionDef* release_versions();
::opencv_tensorflow::VersionDef* mutable_versions();
void set_allocated_versions(::opencv_tensorflow::VersionDef* versions);
void unsafe_arena_set_allocated_versions(
::tensorflow::VersionDef* versions);
::tensorflow::VersionDef* unsafe_arena_release_versions();
::opencv_tensorflow::VersionDef* versions);
::opencv_tensorflow::VersionDef* unsafe_arena_release_versions();
// int32 version = 3 [deprecated = true];
GOOGLE_PROTOBUF_DEPRECATED_ATTR void clear_version();
@ -217,16 +217,16 @@ class GraphDef : public ::google::protobuf::Message /* @@protoc_insertion_point(
GOOGLE_PROTOBUF_DEPRECATED_ATTR ::google::protobuf::int32 version() const;
GOOGLE_PROTOBUF_DEPRECATED_ATTR void set_version(::google::protobuf::int32 value);
// @@protoc_insertion_point(class_scope:tensorflow.GraphDef)
// @@protoc_insertion_point(class_scope:opencv_tensorflow.GraphDef)
private:
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::RepeatedPtrField< ::tensorflow::NodeDef > node_;
::tensorflow::FunctionDefLibrary* library_;
::tensorflow::VersionDef* versions_;
::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::NodeDef > node_;
::opencv_tensorflow::FunctionDefLibrary* library_;
::opencv_tensorflow::VersionDef* versions_;
::google::protobuf::int32 version_;
mutable int _cached_size_;
friend struct ::protobuf_graph_2eproto::TableStruct;
@ -235,13 +235,13 @@ class GraphDef : public ::google::protobuf::Message /* @@protoc_insertion_point(
// -------------------------------------------------------------------
class NodeDef_AttrEntry_DoNotUse : public ::google::protobuf::internal::MapEntry<NodeDef_AttrEntry_DoNotUse,
::std::string, ::tensorflow::AttrValue,
::std::string, ::opencv_tensorflow::AttrValue,
::google::protobuf::internal::WireFormatLite::TYPE_STRING,
::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE,
0 > {
public:
typedef ::google::protobuf::internal::MapEntry<NodeDef_AttrEntry_DoNotUse,
::std::string, ::tensorflow::AttrValue,
::std::string, ::opencv_tensorflow::AttrValue,
::google::protobuf::internal::WireFormatLite::TYPE_STRING,
::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE,
0 > SuperType;
@ -255,7 +255,7 @@ public:
// -------------------------------------------------------------------
class NodeDef : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:tensorflow.NodeDef) */ {
class NodeDef : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_tensorflow.NodeDef) */ {
public:
NodeDef();
virtual ~NodeDef();
@ -372,13 +372,13 @@ class NodeDef : public ::google::protobuf::Message /* @@protoc_insertion_point(c
const ::google::protobuf::RepeatedPtrField< ::std::string>& input() const;
::google::protobuf::RepeatedPtrField< ::std::string>* mutable_input();
// map<string, .tensorflow.AttrValue> attr = 5;
// map<string, .opencv_tensorflow.AttrValue> attr = 5;
int attr_size() const;
void clear_attr();
static const int kAttrFieldNumber = 5;
const ::google::protobuf::Map< ::std::string, ::tensorflow::AttrValue >&
const ::google::protobuf::Map< ::std::string, ::opencv_tensorflow::AttrValue >&
attr() const;
::google::protobuf::Map< ::std::string, ::tensorflow::AttrValue >*
::google::protobuf::Map< ::std::string, ::opencv_tensorflow::AttrValue >*
mutable_attr();
// string name = 1;
@ -450,7 +450,7 @@ class NodeDef : public ::google::protobuf::Message /* @@protoc_insertion_point(c
void unsafe_arena_set_allocated_device(
::std::string* device);
// @@protoc_insertion_point(class_scope:tensorflow.NodeDef)
// @@protoc_insertion_point(class_scope:opencv_tensorflow.NodeDef)
private:
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
@ -460,7 +460,7 @@ class NodeDef : public ::google::protobuf::Message /* @@protoc_insertion_point(c
::google::protobuf::RepeatedPtrField< ::std::string> input_;
::google::protobuf::internal::MapField<
NodeDef_AttrEntry_DoNotUse,
::std::string, ::tensorflow::AttrValue,
::std::string, ::opencv_tensorflow::AttrValue,
::google::protobuf::internal::WireFormatLite::TYPE_STRING,
::google::protobuf::internal::WireFormatLite::TYPE_MESSAGE,
0 > attr_;
@ -482,72 +482,72 @@ class NodeDef : public ::google::protobuf::Message /* @@protoc_insertion_point(c
#endif // __GNUC__
// GraphDef
// repeated .tensorflow.NodeDef node = 1;
// repeated .opencv_tensorflow.NodeDef node = 1;
inline int GraphDef::node_size() const {
return node_.size();
}
inline void GraphDef::clear_node() {
node_.Clear();
}
inline const ::tensorflow::NodeDef& GraphDef::node(int index) const {
// @@protoc_insertion_point(field_get:tensorflow.GraphDef.node)
inline const ::opencv_tensorflow::NodeDef& GraphDef::node(int index) const {
// @@protoc_insertion_point(field_get:opencv_tensorflow.GraphDef.node)
return node_.Get(index);
}
inline ::tensorflow::NodeDef* GraphDef::mutable_node(int index) {
// @@protoc_insertion_point(field_mutable:tensorflow.GraphDef.node)
inline ::opencv_tensorflow::NodeDef* GraphDef::mutable_node(int index) {
// @@protoc_insertion_point(field_mutable:opencv_tensorflow.GraphDef.node)
return node_.Mutable(index);
}
inline ::tensorflow::NodeDef* GraphDef::add_node() {
// @@protoc_insertion_point(field_add:tensorflow.GraphDef.node)
inline ::opencv_tensorflow::NodeDef* GraphDef::add_node() {
// @@protoc_insertion_point(field_add:opencv_tensorflow.GraphDef.node)
return node_.Add();
}
inline ::google::protobuf::RepeatedPtrField< ::tensorflow::NodeDef >*
inline ::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::NodeDef >*
GraphDef::mutable_node() {
// @@protoc_insertion_point(field_mutable_list:tensorflow.GraphDef.node)
// @@protoc_insertion_point(field_mutable_list:opencv_tensorflow.GraphDef.node)
return &node_;
}
inline const ::google::protobuf::RepeatedPtrField< ::tensorflow::NodeDef >&
inline const ::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::NodeDef >&
GraphDef::node() const {
// @@protoc_insertion_point(field_list:tensorflow.GraphDef.node)
// @@protoc_insertion_point(field_list:opencv_tensorflow.GraphDef.node)
return node_;
}
// .tensorflow.VersionDef versions = 4;
// .opencv_tensorflow.VersionDef versions = 4;
inline bool GraphDef::has_versions() const {
return this != internal_default_instance() && versions_ != NULL;
}
inline const ::tensorflow::VersionDef& GraphDef::versions() const {
const ::tensorflow::VersionDef* p = versions_;
// @@protoc_insertion_point(field_get:tensorflow.GraphDef.versions)
return p != NULL ? *p : *reinterpret_cast<const ::tensorflow::VersionDef*>(
&::tensorflow::_VersionDef_default_instance_);
inline const ::opencv_tensorflow::VersionDef& GraphDef::versions() const {
const ::opencv_tensorflow::VersionDef* p = versions_;
// @@protoc_insertion_point(field_get:opencv_tensorflow.GraphDef.versions)
return p != NULL ? *p : *reinterpret_cast<const ::opencv_tensorflow::VersionDef*>(
&::opencv_tensorflow::_VersionDef_default_instance_);
}
inline ::tensorflow::VersionDef* GraphDef::release_versions() {
// @@protoc_insertion_point(field_release:tensorflow.GraphDef.versions)
inline ::opencv_tensorflow::VersionDef* GraphDef::release_versions() {
// @@protoc_insertion_point(field_release:opencv_tensorflow.GraphDef.versions)
::tensorflow::VersionDef* temp = versions_;
::opencv_tensorflow::VersionDef* temp = versions_;
if (GetArenaNoVirtual() != NULL) {
temp = ::google::protobuf::internal::DuplicateIfNonNull(temp, NULL);
}
versions_ = NULL;
return temp;
}
inline ::tensorflow::VersionDef* GraphDef::unsafe_arena_release_versions() {
// @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.GraphDef.versions)
inline ::opencv_tensorflow::VersionDef* GraphDef::unsafe_arena_release_versions() {
// @@protoc_insertion_point(field_unsafe_arena_release:opencv_tensorflow.GraphDef.versions)
::tensorflow::VersionDef* temp = versions_;
::opencv_tensorflow::VersionDef* temp = versions_;
versions_ = NULL;
return temp;
}
inline ::tensorflow::VersionDef* GraphDef::mutable_versions() {
inline ::opencv_tensorflow::VersionDef* GraphDef::mutable_versions() {
if (versions_ == NULL) {
_slow_mutable_versions();
}
// @@protoc_insertion_point(field_mutable:tensorflow.GraphDef.versions)
// @@protoc_insertion_point(field_mutable:opencv_tensorflow.GraphDef.versions)
return versions_;
}
inline void GraphDef::set_allocated_versions(::tensorflow::VersionDef* versions) {
inline void GraphDef::set_allocated_versions(::opencv_tensorflow::VersionDef* versions) {
::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
if (message_arena == NULL) {
delete reinterpret_cast< ::google::protobuf::MessageLite*>(versions_);
@ -564,7 +564,7 @@ inline void GraphDef::set_allocated_versions(::tensorflow::VersionDef* versions)
}
versions_ = versions;
// @@protoc_insertion_point(field_set_allocated:tensorflow.GraphDef.versions)
// @@protoc_insertion_point(field_set_allocated:opencv_tensorflow.GraphDef.versions)
}
// int32 version = 3 [deprecated = true];
@ -572,51 +572,51 @@ inline void GraphDef::clear_version() {
version_ = 0;
}
inline ::google::protobuf::int32 GraphDef::version() const {
// @@protoc_insertion_point(field_get:tensorflow.GraphDef.version)
// @@protoc_insertion_point(field_get:opencv_tensorflow.GraphDef.version)
return version_;
}
inline void GraphDef::set_version(::google::protobuf::int32 value) {
version_ = value;
// @@protoc_insertion_point(field_set:tensorflow.GraphDef.version)
// @@protoc_insertion_point(field_set:opencv_tensorflow.GraphDef.version)
}
// .tensorflow.FunctionDefLibrary library = 2;
// .opencv_tensorflow.FunctionDefLibrary library = 2;
inline bool GraphDef::has_library() const {
return this != internal_default_instance() && library_ != NULL;
}
inline const ::tensorflow::FunctionDefLibrary& GraphDef::library() const {
const ::tensorflow::FunctionDefLibrary* p = library_;
// @@protoc_insertion_point(field_get:tensorflow.GraphDef.library)
return p != NULL ? *p : *reinterpret_cast<const ::tensorflow::FunctionDefLibrary*>(
&::tensorflow::_FunctionDefLibrary_default_instance_);
inline const ::opencv_tensorflow::FunctionDefLibrary& GraphDef::library() const {
const ::opencv_tensorflow::FunctionDefLibrary* p = library_;
// @@protoc_insertion_point(field_get:opencv_tensorflow.GraphDef.library)
return p != NULL ? *p : *reinterpret_cast<const ::opencv_tensorflow::FunctionDefLibrary*>(
&::opencv_tensorflow::_FunctionDefLibrary_default_instance_);
}
inline ::tensorflow::FunctionDefLibrary* GraphDef::release_library() {
// @@protoc_insertion_point(field_release:tensorflow.GraphDef.library)
inline ::opencv_tensorflow::FunctionDefLibrary* GraphDef::release_library() {
// @@protoc_insertion_point(field_release:opencv_tensorflow.GraphDef.library)
::tensorflow::FunctionDefLibrary* temp = library_;
::opencv_tensorflow::FunctionDefLibrary* temp = library_;
if (GetArenaNoVirtual() != NULL) {
temp = ::google::protobuf::internal::DuplicateIfNonNull(temp, NULL);
}
library_ = NULL;
return temp;
}
inline ::tensorflow::FunctionDefLibrary* GraphDef::unsafe_arena_release_library() {
// @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.GraphDef.library)
inline ::opencv_tensorflow::FunctionDefLibrary* GraphDef::unsafe_arena_release_library() {
// @@protoc_insertion_point(field_unsafe_arena_release:opencv_tensorflow.GraphDef.library)
::tensorflow::FunctionDefLibrary* temp = library_;
::opencv_tensorflow::FunctionDefLibrary* temp = library_;
library_ = NULL;
return temp;
}
inline ::tensorflow::FunctionDefLibrary* GraphDef::mutable_library() {
inline ::opencv_tensorflow::FunctionDefLibrary* GraphDef::mutable_library() {
if (library_ == NULL) {
_slow_mutable_library();
}
// @@protoc_insertion_point(field_mutable:tensorflow.GraphDef.library)
// @@protoc_insertion_point(field_mutable:opencv_tensorflow.GraphDef.library)
return library_;
}
inline void GraphDef::set_allocated_library(::tensorflow::FunctionDefLibrary* library) {
inline void GraphDef::set_allocated_library(::opencv_tensorflow::FunctionDefLibrary* library) {
::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
if (message_arena == NULL) {
delete reinterpret_cast< ::google::protobuf::MessageLite*>(library_);
@ -633,7 +633,7 @@ inline void GraphDef::set_allocated_library(::tensorflow::FunctionDefLibrary* li
}
library_ = library;
// @@protoc_insertion_point(field_set_allocated:tensorflow.GraphDef.library)
// @@protoc_insertion_point(field_set_allocated:opencv_tensorflow.GraphDef.library)
}
// -------------------------------------------------------------------
@ -647,20 +647,20 @@ inline void NodeDef::clear_name() {
name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
inline const ::std::string& NodeDef::name() const {
// @@protoc_insertion_point(field_get:tensorflow.NodeDef.name)
// @@protoc_insertion_point(field_get:opencv_tensorflow.NodeDef.name)
return name_.Get();
}
inline void NodeDef::set_name(const ::std::string& value) {
name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
// @@protoc_insertion_point(field_set:tensorflow.NodeDef.name)
// @@protoc_insertion_point(field_set:opencv_tensorflow.NodeDef.name)
}
#if LANG_CXX11
inline void NodeDef::set_name(::std::string&& value) {
name_.Set(
&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_rvalue:tensorflow.NodeDef.name)
// @@protoc_insertion_point(field_set_rvalue:opencv_tensorflow.NodeDef.name)
}
#endif
inline void NodeDef::set_name(const char* value) {
@ -668,22 +668,22 @@ inline void NodeDef::set_name(const char* value) {
name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_char:tensorflow.NodeDef.name)
// @@protoc_insertion_point(field_set_char:opencv_tensorflow.NodeDef.name)
}
inline void NodeDef::set_name(const char* value,
size_t size) {
name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_pointer:tensorflow.NodeDef.name)
// @@protoc_insertion_point(field_set_pointer:opencv_tensorflow.NodeDef.name)
}
inline ::std::string* NodeDef::mutable_name() {
// @@protoc_insertion_point(field_mutable:tensorflow.NodeDef.name)
// @@protoc_insertion_point(field_mutable:opencv_tensorflow.NodeDef.name)
return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
inline ::std::string* NodeDef::release_name() {
// @@protoc_insertion_point(field_release:tensorflow.NodeDef.name)
// @@protoc_insertion_point(field_release:opencv_tensorflow.NodeDef.name)
return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
@ -695,10 +695,10 @@ inline void NodeDef::set_allocated_name(::std::string* name) {
}
name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name,
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_allocated:tensorflow.NodeDef.name)
// @@protoc_insertion_point(field_set_allocated:opencv_tensorflow.NodeDef.name)
}
inline ::std::string* NodeDef::unsafe_arena_release_name() {
// @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.NodeDef.name)
// @@protoc_insertion_point(field_unsafe_arena_release:opencv_tensorflow.NodeDef.name)
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
@ -714,7 +714,7 @@ inline void NodeDef::unsafe_arena_set_allocated_name(
}
name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
name, GetArenaNoVirtual());
// @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.NodeDef.name)
// @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_tensorflow.NodeDef.name)
}
// string op = 2;
@ -722,20 +722,20 @@ inline void NodeDef::clear_op() {
op_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
inline const ::std::string& NodeDef::op() const {
// @@protoc_insertion_point(field_get:tensorflow.NodeDef.op)
// @@protoc_insertion_point(field_get:opencv_tensorflow.NodeDef.op)
return op_.Get();
}
inline void NodeDef::set_op(const ::std::string& value) {
op_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
// @@protoc_insertion_point(field_set:tensorflow.NodeDef.op)
// @@protoc_insertion_point(field_set:opencv_tensorflow.NodeDef.op)
}
#if LANG_CXX11
inline void NodeDef::set_op(::std::string&& value) {
op_.Set(
&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_rvalue:tensorflow.NodeDef.op)
// @@protoc_insertion_point(field_set_rvalue:opencv_tensorflow.NodeDef.op)
}
#endif
inline void NodeDef::set_op(const char* value) {
@ -743,22 +743,22 @@ inline void NodeDef::set_op(const char* value) {
op_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_char:tensorflow.NodeDef.op)
// @@protoc_insertion_point(field_set_char:opencv_tensorflow.NodeDef.op)
}
inline void NodeDef::set_op(const char* value,
size_t size) {
op_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_pointer:tensorflow.NodeDef.op)
// @@protoc_insertion_point(field_set_pointer:opencv_tensorflow.NodeDef.op)
}
inline ::std::string* NodeDef::mutable_op() {
// @@protoc_insertion_point(field_mutable:tensorflow.NodeDef.op)
// @@protoc_insertion_point(field_mutable:opencv_tensorflow.NodeDef.op)
return op_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
inline ::std::string* NodeDef::release_op() {
// @@protoc_insertion_point(field_release:tensorflow.NodeDef.op)
// @@protoc_insertion_point(field_release:opencv_tensorflow.NodeDef.op)
return op_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
@ -770,10 +770,10 @@ inline void NodeDef::set_allocated_op(::std::string* op) {
}
op_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), op,
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_allocated:tensorflow.NodeDef.op)
// @@protoc_insertion_point(field_set_allocated:opencv_tensorflow.NodeDef.op)
}
inline ::std::string* NodeDef::unsafe_arena_release_op() {
// @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.NodeDef.op)
// @@protoc_insertion_point(field_unsafe_arena_release:opencv_tensorflow.NodeDef.op)
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
return op_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
@ -789,7 +789,7 @@ inline void NodeDef::unsafe_arena_set_allocated_op(
}
op_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
op, GetArenaNoVirtual());
// @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.NodeDef.op)
// @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_tensorflow.NodeDef.op)
}
// repeated string input = 3;
@ -800,64 +800,64 @@ inline void NodeDef::clear_input() {
input_.Clear();
}
inline const ::std::string& NodeDef::input(int index) const {
// @@protoc_insertion_point(field_get:tensorflow.NodeDef.input)
// @@protoc_insertion_point(field_get:opencv_tensorflow.NodeDef.input)
return input_.Get(index);
}
inline ::std::string* NodeDef::mutable_input(int index) {
// @@protoc_insertion_point(field_mutable:tensorflow.NodeDef.input)
// @@protoc_insertion_point(field_mutable:opencv_tensorflow.NodeDef.input)
return input_.Mutable(index);
}
inline void NodeDef::set_input(int index, const ::std::string& value) {
// @@protoc_insertion_point(field_set:tensorflow.NodeDef.input)
// @@protoc_insertion_point(field_set:opencv_tensorflow.NodeDef.input)
input_.Mutable(index)->assign(value);
}
#if LANG_CXX11
inline void NodeDef::set_input(int index, ::std::string&& value) {
// @@protoc_insertion_point(field_set:tensorflow.NodeDef.input)
// @@protoc_insertion_point(field_set:opencv_tensorflow.NodeDef.input)
input_.Mutable(index)->assign(std::move(value));
}
#endif
inline void NodeDef::set_input(int index, const char* value) {
GOOGLE_DCHECK(value != NULL);
input_.Mutable(index)->assign(value);
// @@protoc_insertion_point(field_set_char:tensorflow.NodeDef.input)
// @@protoc_insertion_point(field_set_char:opencv_tensorflow.NodeDef.input)
}
inline void NodeDef::set_input(int index, const char* value, size_t size) {
input_.Mutable(index)->assign(
reinterpret_cast<const char*>(value), size);
// @@protoc_insertion_point(field_set_pointer:tensorflow.NodeDef.input)
// @@protoc_insertion_point(field_set_pointer:opencv_tensorflow.NodeDef.input)
}
inline ::std::string* NodeDef::add_input() {
// @@protoc_insertion_point(field_add_mutable:tensorflow.NodeDef.input)
// @@protoc_insertion_point(field_add_mutable:opencv_tensorflow.NodeDef.input)
return input_.Add();
}
inline void NodeDef::add_input(const ::std::string& value) {
input_.Add()->assign(value);
// @@protoc_insertion_point(field_add:tensorflow.NodeDef.input)
// @@protoc_insertion_point(field_add:opencv_tensorflow.NodeDef.input)
}
#if LANG_CXX11
inline void NodeDef::add_input(::std::string&& value) {
input_.Add(std::move(value));
// @@protoc_insertion_point(field_add:tensorflow.NodeDef.input)
// @@protoc_insertion_point(field_add:opencv_tensorflow.NodeDef.input)
}
#endif
inline void NodeDef::add_input(const char* value) {
GOOGLE_DCHECK(value != NULL);
input_.Add()->assign(value);
// @@protoc_insertion_point(field_add_char:tensorflow.NodeDef.input)
// @@protoc_insertion_point(field_add_char:opencv_tensorflow.NodeDef.input)
}
inline void NodeDef::add_input(const char* value, size_t size) {
input_.Add()->assign(reinterpret_cast<const char*>(value), size);
// @@protoc_insertion_point(field_add_pointer:tensorflow.NodeDef.input)
// @@protoc_insertion_point(field_add_pointer:opencv_tensorflow.NodeDef.input)
}
inline const ::google::protobuf::RepeatedPtrField< ::std::string>&
NodeDef::input() const {
// @@protoc_insertion_point(field_list:tensorflow.NodeDef.input)
// @@protoc_insertion_point(field_list:opencv_tensorflow.NodeDef.input)
return input_;
}
inline ::google::protobuf::RepeatedPtrField< ::std::string>*
NodeDef::mutable_input() {
// @@protoc_insertion_point(field_mutable_list:tensorflow.NodeDef.input)
// @@protoc_insertion_point(field_mutable_list:opencv_tensorflow.NodeDef.input)
return &input_;
}
@ -866,20 +866,20 @@ inline void NodeDef::clear_device() {
device_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
inline const ::std::string& NodeDef::device() const {
// @@protoc_insertion_point(field_get:tensorflow.NodeDef.device)
// @@protoc_insertion_point(field_get:opencv_tensorflow.NodeDef.device)
return device_.Get();
}
inline void NodeDef::set_device(const ::std::string& value) {
device_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
// @@protoc_insertion_point(field_set:tensorflow.NodeDef.device)
// @@protoc_insertion_point(field_set:opencv_tensorflow.NodeDef.device)
}
#if LANG_CXX11
inline void NodeDef::set_device(::std::string&& value) {
device_.Set(
&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_rvalue:tensorflow.NodeDef.device)
// @@protoc_insertion_point(field_set_rvalue:opencv_tensorflow.NodeDef.device)
}
#endif
inline void NodeDef::set_device(const char* value) {
@ -887,22 +887,22 @@ inline void NodeDef::set_device(const char* value) {
device_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_char:tensorflow.NodeDef.device)
// @@protoc_insertion_point(field_set_char:opencv_tensorflow.NodeDef.device)
}
inline void NodeDef::set_device(const char* value,
size_t size) {
device_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_pointer:tensorflow.NodeDef.device)
// @@protoc_insertion_point(field_set_pointer:opencv_tensorflow.NodeDef.device)
}
inline ::std::string* NodeDef::mutable_device() {
// @@protoc_insertion_point(field_mutable:tensorflow.NodeDef.device)
// @@protoc_insertion_point(field_mutable:opencv_tensorflow.NodeDef.device)
return device_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
inline ::std::string* NodeDef::release_device() {
// @@protoc_insertion_point(field_release:tensorflow.NodeDef.device)
// @@protoc_insertion_point(field_release:opencv_tensorflow.NodeDef.device)
return device_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
@ -914,10 +914,10 @@ inline void NodeDef::set_allocated_device(::std::string* device) {
}
device_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), device,
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_allocated:tensorflow.NodeDef.device)
// @@protoc_insertion_point(field_set_allocated:opencv_tensorflow.NodeDef.device)
}
inline ::std::string* NodeDef::unsafe_arena_release_device() {
// @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.NodeDef.device)
// @@protoc_insertion_point(field_unsafe_arena_release:opencv_tensorflow.NodeDef.device)
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
return device_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
@ -933,21 +933,21 @@ inline void NodeDef::unsafe_arena_set_allocated_device(
}
device_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
device, GetArenaNoVirtual());
// @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.NodeDef.device)
// @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_tensorflow.NodeDef.device)
}
// map<string, .tensorflow.AttrValue> attr = 5;
// map<string, .opencv_tensorflow.AttrValue> attr = 5;
inline int NodeDef::attr_size() const {
return attr_.size();
}
inline const ::google::protobuf::Map< ::std::string, ::tensorflow::AttrValue >&
inline const ::google::protobuf::Map< ::std::string, ::opencv_tensorflow::AttrValue >&
NodeDef::attr() const {
// @@protoc_insertion_point(field_map:tensorflow.NodeDef.attr)
// @@protoc_insertion_point(field_map:opencv_tensorflow.NodeDef.attr)
return attr_.GetMap();
}
inline ::google::protobuf::Map< ::std::string, ::tensorflow::AttrValue >*
inline ::google::protobuf::Map< ::std::string, ::opencv_tensorflow::AttrValue >*
NodeDef::mutable_attr() {
// @@protoc_insertion_point(field_mutable_map:tensorflow.NodeDef.attr)
// @@protoc_insertion_point(field_mutable_map:opencv_tensorflow.NodeDef.attr)
return attr_.MutableMap();
}
@ -961,7 +961,7 @@ NodeDef::mutable_attr() {
// @@protoc_insertion_point(namespace_scope)
} // namespace tensorflow
} // namespace opencv_tensorflow
// @@protoc_insertion_point(global_scope)

File diff suppressed because it is too large Load Diff

File diff suppressed because it is too large Load Diff

View File

@ -19,13 +19,13 @@
#include "third_party/protobuf/version.h"
#endif
// @@protoc_insertion_point(includes)
namespace tensorflow {
namespace opencv_tensorflow {
class TensorProtoDefaultTypeInternal {
public:
::google::protobuf::internal::ExplicitlyConstructed<TensorProto>
_instance;
} _TensorProto_default_instance_;
} // namespace tensorflow
} // namespace opencv_tensorflow
namespace protobuf_tensor_2eproto {
void InitDefaultsTensorProtoImpl() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
@ -37,11 +37,11 @@ void InitDefaultsTensorProtoImpl() {
#endif // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
protobuf_tensor_5fshape_2eproto::InitDefaultsTensorShapeProto();
{
void* ptr = &::tensorflow::_TensorProto_default_instance_;
new (ptr) ::tensorflow::TensorProto();
void* ptr = &::opencv_tensorflow::_TensorProto_default_instance_;
new (ptr) ::opencv_tensorflow::TensorProto();
::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
}
::tensorflow::TensorProto::InitAsDefaultInstance();
::opencv_tensorflow::TensorProto::InitAsDefaultInstance();
}
void InitDefaultsTensorProto() {
@ -53,30 +53,30 @@ void InitDefaultsTensorProto() {
const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
~0u, // no _has_bits_
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tensorflow::TensorProto, _internal_metadata_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::TensorProto, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tensorflow::TensorProto, dtype_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tensorflow::TensorProto, tensor_shape_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tensorflow::TensorProto, version_number_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tensorflow::TensorProto, tensor_content_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tensorflow::TensorProto, half_val_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tensorflow::TensorProto, float_val_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tensorflow::TensorProto, double_val_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tensorflow::TensorProto, int_val_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tensorflow::TensorProto, string_val_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tensorflow::TensorProto, scomplex_val_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tensorflow::TensorProto, int64_val_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tensorflow::TensorProto, bool_val_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tensorflow::TensorProto, dcomplex_val_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::TensorProto, dtype_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::TensorProto, tensor_shape_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::TensorProto, version_number_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::TensorProto, tensor_content_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::TensorProto, half_val_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::TensorProto, float_val_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::TensorProto, double_val_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::TensorProto, int_val_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::TensorProto, string_val_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::TensorProto, scomplex_val_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::TensorProto, int64_val_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::TensorProto, bool_val_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::TensorProto, dcomplex_val_),
};
static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
{ 0, -1, sizeof(::tensorflow::TensorProto)},
{ 0, -1, sizeof(::opencv_tensorflow::TensorProto)},
};
static ::google::protobuf::Message const * const file_default_instances[] = {
reinterpret_cast<const ::google::protobuf::Message*>(&::tensorflow::_TensorProto_default_instance_),
reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_tensorflow::_TensorProto_default_instance_),
};
void protobuf_AssignDescriptors() {
@ -101,21 +101,22 @@ void protobuf_RegisterTypes(const ::std::string&) {
void AddDescriptorsImpl() {
InitDefaults();
static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
"\n\014tensor.proto\022\ntensorflow\032\022tensor_shape"
".proto\032\013types.proto\"\345\002\n\013TensorProto\022#\n\005d"
"type\030\001 \001(\0162\024.tensorflow.DataType\0222\n\014tens"
"or_shape\030\002 \001(\0132\034.tensorflow.TensorShapeP"
"roto\022\026\n\016version_number\030\003 \001(\005\022\026\n\016tensor_c"
"ontent\030\004 \001(\014\022\024\n\010half_val\030\r \003(\005B\002\020\001\022\025\n\tfl"
"oat_val\030\005 \003(\002B\002\020\001\022\026\n\ndouble_val\030\006 \003(\001B\002\020"
"\001\022\023\n\007int_val\030\007 \003(\005B\002\020\001\022\022\n\nstring_val\030\010 \003"
"(\014\022\030\n\014scomplex_val\030\t \003(\002B\002\020\001\022\025\n\tint64_va"
"l\030\n \003(\003B\002\020\001\022\024\n\010bool_val\030\013 \003(\010B\002\020\001\022\030\n\014dco"
"mplex_val\030\014 \003(\001B\002\020\001B-\n\030org.tensorflow.fr"
"ameworkB\014TensorProtosP\001\370\001\001b\006proto3"
"\n\014tensor.proto\022\021opencv_tensorflow\032\022tenso"
"r_shape.proto\032\013types.proto\"\363\002\n\013TensorPro"
"to\022*\n\005dtype\030\001 \001(\0162\033.opencv_tensorflow.Da"
"taType\0229\n\014tensor_shape\030\002 \001(\0132#.opencv_te"
"nsorflow.TensorShapeProto\022\026\n\016version_num"
"ber\030\003 \001(\005\022\026\n\016tensor_content\030\004 \001(\014\022\024\n\010hal"
"f_val\030\r \003(\005B\002\020\001\022\025\n\tfloat_val\030\005 \003(\002B\002\020\001\022\026"
"\n\ndouble_val\030\006 \003(\001B\002\020\001\022\023\n\007int_val\030\007 \003(\005B"
"\002\020\001\022\022\n\nstring_val\030\010 \003(\014\022\030\n\014scomplex_val\030"
"\t \003(\002B\002\020\001\022\025\n\tint64_val\030\n \003(\003B\002\020\001\022\024\n\010bool"
"_val\030\013 \003(\010B\002\020\001\022\030\n\014dcomplex_val\030\014 \003(\001B\002\020\001"
"B-\n\030org.tensorflow.frameworkB\014TensorProt"
"osP\001\370\001\001b\006proto3"
};
::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
descriptor, 474);
descriptor, 495);
::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
"tensor.proto", &protobuf_RegisterTypes);
::protobuf_tensor_5fshape_2eproto::AddDescriptors();
@ -133,20 +134,20 @@ struct StaticDescriptorInitializer {
}
} static_descriptor_initializer;
} // namespace protobuf_tensor_2eproto
namespace tensorflow {
namespace opencv_tensorflow {
// ===================================================================
void TensorProto::InitAsDefaultInstance() {
::tensorflow::_TensorProto_default_instance_._instance.get_mutable()->tensor_shape_ = const_cast< ::tensorflow::TensorShapeProto*>(
::tensorflow::TensorShapeProto::internal_default_instance());
::opencv_tensorflow::_TensorProto_default_instance_._instance.get_mutable()->tensor_shape_ = const_cast< ::opencv_tensorflow::TensorShapeProto*>(
::opencv_tensorflow::TensorShapeProto::internal_default_instance());
}
void TensorProto::_slow_mutable_tensor_shape() {
tensor_shape_ = ::google::protobuf::Arena::CreateMessage< ::tensorflow::TensorShapeProto >(
tensor_shape_ = ::google::protobuf::Arena::CreateMessage< ::opencv_tensorflow::TensorShapeProto >(
GetArenaNoVirtual());
}
void TensorProto::unsafe_arena_set_allocated_tensor_shape(
::tensorflow::TensorShapeProto* tensor_shape) {
::opencv_tensorflow::TensorShapeProto* tensor_shape) {
if (GetArenaNoVirtual() == NULL) {
delete tensor_shape_;
}
@ -156,7 +157,7 @@ void TensorProto::unsafe_arena_set_allocated_tensor_shape(
} else {
}
// @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.TensorProto.tensor_shape)
// @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_tensorflow.TensorProto.tensor_shape)
}
void TensorProto::clear_tensor_shape() {
if (GetArenaNoVirtual() == NULL && tensor_shape_ != NULL) {
@ -186,7 +187,7 @@ TensorProto::TensorProto()
::protobuf_tensor_2eproto::InitDefaultsTensorProto();
}
SharedCtor();
// @@protoc_insertion_point(constructor:tensorflow.TensorProto)
// @@protoc_insertion_point(constructor:opencv_tensorflow.TensorProto)
}
TensorProto::TensorProto(::google::protobuf::Arena* arena)
: ::google::protobuf::Message(),
@ -203,7 +204,7 @@ TensorProto::TensorProto(::google::protobuf::Arena* arena)
::protobuf_tensor_2eproto::InitDefaultsTensorProto();
SharedCtor();
RegisterArenaDtor(arena);
// @@protoc_insertion_point(arena_constructor:tensorflow.TensorProto)
// @@protoc_insertion_point(arena_constructor:opencv_tensorflow.TensorProto)
}
TensorProto::TensorProto(const TensorProto& from)
: ::google::protobuf::Message(),
@ -225,14 +226,14 @@ TensorProto::TensorProto(const TensorProto& from)
GetArenaNoVirtual());
}
if (from.has_tensor_shape()) {
tensor_shape_ = new ::tensorflow::TensorShapeProto(*from.tensor_shape_);
tensor_shape_ = new ::opencv_tensorflow::TensorShapeProto(*from.tensor_shape_);
} else {
tensor_shape_ = NULL;
}
::memcpy(&dtype_, &from.dtype_,
static_cast<size_t>(reinterpret_cast<char*>(&version_number_) -
reinterpret_cast<char*>(&dtype_)) + sizeof(version_number_));
// @@protoc_insertion_point(copy_constructor:tensorflow.TensorProto)
// @@protoc_insertion_point(copy_constructor:opencv_tensorflow.TensorProto)
}
void TensorProto::SharedCtor() {
@ -244,7 +245,7 @@ void TensorProto::SharedCtor() {
}
TensorProto::~TensorProto() {
// @@protoc_insertion_point(destructor:tensorflow.TensorProto)
// @@protoc_insertion_point(destructor:opencv_tensorflow.TensorProto)
SharedDtor();
}
@ -280,7 +281,7 @@ TensorProto* TensorProto::New(::google::protobuf::Arena* arena) const {
}
void TensorProto::Clear() {
// @@protoc_insertion_point(message_clear_start:tensorflow.TensorProto)
// @@protoc_insertion_point(message_clear_start:opencv_tensorflow.TensorProto)
::google::protobuf::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
@ -309,13 +310,13 @@ bool TensorProto::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
::google::protobuf::uint32 tag;
// @@protoc_insertion_point(parse_start:tensorflow.TensorProto)
// @@protoc_insertion_point(parse_start:opencv_tensorflow.TensorProto)
for (;;) {
::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
tag = p.first;
if (!p.second) goto handle_unusual;
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// .tensorflow.DataType dtype = 1;
// .opencv_tensorflow.DataType dtype = 1;
case 1: {
if (static_cast< ::google::protobuf::uint8>(tag) ==
static_cast< ::google::protobuf::uint8>(8u /* 8 & 0xFF */)) {
@ -323,14 +324,14 @@ bool TensorProto::MergePartialFromCodedStream(
DO_((::google::protobuf::internal::WireFormatLite::ReadPrimitive<
int, ::google::protobuf::internal::WireFormatLite::TYPE_ENUM>(
input, &value)));
set_dtype(static_cast< ::tensorflow::DataType >(value));
set_dtype(static_cast< ::opencv_tensorflow::DataType >(value));
} else {
goto handle_unusual;
}
break;
}
// .tensorflow.TensorShapeProto tensor_shape = 2;
// .opencv_tensorflow.TensorShapeProto tensor_shape = 2;
case 2: {
if (static_cast< ::google::protobuf::uint8>(tag) ==
static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
@ -544,27 +545,27 @@ bool TensorProto::MergePartialFromCodedStream(
}
}
success:
// @@protoc_insertion_point(parse_success:tensorflow.TensorProto)
// @@protoc_insertion_point(parse_success:opencv_tensorflow.TensorProto)
return true;
failure:
// @@protoc_insertion_point(parse_failure:tensorflow.TensorProto)
// @@protoc_insertion_point(parse_failure:opencv_tensorflow.TensorProto)
return false;
#undef DO_
}
void TensorProto::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// @@protoc_insertion_point(serialize_start:tensorflow.TensorProto)
// @@protoc_insertion_point(serialize_start:opencv_tensorflow.TensorProto)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// .tensorflow.DataType dtype = 1;
// .opencv_tensorflow.DataType dtype = 1;
if (this->dtype() != 0) {
::google::protobuf::internal::WireFormatLite::WriteEnum(
1, this->dtype(), output);
}
// .tensorflow.TensorShapeProto tensor_shape = 2;
// .opencv_tensorflow.TensorShapeProto tensor_shape = 2;
if (this->has_tensor_shape()) {
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
2, *this->tensor_shape_, output);
@ -669,23 +670,23 @@ void TensorProto::SerializeWithCachedSizes(
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
(::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output);
}
// @@protoc_insertion_point(serialize_end:tensorflow.TensorProto)
// @@protoc_insertion_point(serialize_end:opencv_tensorflow.TensorProto)
}
::google::protobuf::uint8* TensorProto::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
(void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:tensorflow.TensorProto)
// @@protoc_insertion_point(serialize_to_array_start:opencv_tensorflow.TensorProto)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// .tensorflow.DataType dtype = 1;
// .opencv_tensorflow.DataType dtype = 1;
if (this->dtype() != 0) {
target = ::google::protobuf::internal::WireFormatLite::WriteEnumToArray(
1, this->dtype(), target);
}
// .tensorflow.TensorShapeProto tensor_shape = 2;
// .opencv_tensorflow.TensorShapeProto tensor_shape = 2;
if (this->has_tensor_shape()) {
target = ::google::protobuf::internal::WireFormatLite::
InternalWriteMessageToArray(
@ -818,12 +819,12 @@ void TensorProto::SerializeWithCachedSizes(
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
(::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target);
}
// @@protoc_insertion_point(serialize_to_array_end:tensorflow.TensorProto)
// @@protoc_insertion_point(serialize_to_array_end:opencv_tensorflow.TensorProto)
return target;
}
size_t TensorProto::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:tensorflow.TensorProto)
// @@protoc_insertion_point(message_byte_size_start:opencv_tensorflow.TensorProto)
size_t total_size = 0;
if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
@ -974,14 +975,14 @@ size_t TensorProto::ByteSizeLong() const {
this->tensor_content());
}
// .tensorflow.TensorShapeProto tensor_shape = 2;
// .opencv_tensorflow.TensorShapeProto tensor_shape = 2;
if (this->has_tensor_shape()) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::MessageSize(
*this->tensor_shape_);
}
// .tensorflow.DataType dtype = 1;
// .opencv_tensorflow.DataType dtype = 1;
if (this->dtype() != 0) {
total_size += 1 +
::google::protobuf::internal::WireFormatLite::EnumSize(this->dtype());
@ -1002,22 +1003,22 @@ size_t TensorProto::ByteSizeLong() const {
}
void TensorProto::MergeFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:tensorflow.TensorProto)
// @@protoc_insertion_point(generalized_merge_from_start:opencv_tensorflow.TensorProto)
GOOGLE_DCHECK_NE(&from, this);
const TensorProto* source =
::google::protobuf::internal::DynamicCastToGenerated<const TensorProto>(
&from);
if (source == NULL) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:tensorflow.TensorProto)
// @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_tensorflow.TensorProto)
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:tensorflow.TensorProto)
// @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_tensorflow.TensorProto)
MergeFrom(*source);
}
}
void TensorProto::MergeFrom(const TensorProto& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.TensorProto)
// @@protoc_insertion_point(class_specific_merge_from_start:opencv_tensorflow.TensorProto)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::google::protobuf::uint32 cached_has_bits = 0;
@ -1036,7 +1037,7 @@ void TensorProto::MergeFrom(const TensorProto& from) {
set_tensor_content(from.tensor_content());
}
if (from.has_tensor_shape()) {
mutable_tensor_shape()->::tensorflow::TensorShapeProto::MergeFrom(from.tensor_shape());
mutable_tensor_shape()->::opencv_tensorflow::TensorShapeProto::MergeFrom(from.tensor_shape());
}
if (from.dtype() != 0) {
set_dtype(from.dtype());
@ -1047,14 +1048,14 @@ void TensorProto::MergeFrom(const TensorProto& from) {
}
void TensorProto::CopyFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:tensorflow.TensorProto)
// @@protoc_insertion_point(generalized_copy_from_start:opencv_tensorflow.TensorProto)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void TensorProto::CopyFrom(const TensorProto& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.TensorProto)
// @@protoc_insertion_point(class_specific_copy_from_start:opencv_tensorflow.TensorProto)
if (&from == this) return;
Clear();
MergeFrom(from);
@ -1109,6 +1110,6 @@ void TensorProto::InternalSwap(TensorProto* other) {
// @@protoc_insertion_point(namespace_scope)
} // namespace tensorflow
} // namespace opencv_tensorflow
// @@protoc_insertion_point(global_scope)

View File

@ -50,16 +50,16 @@ inline void InitDefaults() {
InitDefaultsTensorProto();
}
} // namespace protobuf_tensor_2eproto
namespace tensorflow {
namespace opencv_tensorflow {
class TensorProto;
class TensorProtoDefaultTypeInternal;
extern TensorProtoDefaultTypeInternal _TensorProto_default_instance_;
} // namespace tensorflow
namespace tensorflow {
} // namespace opencv_tensorflow
namespace opencv_tensorflow {
// ===================================================================
class TensorProto : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:tensorflow.TensorProto) */ {
class TensorProto : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_tensorflow.TensorProto) */ {
public:
TensorProto();
virtual ~TensorProto();
@ -294,26 +294,26 @@ class TensorProto : public ::google::protobuf::Message /* @@protoc_insertion_poi
void unsafe_arena_set_allocated_tensor_content(
::std::string* tensor_content);
// .tensorflow.TensorShapeProto tensor_shape = 2;
// .opencv_tensorflow.TensorShapeProto tensor_shape = 2;
bool has_tensor_shape() const;
void clear_tensor_shape();
static const int kTensorShapeFieldNumber = 2;
private:
void _slow_mutable_tensor_shape();
public:
const ::tensorflow::TensorShapeProto& tensor_shape() const;
::tensorflow::TensorShapeProto* release_tensor_shape();
::tensorflow::TensorShapeProto* mutable_tensor_shape();
void set_allocated_tensor_shape(::tensorflow::TensorShapeProto* tensor_shape);
const ::opencv_tensorflow::TensorShapeProto& tensor_shape() const;
::opencv_tensorflow::TensorShapeProto* release_tensor_shape();
::opencv_tensorflow::TensorShapeProto* mutable_tensor_shape();
void set_allocated_tensor_shape(::opencv_tensorflow::TensorShapeProto* tensor_shape);
void unsafe_arena_set_allocated_tensor_shape(
::tensorflow::TensorShapeProto* tensor_shape);
::tensorflow::TensorShapeProto* unsafe_arena_release_tensor_shape();
::opencv_tensorflow::TensorShapeProto* tensor_shape);
::opencv_tensorflow::TensorShapeProto* unsafe_arena_release_tensor_shape();
// .tensorflow.DataType dtype = 1;
// .opencv_tensorflow.DataType dtype = 1;
void clear_dtype();
static const int kDtypeFieldNumber = 1;
::tensorflow::DataType dtype() const;
void set_dtype(::tensorflow::DataType value);
::opencv_tensorflow::DataType dtype() const;
void set_dtype(::opencv_tensorflow::DataType value);
// int32 version_number = 3;
void clear_version_number();
@ -321,7 +321,7 @@ class TensorProto : public ::google::protobuf::Message /* @@protoc_insertion_poi
::google::protobuf::int32 version_number() const;
void set_version_number(::google::protobuf::int32 value);
// @@protoc_insertion_point(class_scope:tensorflow.TensorProto)
// @@protoc_insertion_point(class_scope:opencv_tensorflow.TensorProto)
private:
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
@ -346,7 +346,7 @@ class TensorProto : public ::google::protobuf::Message /* @@protoc_insertion_poi
::google::protobuf::RepeatedField< ::google::protobuf::int32 > half_val_;
mutable int _half_val_cached_byte_size_;
::google::protobuf::internal::ArenaStringPtr tensor_content_;
::tensorflow::TensorShapeProto* tensor_shape_;
::opencv_tensorflow::TensorShapeProto* tensor_shape_;
int dtype_;
::google::protobuf::int32 version_number_;
mutable int _cached_size_;
@ -364,56 +364,56 @@ class TensorProto : public ::google::protobuf::Message /* @@protoc_insertion_poi
#endif // __GNUC__
// TensorProto
// .tensorflow.DataType dtype = 1;
// .opencv_tensorflow.DataType dtype = 1;
inline void TensorProto::clear_dtype() {
dtype_ = 0;
}
inline ::tensorflow::DataType TensorProto::dtype() const {
// @@protoc_insertion_point(field_get:tensorflow.TensorProto.dtype)
return static_cast< ::tensorflow::DataType >(dtype_);
inline ::opencv_tensorflow::DataType TensorProto::dtype() const {
// @@protoc_insertion_point(field_get:opencv_tensorflow.TensorProto.dtype)
return static_cast< ::opencv_tensorflow::DataType >(dtype_);
}
inline void TensorProto::set_dtype(::tensorflow::DataType value) {
inline void TensorProto::set_dtype(::opencv_tensorflow::DataType value) {
dtype_ = value;
// @@protoc_insertion_point(field_set:tensorflow.TensorProto.dtype)
// @@protoc_insertion_point(field_set:opencv_tensorflow.TensorProto.dtype)
}
// .tensorflow.TensorShapeProto tensor_shape = 2;
// .opencv_tensorflow.TensorShapeProto tensor_shape = 2;
inline bool TensorProto::has_tensor_shape() const {
return this != internal_default_instance() && tensor_shape_ != NULL;
}
inline const ::tensorflow::TensorShapeProto& TensorProto::tensor_shape() const {
const ::tensorflow::TensorShapeProto* p = tensor_shape_;
// @@protoc_insertion_point(field_get:tensorflow.TensorProto.tensor_shape)
return p != NULL ? *p : *reinterpret_cast<const ::tensorflow::TensorShapeProto*>(
&::tensorflow::_TensorShapeProto_default_instance_);
inline const ::opencv_tensorflow::TensorShapeProto& TensorProto::tensor_shape() const {
const ::opencv_tensorflow::TensorShapeProto* p = tensor_shape_;
// @@protoc_insertion_point(field_get:opencv_tensorflow.TensorProto.tensor_shape)
return p != NULL ? *p : *reinterpret_cast<const ::opencv_tensorflow::TensorShapeProto*>(
&::opencv_tensorflow::_TensorShapeProto_default_instance_);
}
inline ::tensorflow::TensorShapeProto* TensorProto::release_tensor_shape() {
// @@protoc_insertion_point(field_release:tensorflow.TensorProto.tensor_shape)
inline ::opencv_tensorflow::TensorShapeProto* TensorProto::release_tensor_shape() {
// @@protoc_insertion_point(field_release:opencv_tensorflow.TensorProto.tensor_shape)
::tensorflow::TensorShapeProto* temp = tensor_shape_;
::opencv_tensorflow::TensorShapeProto* temp = tensor_shape_;
if (GetArenaNoVirtual() != NULL) {
temp = ::google::protobuf::internal::DuplicateIfNonNull(temp, NULL);
}
tensor_shape_ = NULL;
return temp;
}
inline ::tensorflow::TensorShapeProto* TensorProto::unsafe_arena_release_tensor_shape() {
// @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.TensorProto.tensor_shape)
inline ::opencv_tensorflow::TensorShapeProto* TensorProto::unsafe_arena_release_tensor_shape() {
// @@protoc_insertion_point(field_unsafe_arena_release:opencv_tensorflow.TensorProto.tensor_shape)
::tensorflow::TensorShapeProto* temp = tensor_shape_;
::opencv_tensorflow::TensorShapeProto* temp = tensor_shape_;
tensor_shape_ = NULL;
return temp;
}
inline ::tensorflow::TensorShapeProto* TensorProto::mutable_tensor_shape() {
inline ::opencv_tensorflow::TensorShapeProto* TensorProto::mutable_tensor_shape() {
if (tensor_shape_ == NULL) {
_slow_mutable_tensor_shape();
}
// @@protoc_insertion_point(field_mutable:tensorflow.TensorProto.tensor_shape)
// @@protoc_insertion_point(field_mutable:opencv_tensorflow.TensorProto.tensor_shape)
return tensor_shape_;
}
inline void TensorProto::set_allocated_tensor_shape(::tensorflow::TensorShapeProto* tensor_shape) {
inline void TensorProto::set_allocated_tensor_shape(::opencv_tensorflow::TensorShapeProto* tensor_shape) {
::google::protobuf::Arena* message_arena = GetArenaNoVirtual();
if (message_arena == NULL) {
delete reinterpret_cast< ::google::protobuf::MessageLite*>(tensor_shape_);
@ -430,7 +430,7 @@ inline void TensorProto::set_allocated_tensor_shape(::tensorflow::TensorShapePro
}
tensor_shape_ = tensor_shape;
// @@protoc_insertion_point(field_set_allocated:tensorflow.TensorProto.tensor_shape)
// @@protoc_insertion_point(field_set_allocated:opencv_tensorflow.TensorProto.tensor_shape)
}
// int32 version_number = 3;
@ -438,13 +438,13 @@ inline void TensorProto::clear_version_number() {
version_number_ = 0;
}
inline ::google::protobuf::int32 TensorProto::version_number() const {
// @@protoc_insertion_point(field_get:tensorflow.TensorProto.version_number)
// @@protoc_insertion_point(field_get:opencv_tensorflow.TensorProto.version_number)
return version_number_;
}
inline void TensorProto::set_version_number(::google::protobuf::int32 value) {
version_number_ = value;
// @@protoc_insertion_point(field_set:tensorflow.TensorProto.version_number)
// @@protoc_insertion_point(field_set:opencv_tensorflow.TensorProto.version_number)
}
// bytes tensor_content = 4;
@ -452,20 +452,20 @@ inline void TensorProto::clear_tensor_content() {
tensor_content_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
inline const ::std::string& TensorProto::tensor_content() const {
// @@protoc_insertion_point(field_get:tensorflow.TensorProto.tensor_content)
// @@protoc_insertion_point(field_get:opencv_tensorflow.TensorProto.tensor_content)
return tensor_content_.Get();
}
inline void TensorProto::set_tensor_content(const ::std::string& value) {
tensor_content_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
// @@protoc_insertion_point(field_set:tensorflow.TensorProto.tensor_content)
// @@protoc_insertion_point(field_set:opencv_tensorflow.TensorProto.tensor_content)
}
#if LANG_CXX11
inline void TensorProto::set_tensor_content(::std::string&& value) {
tensor_content_.Set(
&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_rvalue:tensorflow.TensorProto.tensor_content)
// @@protoc_insertion_point(field_set_rvalue:opencv_tensorflow.TensorProto.tensor_content)
}
#endif
inline void TensorProto::set_tensor_content(const char* value) {
@ -473,22 +473,22 @@ inline void TensorProto::set_tensor_content(const char* value) {
tensor_content_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_char:tensorflow.TensorProto.tensor_content)
// @@protoc_insertion_point(field_set_char:opencv_tensorflow.TensorProto.tensor_content)
}
inline void TensorProto::set_tensor_content(const void* value,
size_t size) {
tensor_content_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_pointer:tensorflow.TensorProto.tensor_content)
// @@protoc_insertion_point(field_set_pointer:opencv_tensorflow.TensorProto.tensor_content)
}
inline ::std::string* TensorProto::mutable_tensor_content() {
// @@protoc_insertion_point(field_mutable:tensorflow.TensorProto.tensor_content)
// @@protoc_insertion_point(field_mutable:opencv_tensorflow.TensorProto.tensor_content)
return tensor_content_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
inline ::std::string* TensorProto::release_tensor_content() {
// @@protoc_insertion_point(field_release:tensorflow.TensorProto.tensor_content)
// @@protoc_insertion_point(field_release:opencv_tensorflow.TensorProto.tensor_content)
return tensor_content_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
@ -500,10 +500,10 @@ inline void TensorProto::set_allocated_tensor_content(::std::string* tensor_cont
}
tensor_content_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), tensor_content,
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_allocated:tensorflow.TensorProto.tensor_content)
// @@protoc_insertion_point(field_set_allocated:opencv_tensorflow.TensorProto.tensor_content)
}
inline ::std::string* TensorProto::unsafe_arena_release_tensor_content() {
// @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.TensorProto.tensor_content)
// @@protoc_insertion_point(field_unsafe_arena_release:opencv_tensorflow.TensorProto.tensor_content)
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
return tensor_content_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
@ -519,7 +519,7 @@ inline void TensorProto::unsafe_arena_set_allocated_tensor_content(
}
tensor_content_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
tensor_content, GetArenaNoVirtual());
// @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.TensorProto.tensor_content)
// @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_tensorflow.TensorProto.tensor_content)
}
// repeated int32 half_val = 13 [packed = true];
@ -530,25 +530,25 @@ inline void TensorProto::clear_half_val() {
half_val_.Clear();
}
inline ::google::protobuf::int32 TensorProto::half_val(int index) const {
// @@protoc_insertion_point(field_get:tensorflow.TensorProto.half_val)
// @@protoc_insertion_point(field_get:opencv_tensorflow.TensorProto.half_val)
return half_val_.Get(index);
}
inline void TensorProto::set_half_val(int index, ::google::protobuf::int32 value) {
half_val_.Set(index, value);
// @@protoc_insertion_point(field_set:tensorflow.TensorProto.half_val)
// @@protoc_insertion_point(field_set:opencv_tensorflow.TensorProto.half_val)
}
inline void TensorProto::add_half_val(::google::protobuf::int32 value) {
half_val_.Add(value);
// @@protoc_insertion_point(field_add:tensorflow.TensorProto.half_val)
// @@protoc_insertion_point(field_add:opencv_tensorflow.TensorProto.half_val)
}
inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&
TensorProto::half_val() const {
// @@protoc_insertion_point(field_list:tensorflow.TensorProto.half_val)
// @@protoc_insertion_point(field_list:opencv_tensorflow.TensorProto.half_val)
return half_val_;
}
inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
TensorProto::mutable_half_val() {
// @@protoc_insertion_point(field_mutable_list:tensorflow.TensorProto.half_val)
// @@protoc_insertion_point(field_mutable_list:opencv_tensorflow.TensorProto.half_val)
return &half_val_;
}
@ -560,25 +560,25 @@ inline void TensorProto::clear_float_val() {
float_val_.Clear();
}
inline float TensorProto::float_val(int index) const {
// @@protoc_insertion_point(field_get:tensorflow.TensorProto.float_val)
// @@protoc_insertion_point(field_get:opencv_tensorflow.TensorProto.float_val)
return float_val_.Get(index);
}
inline void TensorProto::set_float_val(int index, float value) {
float_val_.Set(index, value);
// @@protoc_insertion_point(field_set:tensorflow.TensorProto.float_val)
// @@protoc_insertion_point(field_set:opencv_tensorflow.TensorProto.float_val)
}
inline void TensorProto::add_float_val(float value) {
float_val_.Add(value);
// @@protoc_insertion_point(field_add:tensorflow.TensorProto.float_val)
// @@protoc_insertion_point(field_add:opencv_tensorflow.TensorProto.float_val)
}
inline const ::google::protobuf::RepeatedField< float >&
TensorProto::float_val() const {
// @@protoc_insertion_point(field_list:tensorflow.TensorProto.float_val)
// @@protoc_insertion_point(field_list:opencv_tensorflow.TensorProto.float_val)
return float_val_;
}
inline ::google::protobuf::RepeatedField< float >*
TensorProto::mutable_float_val() {
// @@protoc_insertion_point(field_mutable_list:tensorflow.TensorProto.float_val)
// @@protoc_insertion_point(field_mutable_list:opencv_tensorflow.TensorProto.float_val)
return &float_val_;
}
@ -590,25 +590,25 @@ inline void TensorProto::clear_double_val() {
double_val_.Clear();
}
inline double TensorProto::double_val(int index) const {
// @@protoc_insertion_point(field_get:tensorflow.TensorProto.double_val)
// @@protoc_insertion_point(field_get:opencv_tensorflow.TensorProto.double_val)
return double_val_.Get(index);
}
inline void TensorProto::set_double_val(int index, double value) {
double_val_.Set(index, value);
// @@protoc_insertion_point(field_set:tensorflow.TensorProto.double_val)
// @@protoc_insertion_point(field_set:opencv_tensorflow.TensorProto.double_val)
}
inline void TensorProto::add_double_val(double value) {
double_val_.Add(value);
// @@protoc_insertion_point(field_add:tensorflow.TensorProto.double_val)
// @@protoc_insertion_point(field_add:opencv_tensorflow.TensorProto.double_val)
}
inline const ::google::protobuf::RepeatedField< double >&
TensorProto::double_val() const {
// @@protoc_insertion_point(field_list:tensorflow.TensorProto.double_val)
// @@protoc_insertion_point(field_list:opencv_tensorflow.TensorProto.double_val)
return double_val_;
}
inline ::google::protobuf::RepeatedField< double >*
TensorProto::mutable_double_val() {
// @@protoc_insertion_point(field_mutable_list:tensorflow.TensorProto.double_val)
// @@protoc_insertion_point(field_mutable_list:opencv_tensorflow.TensorProto.double_val)
return &double_val_;
}
@ -620,25 +620,25 @@ inline void TensorProto::clear_int_val() {
int_val_.Clear();
}
inline ::google::protobuf::int32 TensorProto::int_val(int index) const {
// @@protoc_insertion_point(field_get:tensorflow.TensorProto.int_val)
// @@protoc_insertion_point(field_get:opencv_tensorflow.TensorProto.int_val)
return int_val_.Get(index);
}
inline void TensorProto::set_int_val(int index, ::google::protobuf::int32 value) {
int_val_.Set(index, value);
// @@protoc_insertion_point(field_set:tensorflow.TensorProto.int_val)
// @@protoc_insertion_point(field_set:opencv_tensorflow.TensorProto.int_val)
}
inline void TensorProto::add_int_val(::google::protobuf::int32 value) {
int_val_.Add(value);
// @@protoc_insertion_point(field_add:tensorflow.TensorProto.int_val)
// @@protoc_insertion_point(field_add:opencv_tensorflow.TensorProto.int_val)
}
inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&
TensorProto::int_val() const {
// @@protoc_insertion_point(field_list:tensorflow.TensorProto.int_val)
// @@protoc_insertion_point(field_list:opencv_tensorflow.TensorProto.int_val)
return int_val_;
}
inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
TensorProto::mutable_int_val() {
// @@protoc_insertion_point(field_mutable_list:tensorflow.TensorProto.int_val)
// @@protoc_insertion_point(field_mutable_list:opencv_tensorflow.TensorProto.int_val)
return &int_val_;
}
@ -650,64 +650,64 @@ inline void TensorProto::clear_string_val() {
string_val_.Clear();
}
inline const ::std::string& TensorProto::string_val(int index) const {
// @@protoc_insertion_point(field_get:tensorflow.TensorProto.string_val)
// @@protoc_insertion_point(field_get:opencv_tensorflow.TensorProto.string_val)
return string_val_.Get(index);
}
inline ::std::string* TensorProto::mutable_string_val(int index) {
// @@protoc_insertion_point(field_mutable:tensorflow.TensorProto.string_val)
// @@protoc_insertion_point(field_mutable:opencv_tensorflow.TensorProto.string_val)
return string_val_.Mutable(index);
}
inline void TensorProto::set_string_val(int index, const ::std::string& value) {
// @@protoc_insertion_point(field_set:tensorflow.TensorProto.string_val)
// @@protoc_insertion_point(field_set:opencv_tensorflow.TensorProto.string_val)
string_val_.Mutable(index)->assign(value);
}
#if LANG_CXX11
inline void TensorProto::set_string_val(int index, ::std::string&& value) {
// @@protoc_insertion_point(field_set:tensorflow.TensorProto.string_val)
// @@protoc_insertion_point(field_set:opencv_tensorflow.TensorProto.string_val)
string_val_.Mutable(index)->assign(std::move(value));
}
#endif
inline void TensorProto::set_string_val(int index, const char* value) {
GOOGLE_DCHECK(value != NULL);
string_val_.Mutable(index)->assign(value);
// @@protoc_insertion_point(field_set_char:tensorflow.TensorProto.string_val)
// @@protoc_insertion_point(field_set_char:opencv_tensorflow.TensorProto.string_val)
}
inline void TensorProto::set_string_val(int index, const void* value, size_t size) {
string_val_.Mutable(index)->assign(
reinterpret_cast<const char*>(value), size);
// @@protoc_insertion_point(field_set_pointer:tensorflow.TensorProto.string_val)
// @@protoc_insertion_point(field_set_pointer:opencv_tensorflow.TensorProto.string_val)
}
inline ::std::string* TensorProto::add_string_val() {
// @@protoc_insertion_point(field_add_mutable:tensorflow.TensorProto.string_val)
// @@protoc_insertion_point(field_add_mutable:opencv_tensorflow.TensorProto.string_val)
return string_val_.Add();
}
inline void TensorProto::add_string_val(const ::std::string& value) {
string_val_.Add()->assign(value);
// @@protoc_insertion_point(field_add:tensorflow.TensorProto.string_val)
// @@protoc_insertion_point(field_add:opencv_tensorflow.TensorProto.string_val)
}
#if LANG_CXX11
inline void TensorProto::add_string_val(::std::string&& value) {
string_val_.Add(std::move(value));
// @@protoc_insertion_point(field_add:tensorflow.TensorProto.string_val)
// @@protoc_insertion_point(field_add:opencv_tensorflow.TensorProto.string_val)
}
#endif
inline void TensorProto::add_string_val(const char* value) {
GOOGLE_DCHECK(value != NULL);
string_val_.Add()->assign(value);
// @@protoc_insertion_point(field_add_char:tensorflow.TensorProto.string_val)
// @@protoc_insertion_point(field_add_char:opencv_tensorflow.TensorProto.string_val)
}
inline void TensorProto::add_string_val(const void* value, size_t size) {
string_val_.Add()->assign(reinterpret_cast<const char*>(value), size);
// @@protoc_insertion_point(field_add_pointer:tensorflow.TensorProto.string_val)
// @@protoc_insertion_point(field_add_pointer:opencv_tensorflow.TensorProto.string_val)
}
inline const ::google::protobuf::RepeatedPtrField< ::std::string>&
TensorProto::string_val() const {
// @@protoc_insertion_point(field_list:tensorflow.TensorProto.string_val)
// @@protoc_insertion_point(field_list:opencv_tensorflow.TensorProto.string_val)
return string_val_;
}
inline ::google::protobuf::RepeatedPtrField< ::std::string>*
TensorProto::mutable_string_val() {
// @@protoc_insertion_point(field_mutable_list:tensorflow.TensorProto.string_val)
// @@protoc_insertion_point(field_mutable_list:opencv_tensorflow.TensorProto.string_val)
return &string_val_;
}
@ -719,25 +719,25 @@ inline void TensorProto::clear_scomplex_val() {
scomplex_val_.Clear();
}
inline float TensorProto::scomplex_val(int index) const {
// @@protoc_insertion_point(field_get:tensorflow.TensorProto.scomplex_val)
// @@protoc_insertion_point(field_get:opencv_tensorflow.TensorProto.scomplex_val)
return scomplex_val_.Get(index);
}
inline void TensorProto::set_scomplex_val(int index, float value) {
scomplex_val_.Set(index, value);
// @@protoc_insertion_point(field_set:tensorflow.TensorProto.scomplex_val)
// @@protoc_insertion_point(field_set:opencv_tensorflow.TensorProto.scomplex_val)
}
inline void TensorProto::add_scomplex_val(float value) {
scomplex_val_.Add(value);
// @@protoc_insertion_point(field_add:tensorflow.TensorProto.scomplex_val)
// @@protoc_insertion_point(field_add:opencv_tensorflow.TensorProto.scomplex_val)
}
inline const ::google::protobuf::RepeatedField< float >&
TensorProto::scomplex_val() const {
// @@protoc_insertion_point(field_list:tensorflow.TensorProto.scomplex_val)
// @@protoc_insertion_point(field_list:opencv_tensorflow.TensorProto.scomplex_val)
return scomplex_val_;
}
inline ::google::protobuf::RepeatedField< float >*
TensorProto::mutable_scomplex_val() {
// @@protoc_insertion_point(field_mutable_list:tensorflow.TensorProto.scomplex_val)
// @@protoc_insertion_point(field_mutable_list:opencv_tensorflow.TensorProto.scomplex_val)
return &scomplex_val_;
}
@ -749,25 +749,25 @@ inline void TensorProto::clear_int64_val() {
int64_val_.Clear();
}
inline ::google::protobuf::int64 TensorProto::int64_val(int index) const {
// @@protoc_insertion_point(field_get:tensorflow.TensorProto.int64_val)
// @@protoc_insertion_point(field_get:opencv_tensorflow.TensorProto.int64_val)
return int64_val_.Get(index);
}
inline void TensorProto::set_int64_val(int index, ::google::protobuf::int64 value) {
int64_val_.Set(index, value);
// @@protoc_insertion_point(field_set:tensorflow.TensorProto.int64_val)
// @@protoc_insertion_point(field_set:opencv_tensorflow.TensorProto.int64_val)
}
inline void TensorProto::add_int64_val(::google::protobuf::int64 value) {
int64_val_.Add(value);
// @@protoc_insertion_point(field_add:tensorflow.TensorProto.int64_val)
// @@protoc_insertion_point(field_add:opencv_tensorflow.TensorProto.int64_val)
}
inline const ::google::protobuf::RepeatedField< ::google::protobuf::int64 >&
TensorProto::int64_val() const {
// @@protoc_insertion_point(field_list:tensorflow.TensorProto.int64_val)
// @@protoc_insertion_point(field_list:opencv_tensorflow.TensorProto.int64_val)
return int64_val_;
}
inline ::google::protobuf::RepeatedField< ::google::protobuf::int64 >*
TensorProto::mutable_int64_val() {
// @@protoc_insertion_point(field_mutable_list:tensorflow.TensorProto.int64_val)
// @@protoc_insertion_point(field_mutable_list:opencv_tensorflow.TensorProto.int64_val)
return &int64_val_;
}
@ -779,25 +779,25 @@ inline void TensorProto::clear_bool_val() {
bool_val_.Clear();
}
inline bool TensorProto::bool_val(int index) const {
// @@protoc_insertion_point(field_get:tensorflow.TensorProto.bool_val)
// @@protoc_insertion_point(field_get:opencv_tensorflow.TensorProto.bool_val)
return bool_val_.Get(index);
}
inline void TensorProto::set_bool_val(int index, bool value) {
bool_val_.Set(index, value);
// @@protoc_insertion_point(field_set:tensorflow.TensorProto.bool_val)
// @@protoc_insertion_point(field_set:opencv_tensorflow.TensorProto.bool_val)
}
inline void TensorProto::add_bool_val(bool value) {
bool_val_.Add(value);
// @@protoc_insertion_point(field_add:tensorflow.TensorProto.bool_val)
// @@protoc_insertion_point(field_add:opencv_tensorflow.TensorProto.bool_val)
}
inline const ::google::protobuf::RepeatedField< bool >&
TensorProto::bool_val() const {
// @@protoc_insertion_point(field_list:tensorflow.TensorProto.bool_val)
// @@protoc_insertion_point(field_list:opencv_tensorflow.TensorProto.bool_val)
return bool_val_;
}
inline ::google::protobuf::RepeatedField< bool >*
TensorProto::mutable_bool_val() {
// @@protoc_insertion_point(field_mutable_list:tensorflow.TensorProto.bool_val)
// @@protoc_insertion_point(field_mutable_list:opencv_tensorflow.TensorProto.bool_val)
return &bool_val_;
}
@ -809,25 +809,25 @@ inline void TensorProto::clear_dcomplex_val() {
dcomplex_val_.Clear();
}
inline double TensorProto::dcomplex_val(int index) const {
// @@protoc_insertion_point(field_get:tensorflow.TensorProto.dcomplex_val)
// @@protoc_insertion_point(field_get:opencv_tensorflow.TensorProto.dcomplex_val)
return dcomplex_val_.Get(index);
}
inline void TensorProto::set_dcomplex_val(int index, double value) {
dcomplex_val_.Set(index, value);
// @@protoc_insertion_point(field_set:tensorflow.TensorProto.dcomplex_val)
// @@protoc_insertion_point(field_set:opencv_tensorflow.TensorProto.dcomplex_val)
}
inline void TensorProto::add_dcomplex_val(double value) {
dcomplex_val_.Add(value);
// @@protoc_insertion_point(field_add:tensorflow.TensorProto.dcomplex_val)
// @@protoc_insertion_point(field_add:opencv_tensorflow.TensorProto.dcomplex_val)
}
inline const ::google::protobuf::RepeatedField< double >&
TensorProto::dcomplex_val() const {
// @@protoc_insertion_point(field_list:tensorflow.TensorProto.dcomplex_val)
// @@protoc_insertion_point(field_list:opencv_tensorflow.TensorProto.dcomplex_val)
return dcomplex_val_;
}
inline ::google::protobuf::RepeatedField< double >*
TensorProto::mutable_dcomplex_val() {
// @@protoc_insertion_point(field_mutable_list:tensorflow.TensorProto.dcomplex_val)
// @@protoc_insertion_point(field_mutable_list:opencv_tensorflow.TensorProto.dcomplex_val)
return &dcomplex_val_;
}
@ -837,7 +837,7 @@ TensorProto::mutable_dcomplex_val() {
// @@protoc_insertion_point(namespace_scope)
} // namespace tensorflow
} // namespace opencv_tensorflow
// @@protoc_insertion_point(global_scope)

View File

@ -19,7 +19,7 @@
#include "third_party/protobuf/version.h"
#endif
// @@protoc_insertion_point(includes)
namespace tensorflow {
namespace opencv_tensorflow {
class TensorShapeProto_DimDefaultTypeInternal {
public:
::google::protobuf::internal::ExplicitlyConstructed<TensorShapeProto_Dim>
@ -30,7 +30,7 @@ class TensorShapeProtoDefaultTypeInternal {
::google::protobuf::internal::ExplicitlyConstructed<TensorShapeProto>
_instance;
} _TensorShapeProto_default_instance_;
} // namespace tensorflow
} // namespace opencv_tensorflow
namespace protobuf_tensor_5fshape_2eproto {
void InitDefaultsTensorShapeProto_DimImpl() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
@ -41,11 +41,11 @@ void InitDefaultsTensorShapeProto_DimImpl() {
::google::protobuf::internal::InitProtobufDefaults();
#endif // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
{
void* ptr = &::tensorflow::_TensorShapeProto_Dim_default_instance_;
new (ptr) ::tensorflow::TensorShapeProto_Dim();
void* ptr = &::opencv_tensorflow::_TensorShapeProto_Dim_default_instance_;
new (ptr) ::opencv_tensorflow::TensorShapeProto_Dim();
::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
}
::tensorflow::TensorShapeProto_Dim::InitAsDefaultInstance();
::opencv_tensorflow::TensorShapeProto_Dim::InitAsDefaultInstance();
}
void InitDefaultsTensorShapeProto_Dim() {
@ -63,11 +63,11 @@ void InitDefaultsTensorShapeProtoImpl() {
#endif // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
protobuf_tensor_5fshape_2eproto::InitDefaultsTensorShapeProto_Dim();
{
void* ptr = &::tensorflow::_TensorShapeProto_default_instance_;
new (ptr) ::tensorflow::TensorShapeProto();
void* ptr = &::opencv_tensorflow::_TensorShapeProto_default_instance_;
new (ptr) ::opencv_tensorflow::TensorShapeProto();
::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
}
::tensorflow::TensorShapeProto::InitAsDefaultInstance();
::opencv_tensorflow::TensorShapeProto::InitAsDefaultInstance();
}
void InitDefaultsTensorShapeProto() {
@ -79,28 +79,28 @@ void InitDefaultsTensorShapeProto() {
const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
~0u, // no _has_bits_
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tensorflow::TensorShapeProto_Dim, _internal_metadata_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::TensorShapeProto_Dim, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tensorflow::TensorShapeProto_Dim, size_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tensorflow::TensorShapeProto_Dim, name_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::TensorShapeProto_Dim, size_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::TensorShapeProto_Dim, name_),
~0u, // no _has_bits_
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tensorflow::TensorShapeProto, _internal_metadata_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::TensorShapeProto, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tensorflow::TensorShapeProto, dim_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tensorflow::TensorShapeProto, unknown_rank_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::TensorShapeProto, dim_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::TensorShapeProto, unknown_rank_),
};
static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
{ 0, -1, sizeof(::tensorflow::TensorShapeProto_Dim)},
{ 7, -1, sizeof(::tensorflow::TensorShapeProto)},
{ 0, -1, sizeof(::opencv_tensorflow::TensorShapeProto_Dim)},
{ 7, -1, sizeof(::opencv_tensorflow::TensorShapeProto)},
};
static ::google::protobuf::Message const * const file_default_instances[] = {
reinterpret_cast<const ::google::protobuf::Message*>(&::tensorflow::_TensorShapeProto_Dim_default_instance_),
reinterpret_cast<const ::google::protobuf::Message*>(&::tensorflow::_TensorShapeProto_default_instance_),
reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_tensorflow::_TensorShapeProto_Dim_default_instance_),
reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_tensorflow::_TensorShapeProto_default_instance_),
};
void protobuf_AssignDescriptors() {
@ -125,15 +125,15 @@ void protobuf_RegisterTypes(const ::std::string&) {
void AddDescriptorsImpl() {
InitDefaults();
static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
"\n\022tensor_shape.proto\022\ntensorflow\"z\n\020Tens"
"orShapeProto\022-\n\003dim\030\002 \003(\0132 .tensorflow.T"
"ensorShapeProto.Dim\022\024\n\014unknown_rank\030\003 \001("
"\010\032!\n\003Dim\022\014\n\004size\030\001 \001(\003\022\014\n\004name\030\002 \001(\tB2\n\030"
"org.tensorflow.frameworkB\021TensorShapePro"
"tosP\001\370\001\001b\006proto3"
"\n\022tensor_shape.proto\022\021opencv_tensorflow\""
"\201\001\n\020TensorShapeProto\0224\n\003dim\030\002 \003(\0132\'.open"
"cv_tensorflow.TensorShapeProto.Dim\022\024\n\014un"
"known_rank\030\003 \001(\010\032!\n\003Dim\022\014\n\004size\030\001 \001(\003\022\014\n"
"\004name\030\002 \001(\tB2\n\030org.tensorflow.frameworkB"
"\021TensorShapeProtosP\001\370\001\001b\006proto3"
};
::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
descriptor, 216);
descriptor, 231);
::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
"tensor_shape.proto", &protobuf_RegisterTypes);
}
@ -149,7 +149,7 @@ struct StaticDescriptorInitializer {
}
} static_descriptor_initializer;
} // namespace protobuf_tensor_5fshape_2eproto
namespace tensorflow {
namespace opencv_tensorflow {
// ===================================================================
@ -166,7 +166,7 @@ TensorShapeProto_Dim::TensorShapeProto_Dim()
::protobuf_tensor_5fshape_2eproto::InitDefaultsTensorShapeProto_Dim();
}
SharedCtor();
// @@protoc_insertion_point(constructor:tensorflow.TensorShapeProto.Dim)
// @@protoc_insertion_point(constructor:opencv_tensorflow.TensorShapeProto.Dim)
}
TensorShapeProto_Dim::TensorShapeProto_Dim(::google::protobuf::Arena* arena)
: ::google::protobuf::Message(),
@ -174,7 +174,7 @@ TensorShapeProto_Dim::TensorShapeProto_Dim(::google::protobuf::Arena* arena)
::protobuf_tensor_5fshape_2eproto::InitDefaultsTensorShapeProto_Dim();
SharedCtor();
RegisterArenaDtor(arena);
// @@protoc_insertion_point(arena_constructor:tensorflow.TensorShapeProto.Dim)
// @@protoc_insertion_point(arena_constructor:opencv_tensorflow.TensorShapeProto.Dim)
}
TensorShapeProto_Dim::TensorShapeProto_Dim(const TensorShapeProto_Dim& from)
: ::google::protobuf::Message(),
@ -187,7 +187,7 @@ TensorShapeProto_Dim::TensorShapeProto_Dim(const TensorShapeProto_Dim& from)
GetArenaNoVirtual());
}
size_ = from.size_;
// @@protoc_insertion_point(copy_constructor:tensorflow.TensorShapeProto.Dim)
// @@protoc_insertion_point(copy_constructor:opencv_tensorflow.TensorShapeProto.Dim)
}
void TensorShapeProto_Dim::SharedCtor() {
@ -197,7 +197,7 @@ void TensorShapeProto_Dim::SharedCtor() {
}
TensorShapeProto_Dim::~TensorShapeProto_Dim() {
// @@protoc_insertion_point(destructor:tensorflow.TensorShapeProto.Dim)
// @@protoc_insertion_point(destructor:opencv_tensorflow.TensorShapeProto.Dim)
SharedDtor();
}
@ -232,7 +232,7 @@ TensorShapeProto_Dim* TensorShapeProto_Dim::New(::google::protobuf::Arena* arena
}
void TensorShapeProto_Dim::Clear() {
// @@protoc_insertion_point(message_clear_start:tensorflow.TensorShapeProto.Dim)
// @@protoc_insertion_point(message_clear_start:opencv_tensorflow.TensorShapeProto.Dim)
::google::protobuf::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
@ -246,7 +246,7 @@ bool TensorShapeProto_Dim::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
::google::protobuf::uint32 tag;
// @@protoc_insertion_point(parse_start:tensorflow.TensorShapeProto.Dim)
// @@protoc_insertion_point(parse_start:opencv_tensorflow.TensorShapeProto.Dim)
for (;;) {
::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
tag = p.first;
@ -275,7 +275,7 @@ bool TensorShapeProto_Dim::MergePartialFromCodedStream(
DO_(::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
this->name().data(), static_cast<int>(this->name().length()),
::google::protobuf::internal::WireFormatLite::PARSE,
"tensorflow.TensorShapeProto.Dim.name"));
"opencv_tensorflow.TensorShapeProto.Dim.name"));
} else {
goto handle_unusual;
}
@ -294,17 +294,17 @@ bool TensorShapeProto_Dim::MergePartialFromCodedStream(
}
}
success:
// @@protoc_insertion_point(parse_success:tensorflow.TensorShapeProto.Dim)
// @@protoc_insertion_point(parse_success:opencv_tensorflow.TensorShapeProto.Dim)
return true;
failure:
// @@protoc_insertion_point(parse_failure:tensorflow.TensorShapeProto.Dim)
// @@protoc_insertion_point(parse_failure:opencv_tensorflow.TensorShapeProto.Dim)
return false;
#undef DO_
}
void TensorShapeProto_Dim::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// @@protoc_insertion_point(serialize_start:tensorflow.TensorShapeProto.Dim)
// @@protoc_insertion_point(serialize_start:opencv_tensorflow.TensorShapeProto.Dim)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
@ -318,7 +318,7 @@ void TensorShapeProto_Dim::SerializeWithCachedSizes(
::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
this->name().data(), static_cast<int>(this->name().length()),
::google::protobuf::internal::WireFormatLite::SERIALIZE,
"tensorflow.TensorShapeProto.Dim.name");
"opencv_tensorflow.TensorShapeProto.Dim.name");
::google::protobuf::internal::WireFormatLite::WriteStringMaybeAliased(
2, this->name(), output);
}
@ -327,13 +327,13 @@ void TensorShapeProto_Dim::SerializeWithCachedSizes(
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
(::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output);
}
// @@protoc_insertion_point(serialize_end:tensorflow.TensorShapeProto.Dim)
// @@protoc_insertion_point(serialize_end:opencv_tensorflow.TensorShapeProto.Dim)
}
::google::protobuf::uint8* TensorShapeProto_Dim::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
(void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:tensorflow.TensorShapeProto.Dim)
// @@protoc_insertion_point(serialize_to_array_start:opencv_tensorflow.TensorShapeProto.Dim)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
@ -347,7 +347,7 @@ void TensorShapeProto_Dim::SerializeWithCachedSizes(
::google::protobuf::internal::WireFormatLite::VerifyUtf8String(
this->name().data(), static_cast<int>(this->name().length()),
::google::protobuf::internal::WireFormatLite::SERIALIZE,
"tensorflow.TensorShapeProto.Dim.name");
"opencv_tensorflow.TensorShapeProto.Dim.name");
target =
::google::protobuf::internal::WireFormatLite::WriteStringToArray(
2, this->name(), target);
@ -357,12 +357,12 @@ void TensorShapeProto_Dim::SerializeWithCachedSizes(
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
(::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target);
}
// @@protoc_insertion_point(serialize_to_array_end:tensorflow.TensorShapeProto.Dim)
// @@protoc_insertion_point(serialize_to_array_end:opencv_tensorflow.TensorShapeProto.Dim)
return target;
}
size_t TensorShapeProto_Dim::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:tensorflow.TensorShapeProto.Dim)
// @@protoc_insertion_point(message_byte_size_start:opencv_tensorflow.TensorShapeProto.Dim)
size_t total_size = 0;
if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
@ -392,22 +392,22 @@ size_t TensorShapeProto_Dim::ByteSizeLong() const {
}
void TensorShapeProto_Dim::MergeFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:tensorflow.TensorShapeProto.Dim)
// @@protoc_insertion_point(generalized_merge_from_start:opencv_tensorflow.TensorShapeProto.Dim)
GOOGLE_DCHECK_NE(&from, this);
const TensorShapeProto_Dim* source =
::google::protobuf::internal::DynamicCastToGenerated<const TensorShapeProto_Dim>(
&from);
if (source == NULL) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:tensorflow.TensorShapeProto.Dim)
// @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_tensorflow.TensorShapeProto.Dim)
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:tensorflow.TensorShapeProto.Dim)
// @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_tensorflow.TensorShapeProto.Dim)
MergeFrom(*source);
}
}
void TensorShapeProto_Dim::MergeFrom(const TensorShapeProto_Dim& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.TensorShapeProto.Dim)
// @@protoc_insertion_point(class_specific_merge_from_start:opencv_tensorflow.TensorShapeProto.Dim)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::google::protobuf::uint32 cached_has_bits = 0;
@ -422,14 +422,14 @@ void TensorShapeProto_Dim::MergeFrom(const TensorShapeProto_Dim& from) {
}
void TensorShapeProto_Dim::CopyFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:tensorflow.TensorShapeProto.Dim)
// @@protoc_insertion_point(generalized_copy_from_start:opencv_tensorflow.TensorShapeProto.Dim)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void TensorShapeProto_Dim::CopyFrom(const TensorShapeProto_Dim& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.TensorShapeProto.Dim)
// @@protoc_insertion_point(class_specific_copy_from_start:opencv_tensorflow.TensorShapeProto.Dim)
if (&from == this) return;
Clear();
MergeFrom(from);
@ -487,7 +487,7 @@ TensorShapeProto::TensorShapeProto()
::protobuf_tensor_5fshape_2eproto::InitDefaultsTensorShapeProto();
}
SharedCtor();
// @@protoc_insertion_point(constructor:tensorflow.TensorShapeProto)
// @@protoc_insertion_point(constructor:opencv_tensorflow.TensorShapeProto)
}
TensorShapeProto::TensorShapeProto(::google::protobuf::Arena* arena)
: ::google::protobuf::Message(),
@ -496,7 +496,7 @@ TensorShapeProto::TensorShapeProto(::google::protobuf::Arena* arena)
::protobuf_tensor_5fshape_2eproto::InitDefaultsTensorShapeProto();
SharedCtor();
RegisterArenaDtor(arena);
// @@protoc_insertion_point(arena_constructor:tensorflow.TensorShapeProto)
// @@protoc_insertion_point(arena_constructor:opencv_tensorflow.TensorShapeProto)
}
TensorShapeProto::TensorShapeProto(const TensorShapeProto& from)
: ::google::protobuf::Message(),
@ -505,7 +505,7 @@ TensorShapeProto::TensorShapeProto(const TensorShapeProto& from)
_cached_size_(0) {
_internal_metadata_.MergeFrom(from._internal_metadata_);
unknown_rank_ = from.unknown_rank_;
// @@protoc_insertion_point(copy_constructor:tensorflow.TensorShapeProto)
// @@protoc_insertion_point(copy_constructor:opencv_tensorflow.TensorShapeProto)
}
void TensorShapeProto::SharedCtor() {
@ -514,7 +514,7 @@ void TensorShapeProto::SharedCtor() {
}
TensorShapeProto::~TensorShapeProto() {
// @@protoc_insertion_point(destructor:tensorflow.TensorShapeProto)
// @@protoc_insertion_point(destructor:opencv_tensorflow.TensorShapeProto)
SharedDtor();
}
@ -548,7 +548,7 @@ TensorShapeProto* TensorShapeProto::New(::google::protobuf::Arena* arena) const
}
void TensorShapeProto::Clear() {
// @@protoc_insertion_point(message_clear_start:tensorflow.TensorShapeProto)
// @@protoc_insertion_point(message_clear_start:opencv_tensorflow.TensorShapeProto)
::google::protobuf::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
@ -562,13 +562,13 @@ bool TensorShapeProto::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
::google::protobuf::uint32 tag;
// @@protoc_insertion_point(parse_start:tensorflow.TensorShapeProto)
// @@protoc_insertion_point(parse_start:opencv_tensorflow.TensorShapeProto)
for (;;) {
::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
tag = p.first;
if (!p.second) goto handle_unusual;
switch (::google::protobuf::internal::WireFormatLite::GetTagFieldNumber(tag)) {
// repeated .tensorflow.TensorShapeProto.Dim dim = 2;
// repeated .opencv_tensorflow.TensorShapeProto.Dim dim = 2;
case 2: {
if (static_cast< ::google::protobuf::uint8>(tag) ==
static_cast< ::google::protobuf::uint8>(18u /* 18 & 0xFF */)) {
@ -605,21 +605,21 @@ bool TensorShapeProto::MergePartialFromCodedStream(
}
}
success:
// @@protoc_insertion_point(parse_success:tensorflow.TensorShapeProto)
// @@protoc_insertion_point(parse_success:opencv_tensorflow.TensorShapeProto)
return true;
failure:
// @@protoc_insertion_point(parse_failure:tensorflow.TensorShapeProto)
// @@protoc_insertion_point(parse_failure:opencv_tensorflow.TensorShapeProto)
return false;
#undef DO_
}
void TensorShapeProto::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// @@protoc_insertion_point(serialize_start:tensorflow.TensorShapeProto)
// @@protoc_insertion_point(serialize_start:opencv_tensorflow.TensorShapeProto)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// repeated .tensorflow.TensorShapeProto.Dim dim = 2;
// repeated .opencv_tensorflow.TensorShapeProto.Dim dim = 2;
for (unsigned int i = 0,
n = static_cast<unsigned int>(this->dim_size()); i < n; i++) {
::google::protobuf::internal::WireFormatLite::WriteMessageMaybeToArray(
@ -635,17 +635,17 @@ void TensorShapeProto::SerializeWithCachedSizes(
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
(::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output);
}
// @@protoc_insertion_point(serialize_end:tensorflow.TensorShapeProto)
// @@protoc_insertion_point(serialize_end:opencv_tensorflow.TensorShapeProto)
}
::google::protobuf::uint8* TensorShapeProto::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
(void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:tensorflow.TensorShapeProto)
// @@protoc_insertion_point(serialize_to_array_start:opencv_tensorflow.TensorShapeProto)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
// repeated .tensorflow.TensorShapeProto.Dim dim = 2;
// repeated .opencv_tensorflow.TensorShapeProto.Dim dim = 2;
for (unsigned int i = 0,
n = static_cast<unsigned int>(this->dim_size()); i < n; i++) {
target = ::google::protobuf::internal::WireFormatLite::
@ -662,12 +662,12 @@ void TensorShapeProto::SerializeWithCachedSizes(
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
(::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target);
}
// @@protoc_insertion_point(serialize_to_array_end:tensorflow.TensorShapeProto)
// @@protoc_insertion_point(serialize_to_array_end:opencv_tensorflow.TensorShapeProto)
return target;
}
size_t TensorShapeProto::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:tensorflow.TensorShapeProto)
// @@protoc_insertion_point(message_byte_size_start:opencv_tensorflow.TensorShapeProto)
size_t total_size = 0;
if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
@ -675,7 +675,7 @@ size_t TensorShapeProto::ByteSizeLong() const {
::google::protobuf::internal::WireFormat::ComputeUnknownFieldsSize(
(::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()));
}
// repeated .tensorflow.TensorShapeProto.Dim dim = 2;
// repeated .opencv_tensorflow.TensorShapeProto.Dim dim = 2;
{
unsigned int count = static_cast<unsigned int>(this->dim_size());
total_size += 1UL * count;
@ -699,22 +699,22 @@ size_t TensorShapeProto::ByteSizeLong() const {
}
void TensorShapeProto::MergeFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:tensorflow.TensorShapeProto)
// @@protoc_insertion_point(generalized_merge_from_start:opencv_tensorflow.TensorShapeProto)
GOOGLE_DCHECK_NE(&from, this);
const TensorShapeProto* source =
::google::protobuf::internal::DynamicCastToGenerated<const TensorShapeProto>(
&from);
if (source == NULL) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:tensorflow.TensorShapeProto)
// @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_tensorflow.TensorShapeProto)
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:tensorflow.TensorShapeProto)
// @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_tensorflow.TensorShapeProto)
MergeFrom(*source);
}
}
void TensorShapeProto::MergeFrom(const TensorShapeProto& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.TensorShapeProto)
// @@protoc_insertion_point(class_specific_merge_from_start:opencv_tensorflow.TensorShapeProto)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::google::protobuf::uint32 cached_has_bits = 0;
@ -727,14 +727,14 @@ void TensorShapeProto::MergeFrom(const TensorShapeProto& from) {
}
void TensorShapeProto::CopyFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:tensorflow.TensorShapeProto)
// @@protoc_insertion_point(generalized_copy_from_start:opencv_tensorflow.TensorShapeProto)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void TensorShapeProto::CopyFrom(const TensorShapeProto& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.TensorShapeProto)
// @@protoc_insertion_point(class_specific_copy_from_start:opencv_tensorflow.TensorShapeProto)
if (&from == this) return;
Clear();
MergeFrom(from);
@ -778,6 +778,6 @@ void TensorShapeProto::InternalSwap(TensorShapeProto* other) {
// @@protoc_insertion_point(namespace_scope)
} // namespace tensorflow
} // namespace opencv_tensorflow
// @@protoc_insertion_point(global_scope)

View File

@ -51,19 +51,19 @@ inline void InitDefaults() {
InitDefaultsTensorShapeProto();
}
} // namespace protobuf_tensor_5fshape_2eproto
namespace tensorflow {
namespace opencv_tensorflow {
class TensorShapeProto;
class TensorShapeProtoDefaultTypeInternal;
extern TensorShapeProtoDefaultTypeInternal _TensorShapeProto_default_instance_;
class TensorShapeProto_Dim;
class TensorShapeProto_DimDefaultTypeInternal;
extern TensorShapeProto_DimDefaultTypeInternal _TensorShapeProto_Dim_default_instance_;
} // namespace tensorflow
namespace tensorflow {
} // namespace opencv_tensorflow
namespace opencv_tensorflow {
// ===================================================================
class TensorShapeProto_Dim : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:tensorflow.TensorShapeProto.Dim) */ {
class TensorShapeProto_Dim : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_tensorflow.TensorShapeProto.Dim) */ {
public:
TensorShapeProto_Dim();
virtual ~TensorShapeProto_Dim();
@ -186,7 +186,7 @@ class TensorShapeProto_Dim : public ::google::protobuf::Message /* @@protoc_inse
::google::protobuf::int64 size() const;
void set_size(::google::protobuf::int64 value);
// @@protoc_insertion_point(class_scope:tensorflow.TensorShapeProto.Dim)
// @@protoc_insertion_point(class_scope:opencv_tensorflow.TensorShapeProto.Dim)
private:
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
@ -201,7 +201,7 @@ class TensorShapeProto_Dim : public ::google::protobuf::Message /* @@protoc_inse
};
// -------------------------------------------------------------------
class TensorShapeProto : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:tensorflow.TensorShapeProto) */ {
class TensorShapeProto : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_tensorflow.TensorShapeProto) */ {
public:
TensorShapeProto();
virtual ~TensorShapeProto();
@ -297,16 +297,16 @@ class TensorShapeProto : public ::google::protobuf::Message /* @@protoc_insertio
// accessors -------------------------------------------------------
// repeated .tensorflow.TensorShapeProto.Dim dim = 2;
// repeated .opencv_tensorflow.TensorShapeProto.Dim dim = 2;
int dim_size() const;
void clear_dim();
static const int kDimFieldNumber = 2;
const ::tensorflow::TensorShapeProto_Dim& dim(int index) const;
::tensorflow::TensorShapeProto_Dim* mutable_dim(int index);
::tensorflow::TensorShapeProto_Dim* add_dim();
::google::protobuf::RepeatedPtrField< ::tensorflow::TensorShapeProto_Dim >*
const ::opencv_tensorflow::TensorShapeProto_Dim& dim(int index) const;
::opencv_tensorflow::TensorShapeProto_Dim* mutable_dim(int index);
::opencv_tensorflow::TensorShapeProto_Dim* add_dim();
::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::TensorShapeProto_Dim >*
mutable_dim();
const ::google::protobuf::RepeatedPtrField< ::tensorflow::TensorShapeProto_Dim >&
const ::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::TensorShapeProto_Dim >&
dim() const;
// bool unknown_rank = 3;
@ -315,14 +315,14 @@ class TensorShapeProto : public ::google::protobuf::Message /* @@protoc_insertio
bool unknown_rank() const;
void set_unknown_rank(bool value);
// @@protoc_insertion_point(class_scope:tensorflow.TensorShapeProto)
// @@protoc_insertion_point(class_scope:opencv_tensorflow.TensorShapeProto)
private:
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
template <typename T> friend class ::google::protobuf::Arena::InternalHelper;
typedef void InternalArenaConstructable_;
typedef void DestructorSkippable_;
::google::protobuf::RepeatedPtrField< ::tensorflow::TensorShapeProto_Dim > dim_;
::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::TensorShapeProto_Dim > dim_;
bool unknown_rank_;
mutable int _cached_size_;
friend struct ::protobuf_tensor_5fshape_2eproto::TableStruct;
@ -344,13 +344,13 @@ inline void TensorShapeProto_Dim::clear_size() {
size_ = GOOGLE_LONGLONG(0);
}
inline ::google::protobuf::int64 TensorShapeProto_Dim::size() const {
// @@protoc_insertion_point(field_get:tensorflow.TensorShapeProto.Dim.size)
// @@protoc_insertion_point(field_get:opencv_tensorflow.TensorShapeProto.Dim.size)
return size_;
}
inline void TensorShapeProto_Dim::set_size(::google::protobuf::int64 value) {
size_ = value;
// @@protoc_insertion_point(field_set:tensorflow.TensorShapeProto.Dim.size)
// @@protoc_insertion_point(field_set:opencv_tensorflow.TensorShapeProto.Dim.size)
}
// string name = 2;
@ -358,20 +358,20 @@ inline void TensorShapeProto_Dim::clear_name() {
name_.ClearToEmpty(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
inline const ::std::string& TensorShapeProto_Dim::name() const {
// @@protoc_insertion_point(field_get:tensorflow.TensorShapeProto.Dim.name)
// @@protoc_insertion_point(field_get:opencv_tensorflow.TensorShapeProto.Dim.name)
return name_.Get();
}
inline void TensorShapeProto_Dim::set_name(const ::std::string& value) {
name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), value, GetArenaNoVirtual());
// @@protoc_insertion_point(field_set:tensorflow.TensorShapeProto.Dim.name)
// @@protoc_insertion_point(field_set:opencv_tensorflow.TensorShapeProto.Dim.name)
}
#if LANG_CXX11
inline void TensorShapeProto_Dim::set_name(::std::string&& value) {
name_.Set(
&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::move(value), GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_rvalue:tensorflow.TensorShapeProto.Dim.name)
// @@protoc_insertion_point(field_set_rvalue:opencv_tensorflow.TensorShapeProto.Dim.name)
}
#endif
inline void TensorShapeProto_Dim::set_name(const char* value) {
@ -379,22 +379,22 @@ inline void TensorShapeProto_Dim::set_name(const char* value) {
name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(value),
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_char:tensorflow.TensorShapeProto.Dim.name)
// @@protoc_insertion_point(field_set_char:opencv_tensorflow.TensorShapeProto.Dim.name)
}
inline void TensorShapeProto_Dim::set_name(const char* value,
size_t size) {
name_.Set(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), ::std::string(
reinterpret_cast<const char*>(value), size), GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_pointer:tensorflow.TensorShapeProto.Dim.name)
// @@protoc_insertion_point(field_set_pointer:opencv_tensorflow.TensorShapeProto.Dim.name)
}
inline ::std::string* TensorShapeProto_Dim::mutable_name() {
// @@protoc_insertion_point(field_mutable:tensorflow.TensorShapeProto.Dim.name)
// @@protoc_insertion_point(field_mutable:opencv_tensorflow.TensorShapeProto.Dim.name)
return name_.Mutable(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
inline ::std::string* TensorShapeProto_Dim::release_name() {
// @@protoc_insertion_point(field_release:tensorflow.TensorShapeProto.Dim.name)
// @@protoc_insertion_point(field_release:opencv_tensorflow.TensorShapeProto.Dim.name)
return name_.Release(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), GetArenaNoVirtual());
}
@ -406,10 +406,10 @@ inline void TensorShapeProto_Dim::set_allocated_name(::std::string* name) {
}
name_.SetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(), name,
GetArenaNoVirtual());
// @@protoc_insertion_point(field_set_allocated:tensorflow.TensorShapeProto.Dim.name)
// @@protoc_insertion_point(field_set_allocated:opencv_tensorflow.TensorShapeProto.Dim.name)
}
inline ::std::string* TensorShapeProto_Dim::unsafe_arena_release_name() {
// @@protoc_insertion_point(field_unsafe_arena_release:tensorflow.TensorShapeProto.Dim.name)
// @@protoc_insertion_point(field_unsafe_arena_release:opencv_tensorflow.TensorShapeProto.Dim.name)
GOOGLE_DCHECK(GetArenaNoVirtual() != NULL);
return name_.UnsafeArenaRelease(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
@ -425,40 +425,40 @@ inline void TensorShapeProto_Dim::unsafe_arena_set_allocated_name(
}
name_.UnsafeArenaSetAllocated(&::google::protobuf::internal::GetEmptyStringAlreadyInited(),
name, GetArenaNoVirtual());
// @@protoc_insertion_point(field_unsafe_arena_set_allocated:tensorflow.TensorShapeProto.Dim.name)
// @@protoc_insertion_point(field_unsafe_arena_set_allocated:opencv_tensorflow.TensorShapeProto.Dim.name)
}
// -------------------------------------------------------------------
// TensorShapeProto
// repeated .tensorflow.TensorShapeProto.Dim dim = 2;
// repeated .opencv_tensorflow.TensorShapeProto.Dim dim = 2;
inline int TensorShapeProto::dim_size() const {
return dim_.size();
}
inline void TensorShapeProto::clear_dim() {
dim_.Clear();
}
inline const ::tensorflow::TensorShapeProto_Dim& TensorShapeProto::dim(int index) const {
// @@protoc_insertion_point(field_get:tensorflow.TensorShapeProto.dim)
inline const ::opencv_tensorflow::TensorShapeProto_Dim& TensorShapeProto::dim(int index) const {
// @@protoc_insertion_point(field_get:opencv_tensorflow.TensorShapeProto.dim)
return dim_.Get(index);
}
inline ::tensorflow::TensorShapeProto_Dim* TensorShapeProto::mutable_dim(int index) {
// @@protoc_insertion_point(field_mutable:tensorflow.TensorShapeProto.dim)
inline ::opencv_tensorflow::TensorShapeProto_Dim* TensorShapeProto::mutable_dim(int index) {
// @@protoc_insertion_point(field_mutable:opencv_tensorflow.TensorShapeProto.dim)
return dim_.Mutable(index);
}
inline ::tensorflow::TensorShapeProto_Dim* TensorShapeProto::add_dim() {
// @@protoc_insertion_point(field_add:tensorflow.TensorShapeProto.dim)
inline ::opencv_tensorflow::TensorShapeProto_Dim* TensorShapeProto::add_dim() {
// @@protoc_insertion_point(field_add:opencv_tensorflow.TensorShapeProto.dim)
return dim_.Add();
}
inline ::google::protobuf::RepeatedPtrField< ::tensorflow::TensorShapeProto_Dim >*
inline ::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::TensorShapeProto_Dim >*
TensorShapeProto::mutable_dim() {
// @@protoc_insertion_point(field_mutable_list:tensorflow.TensorShapeProto.dim)
// @@protoc_insertion_point(field_mutable_list:opencv_tensorflow.TensorShapeProto.dim)
return &dim_;
}
inline const ::google::protobuf::RepeatedPtrField< ::tensorflow::TensorShapeProto_Dim >&
inline const ::google::protobuf::RepeatedPtrField< ::opencv_tensorflow::TensorShapeProto_Dim >&
TensorShapeProto::dim() const {
// @@protoc_insertion_point(field_list:tensorflow.TensorShapeProto.dim)
// @@protoc_insertion_point(field_list:opencv_tensorflow.TensorShapeProto.dim)
return dim_;
}
@ -467,13 +467,13 @@ inline void TensorShapeProto::clear_unknown_rank() {
unknown_rank_ = false;
}
inline bool TensorShapeProto::unknown_rank() const {
// @@protoc_insertion_point(field_get:tensorflow.TensorShapeProto.unknown_rank)
// @@protoc_insertion_point(field_get:opencv_tensorflow.TensorShapeProto.unknown_rank)
return unknown_rank_;
}
inline void TensorShapeProto::set_unknown_rank(bool value) {
unknown_rank_ = value;
// @@protoc_insertion_point(field_set:tensorflow.TensorShapeProto.unknown_rank)
// @@protoc_insertion_point(field_set:opencv_tensorflow.TensorShapeProto.unknown_rank)
}
#ifdef __GNUC__
@ -484,7 +484,7 @@ inline void TensorShapeProto::set_unknown_rank(bool value) {
// @@protoc_insertion_point(namespace_scope)
} // namespace tensorflow
} // namespace opencv_tensorflow
// @@protoc_insertion_point(global_scope)

View File

@ -19,8 +19,8 @@
#include "third_party/protobuf/version.h"
#endif
// @@protoc_insertion_point(includes)
namespace tensorflow {
} // namespace tensorflow
namespace opencv_tensorflow {
} // namespace opencv_tensorflow
namespace protobuf_types_2eproto {
const ::google::protobuf::EnumDescriptor* file_level_enum_descriptors[1];
const ::google::protobuf::uint32 TableStruct::offsets[1] = {};
@ -48,28 +48,28 @@ void protobuf_RegisterTypes(const ::std::string&) {
void AddDescriptorsImpl() {
InitDefaults();
static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
"\n\013types.proto\022\ntensorflow*\234\005\n\010DataType\022\016"
"\n\nDT_INVALID\020\000\022\014\n\010DT_FLOAT\020\001\022\r\n\tDT_DOUBL"
"E\020\002\022\014\n\010DT_INT32\020\003\022\014\n\010DT_UINT8\020\004\022\014\n\010DT_IN"
"T16\020\005\022\013\n\007DT_INT8\020\006\022\r\n\tDT_STRING\020\007\022\020\n\014DT_"
"COMPLEX64\020\010\022\014\n\010DT_INT64\020\t\022\013\n\007DT_BOOL\020\n\022\014"
"\n\010DT_QINT8\020\013\022\r\n\tDT_QUINT8\020\014\022\r\n\tDT_QINT32"
"\020\r\022\017\n\013DT_BFLOAT16\020\016\022\r\n\tDT_QINT16\020\017\022\016\n\nDT"
"_QUINT16\020\020\022\r\n\tDT_UINT16\020\021\022\021\n\rDT_COMPLEX1"
"28\020\022\022\013\n\007DT_HALF\020\023\022\020\n\014DT_FLOAT_REF\020e\022\021\n\rD"
"T_DOUBLE_REF\020f\022\020\n\014DT_INT32_REF\020g\022\020\n\014DT_U"
"INT8_REF\020h\022\020\n\014DT_INT16_REF\020i\022\017\n\013DT_INT8_"
"REF\020j\022\021\n\rDT_STRING_REF\020k\022\024\n\020DT_COMPLEX64"
"_REF\020l\022\020\n\014DT_INT64_REF\020m\022\017\n\013DT_BOOL_REF\020"
"n\022\020\n\014DT_QINT8_REF\020o\022\021\n\rDT_QUINT8_REF\020p\022\021"
"\n\rDT_QINT32_REF\020q\022\023\n\017DT_BFLOAT16_REF\020r\022\021"
"\n\rDT_QINT16_REF\020s\022\022\n\016DT_QUINT16_REF\020t\022\021\n"
"\rDT_UINT16_REF\020u\022\025\n\021DT_COMPLEX128_REF\020v\022"
"\017\n\013DT_HALF_REF\020wB,\n\030org.tensorflow.frame"
"workB\013TypesProtosP\001\370\001\001b\006proto3"
"\n\013types.proto\022\021opencv_tensorflow*\234\005\n\010Dat"
"aType\022\016\n\nDT_INVALID\020\000\022\014\n\010DT_FLOAT\020\001\022\r\n\tD"
"T_DOUBLE\020\002\022\014\n\010DT_INT32\020\003\022\014\n\010DT_UINT8\020\004\022\014"
"\n\010DT_INT16\020\005\022\013\n\007DT_INT8\020\006\022\r\n\tDT_STRING\020\007"
"\022\020\n\014DT_COMPLEX64\020\010\022\014\n\010DT_INT64\020\t\022\013\n\007DT_B"
"OOL\020\n\022\014\n\010DT_QINT8\020\013\022\r\n\tDT_QUINT8\020\014\022\r\n\tDT"
"_QINT32\020\r\022\017\n\013DT_BFLOAT16\020\016\022\r\n\tDT_QINT16\020"
"\017\022\016\n\nDT_QUINT16\020\020\022\r\n\tDT_UINT16\020\021\022\021\n\rDT_C"
"OMPLEX128\020\022\022\013\n\007DT_HALF\020\023\022\020\n\014DT_FLOAT_REF"
"\020e\022\021\n\rDT_DOUBLE_REF\020f\022\020\n\014DT_INT32_REF\020g\022"
"\020\n\014DT_UINT8_REF\020h\022\020\n\014DT_INT16_REF\020i\022\017\n\013D"
"T_INT8_REF\020j\022\021\n\rDT_STRING_REF\020k\022\024\n\020DT_CO"
"MPLEX64_REF\020l\022\020\n\014DT_INT64_REF\020m\022\017\n\013DT_BO"
"OL_REF\020n\022\020\n\014DT_QINT8_REF\020o\022\021\n\rDT_QUINT8_"
"REF\020p\022\021\n\rDT_QINT32_REF\020q\022\023\n\017DT_BFLOAT16_"
"REF\020r\022\021\n\rDT_QINT16_REF\020s\022\022\n\016DT_QUINT16_R"
"EF\020t\022\021\n\rDT_UINT16_REF\020u\022\025\n\021DT_COMPLEX128"
"_REF\020v\022\017\n\013DT_HALF_REF\020wB,\n\030org.tensorflo"
"w.frameworkB\013TypesProtosP\001\370\001\001b\006proto3"
};
::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
descriptor, 750);
descriptor, 757);
::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
"types.proto", &protobuf_RegisterTypes);
}
@ -85,7 +85,7 @@ struct StaticDescriptorInitializer {
}
} static_descriptor_initializer;
} // namespace protobuf_types_2eproto
namespace tensorflow {
namespace opencv_tensorflow {
const ::google::protobuf::EnumDescriptor* DataType_descriptor() {
protobuf_types_2eproto::protobuf_AssignDescriptorsOnce();
return protobuf_types_2eproto::file_level_enum_descriptors[0];
@ -139,6 +139,6 @@ bool DataType_IsValid(int value) {
// @@protoc_insertion_point(namespace_scope)
} // namespace tensorflow
} // namespace opencv_tensorflow
// @@protoc_insertion_point(global_scope)

View File

@ -44,9 +44,9 @@ void AddDescriptors();
inline void InitDefaults() {
}
} // namespace protobuf_types_2eproto
namespace tensorflow {
} // namespace tensorflow
namespace tensorflow {
namespace opencv_tensorflow {
} // namespace opencv_tensorflow
namespace opencv_tensorflow {
enum DataType {
DT_INVALID = 0,
@ -124,15 +124,15 @@ inline bool DataType_Parse(
// @@protoc_insertion_point(namespace_scope)
} // namespace tensorflow
} // namespace opencv_tensorflow
namespace google {
namespace protobuf {
template <> struct is_proto_enum< ::tensorflow::DataType> : ::google::protobuf::internal::true_type {};
template <> struct is_proto_enum< ::opencv_tensorflow::DataType> : ::google::protobuf::internal::true_type {};
template <>
inline const EnumDescriptor* GetEnumDescriptor< ::tensorflow::DataType>() {
return ::tensorflow::DataType_descriptor();
inline const EnumDescriptor* GetEnumDescriptor< ::opencv_tensorflow::DataType>() {
return ::opencv_tensorflow::DataType_descriptor();
}
} // namespace protobuf

View File

@ -19,13 +19,13 @@
#include "third_party/protobuf/version.h"
#endif
// @@protoc_insertion_point(includes)
namespace tensorflow {
namespace opencv_tensorflow {
class VersionDefDefaultTypeInternal {
public:
::google::protobuf::internal::ExplicitlyConstructed<VersionDef>
_instance;
} _VersionDef_default_instance_;
} // namespace tensorflow
} // namespace opencv_tensorflow
namespace protobuf_versions_2eproto {
void InitDefaultsVersionDefImpl() {
GOOGLE_PROTOBUF_VERIFY_VERSION;
@ -36,11 +36,11 @@ void InitDefaultsVersionDefImpl() {
::google::protobuf::internal::InitProtobufDefaults();
#endif // GOOGLE_PROTOBUF_ENFORCE_UNIQUENESS
{
void* ptr = &::tensorflow::_VersionDef_default_instance_;
new (ptr) ::tensorflow::VersionDef();
void* ptr = &::opencv_tensorflow::_VersionDef_default_instance_;
new (ptr) ::opencv_tensorflow::VersionDef();
::google::protobuf::internal::OnShutdownDestroyMessage(ptr);
}
::tensorflow::VersionDef::InitAsDefaultInstance();
::opencv_tensorflow::VersionDef::InitAsDefaultInstance();
}
void InitDefaultsVersionDef() {
@ -52,20 +52,20 @@ void InitDefaultsVersionDef() {
const ::google::protobuf::uint32 TableStruct::offsets[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
~0u, // no _has_bits_
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tensorflow::VersionDef, _internal_metadata_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::VersionDef, _internal_metadata_),
~0u, // no _extensions_
~0u, // no _oneof_case_
~0u, // no _weak_field_map_
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tensorflow::VersionDef, producer_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tensorflow::VersionDef, min_consumer_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::tensorflow::VersionDef, bad_consumers_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::VersionDef, producer_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::VersionDef, min_consumer_),
GOOGLE_PROTOBUF_GENERATED_MESSAGE_FIELD_OFFSET(::opencv_tensorflow::VersionDef, bad_consumers_),
};
static const ::google::protobuf::internal::MigrationSchema schemas[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
{ 0, -1, sizeof(::tensorflow::VersionDef)},
{ 0, -1, sizeof(::opencv_tensorflow::VersionDef)},
};
static ::google::protobuf::Message const * const file_default_instances[] = {
reinterpret_cast<const ::google::protobuf::Message*>(&::tensorflow::_VersionDef_default_instance_),
reinterpret_cast<const ::google::protobuf::Message*>(&::opencv_tensorflow::_VersionDef_default_instance_),
};
void protobuf_AssignDescriptors() {
@ -90,14 +90,14 @@ void protobuf_RegisterTypes(const ::std::string&) {
void AddDescriptorsImpl() {
InitDefaults();
static const char descriptor[] GOOGLE_PROTOBUF_ATTRIBUTE_SECTION_VARIABLE(protodesc_cold) = {
"\n\016versions.proto\022\ntensorflow\"K\n\nVersionD"
"ef\022\020\n\010producer\030\001 \001(\005\022\024\n\014min_consumer\030\002 \001"
"(\005\022\025\n\rbad_consumers\030\003 \003(\005B/\n\030org.tensorf"
"low.frameworkB\016VersionsProtosP\001\370\001\001b\006prot"
"o3"
"\n\016versions.proto\022\021opencv_tensorflow\"K\n\nV"
"ersionDef\022\020\n\010producer\030\001 \001(\005\022\024\n\014min_consu"
"mer\030\002 \001(\005\022\025\n\rbad_consumers\030\003 \003(\005B/\n\030org."
"tensorflow.frameworkB\016VersionsProtosP\001\370\001"
"\001b\006proto3"
};
::google::protobuf::DescriptorPool::InternalAddGeneratedFile(
descriptor, 162);
descriptor, 169);
::google::protobuf::MessageFactory::InternalRegisterGeneratedFile(
"versions.proto", &protobuf_RegisterTypes);
}
@ -113,7 +113,7 @@ struct StaticDescriptorInitializer {
}
} static_descriptor_initializer;
} // namespace protobuf_versions_2eproto
namespace tensorflow {
namespace opencv_tensorflow {
// ===================================================================
@ -131,7 +131,7 @@ VersionDef::VersionDef()
::protobuf_versions_2eproto::InitDefaultsVersionDef();
}
SharedCtor();
// @@protoc_insertion_point(constructor:tensorflow.VersionDef)
// @@protoc_insertion_point(constructor:opencv_tensorflow.VersionDef)
}
VersionDef::VersionDef(::google::protobuf::Arena* arena)
: ::google::protobuf::Message(),
@ -140,7 +140,7 @@ VersionDef::VersionDef(::google::protobuf::Arena* arena)
::protobuf_versions_2eproto::InitDefaultsVersionDef();
SharedCtor();
RegisterArenaDtor(arena);
// @@protoc_insertion_point(arena_constructor:tensorflow.VersionDef)
// @@protoc_insertion_point(arena_constructor:opencv_tensorflow.VersionDef)
}
VersionDef::VersionDef(const VersionDef& from)
: ::google::protobuf::Message(),
@ -151,7 +151,7 @@ VersionDef::VersionDef(const VersionDef& from)
::memcpy(&producer_, &from.producer_,
static_cast<size_t>(reinterpret_cast<char*>(&min_consumer_) -
reinterpret_cast<char*>(&producer_)) + sizeof(min_consumer_));
// @@protoc_insertion_point(copy_constructor:tensorflow.VersionDef)
// @@protoc_insertion_point(copy_constructor:opencv_tensorflow.VersionDef)
}
void VersionDef::SharedCtor() {
@ -162,7 +162,7 @@ void VersionDef::SharedCtor() {
}
VersionDef::~VersionDef() {
// @@protoc_insertion_point(destructor:tensorflow.VersionDef)
// @@protoc_insertion_point(destructor:opencv_tensorflow.VersionDef)
SharedDtor();
}
@ -196,7 +196,7 @@ VersionDef* VersionDef::New(::google::protobuf::Arena* arena) const {
}
void VersionDef::Clear() {
// @@protoc_insertion_point(message_clear_start:tensorflow.VersionDef)
// @@protoc_insertion_point(message_clear_start:opencv_tensorflow.VersionDef)
::google::protobuf::uint32 cached_has_bits = 0;
// Prevent compiler warnings about cached_has_bits being unused
(void) cached_has_bits;
@ -212,7 +212,7 @@ bool VersionDef::MergePartialFromCodedStream(
::google::protobuf::io::CodedInputStream* input) {
#define DO_(EXPRESSION) if (!GOOGLE_PREDICT_TRUE(EXPRESSION)) goto failure
::google::protobuf::uint32 tag;
// @@protoc_insertion_point(parse_start:tensorflow.VersionDef)
// @@protoc_insertion_point(parse_start:opencv_tensorflow.VersionDef)
for (;;) {
::std::pair< ::google::protobuf::uint32, bool> p = input->ReadTagWithCutoffNoLastTag(127u);
tag = p.first;
@ -277,17 +277,17 @@ bool VersionDef::MergePartialFromCodedStream(
}
}
success:
// @@protoc_insertion_point(parse_success:tensorflow.VersionDef)
// @@protoc_insertion_point(parse_success:opencv_tensorflow.VersionDef)
return true;
failure:
// @@protoc_insertion_point(parse_failure:tensorflow.VersionDef)
// @@protoc_insertion_point(parse_failure:opencv_tensorflow.VersionDef)
return false;
#undef DO_
}
void VersionDef::SerializeWithCachedSizes(
::google::protobuf::io::CodedOutputStream* output) const {
// @@protoc_insertion_point(serialize_start:tensorflow.VersionDef)
// @@protoc_insertion_point(serialize_start:opencv_tensorflow.VersionDef)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
@ -316,13 +316,13 @@ void VersionDef::SerializeWithCachedSizes(
::google::protobuf::internal::WireFormat::SerializeUnknownFields(
(::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), output);
}
// @@protoc_insertion_point(serialize_end:tensorflow.VersionDef)
// @@protoc_insertion_point(serialize_end:opencv_tensorflow.VersionDef)
}
::google::protobuf::uint8* VersionDef::InternalSerializeWithCachedSizesToArray(
bool deterministic, ::google::protobuf::uint8* target) const {
(void)deterministic; // Unused
// @@protoc_insertion_point(serialize_to_array_start:tensorflow.VersionDef)
// @@protoc_insertion_point(serialize_to_array_start:opencv_tensorflow.VersionDef)
::google::protobuf::uint32 cached_has_bits = 0;
(void) cached_has_bits;
@ -353,12 +353,12 @@ void VersionDef::SerializeWithCachedSizes(
target = ::google::protobuf::internal::WireFormat::SerializeUnknownFieldsToArray(
(::google::protobuf::internal::GetProto3PreserveUnknownsDefault() ? _internal_metadata_.unknown_fields() : _internal_metadata_.default_instance()), target);
}
// @@protoc_insertion_point(serialize_to_array_end:tensorflow.VersionDef)
// @@protoc_insertion_point(serialize_to_array_end:opencv_tensorflow.VersionDef)
return target;
}
size_t VersionDef::ByteSizeLong() const {
// @@protoc_insertion_point(message_byte_size_start:tensorflow.VersionDef)
// @@protoc_insertion_point(message_byte_size_start:opencv_tensorflow.VersionDef)
size_t total_size = 0;
if ((_internal_metadata_.have_unknown_fields() && ::google::protobuf::internal::GetProto3PreserveUnknownsDefault())) {
@ -404,22 +404,22 @@ size_t VersionDef::ByteSizeLong() const {
}
void VersionDef::MergeFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_merge_from_start:tensorflow.VersionDef)
// @@protoc_insertion_point(generalized_merge_from_start:opencv_tensorflow.VersionDef)
GOOGLE_DCHECK_NE(&from, this);
const VersionDef* source =
::google::protobuf::internal::DynamicCastToGenerated<const VersionDef>(
&from);
if (source == NULL) {
// @@protoc_insertion_point(generalized_merge_from_cast_fail:tensorflow.VersionDef)
// @@protoc_insertion_point(generalized_merge_from_cast_fail:opencv_tensorflow.VersionDef)
::google::protobuf::internal::ReflectionOps::Merge(from, this);
} else {
// @@protoc_insertion_point(generalized_merge_from_cast_success:tensorflow.VersionDef)
// @@protoc_insertion_point(generalized_merge_from_cast_success:opencv_tensorflow.VersionDef)
MergeFrom(*source);
}
}
void VersionDef::MergeFrom(const VersionDef& from) {
// @@protoc_insertion_point(class_specific_merge_from_start:tensorflow.VersionDef)
// @@protoc_insertion_point(class_specific_merge_from_start:opencv_tensorflow.VersionDef)
GOOGLE_DCHECK_NE(&from, this);
_internal_metadata_.MergeFrom(from._internal_metadata_);
::google::protobuf::uint32 cached_has_bits = 0;
@ -435,14 +435,14 @@ void VersionDef::MergeFrom(const VersionDef& from) {
}
void VersionDef::CopyFrom(const ::google::protobuf::Message& from) {
// @@protoc_insertion_point(generalized_copy_from_start:tensorflow.VersionDef)
// @@protoc_insertion_point(generalized_copy_from_start:opencv_tensorflow.VersionDef)
if (&from == this) return;
Clear();
MergeFrom(from);
}
void VersionDef::CopyFrom(const VersionDef& from) {
// @@protoc_insertion_point(class_specific_copy_from_start:tensorflow.VersionDef)
// @@protoc_insertion_point(class_specific_copy_from_start:opencv_tensorflow.VersionDef)
if (&from == this) return;
Clear();
MergeFrom(from);
@ -487,6 +487,6 @@ void VersionDef::InternalSwap(VersionDef* other) {
// @@protoc_insertion_point(namespace_scope)
} // namespace tensorflow
} // namespace opencv_tensorflow
// @@protoc_insertion_point(global_scope)

View File

@ -48,16 +48,16 @@ inline void InitDefaults() {
InitDefaultsVersionDef();
}
} // namespace protobuf_versions_2eproto
namespace tensorflow {
namespace opencv_tensorflow {
class VersionDef;
class VersionDefDefaultTypeInternal;
extern VersionDefDefaultTypeInternal _VersionDef_default_instance_;
} // namespace tensorflow
namespace tensorflow {
} // namespace opencv_tensorflow
namespace opencv_tensorflow {
// ===================================================================
class VersionDef : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:tensorflow.VersionDef) */ {
class VersionDef : public ::google::protobuf::Message /* @@protoc_insertion_point(class_definition:opencv_tensorflow.VersionDef) */ {
public:
VersionDef();
virtual ~VersionDef();
@ -175,7 +175,7 @@ class VersionDef : public ::google::protobuf::Message /* @@protoc_insertion_poin
::google::protobuf::int32 min_consumer() const;
void set_min_consumer(::google::protobuf::int32 value);
// @@protoc_insertion_point(class_scope:tensorflow.VersionDef)
// @@protoc_insertion_point(class_scope:opencv_tensorflow.VersionDef)
private:
::google::protobuf::internal::InternalMetadataWithArena _internal_metadata_;
@ -206,13 +206,13 @@ inline void VersionDef::clear_producer() {
producer_ = 0;
}
inline ::google::protobuf::int32 VersionDef::producer() const {
// @@protoc_insertion_point(field_get:tensorflow.VersionDef.producer)
// @@protoc_insertion_point(field_get:opencv_tensorflow.VersionDef.producer)
return producer_;
}
inline void VersionDef::set_producer(::google::protobuf::int32 value) {
producer_ = value;
// @@protoc_insertion_point(field_set:tensorflow.VersionDef.producer)
// @@protoc_insertion_point(field_set:opencv_tensorflow.VersionDef.producer)
}
// int32 min_consumer = 2;
@ -220,13 +220,13 @@ inline void VersionDef::clear_min_consumer() {
min_consumer_ = 0;
}
inline ::google::protobuf::int32 VersionDef::min_consumer() const {
// @@protoc_insertion_point(field_get:tensorflow.VersionDef.min_consumer)
// @@protoc_insertion_point(field_get:opencv_tensorflow.VersionDef.min_consumer)
return min_consumer_;
}
inline void VersionDef::set_min_consumer(::google::protobuf::int32 value) {
min_consumer_ = value;
// @@protoc_insertion_point(field_set:tensorflow.VersionDef.min_consumer)
// @@protoc_insertion_point(field_set:opencv_tensorflow.VersionDef.min_consumer)
}
// repeated int32 bad_consumers = 3;
@ -237,25 +237,25 @@ inline void VersionDef::clear_bad_consumers() {
bad_consumers_.Clear();
}
inline ::google::protobuf::int32 VersionDef::bad_consumers(int index) const {
// @@protoc_insertion_point(field_get:tensorflow.VersionDef.bad_consumers)
// @@protoc_insertion_point(field_get:opencv_tensorflow.VersionDef.bad_consumers)
return bad_consumers_.Get(index);
}
inline void VersionDef::set_bad_consumers(int index, ::google::protobuf::int32 value) {
bad_consumers_.Set(index, value);
// @@protoc_insertion_point(field_set:tensorflow.VersionDef.bad_consumers)
// @@protoc_insertion_point(field_set:opencv_tensorflow.VersionDef.bad_consumers)
}
inline void VersionDef::add_bad_consumers(::google::protobuf::int32 value) {
bad_consumers_.Add(value);
// @@protoc_insertion_point(field_add:tensorflow.VersionDef.bad_consumers)
// @@protoc_insertion_point(field_add:opencv_tensorflow.VersionDef.bad_consumers)
}
inline const ::google::protobuf::RepeatedField< ::google::protobuf::int32 >&
VersionDef::bad_consumers() const {
// @@protoc_insertion_point(field_list:tensorflow.VersionDef.bad_consumers)
// @@protoc_insertion_point(field_list:opencv_tensorflow.VersionDef.bad_consumers)
return bad_consumers_;
}
inline ::google::protobuf::RepeatedField< ::google::protobuf::int32 >*
VersionDef::mutable_bad_consumers() {
// @@protoc_insertion_point(field_mutable_list:tensorflow.VersionDef.bad_consumers)
// @@protoc_insertion_point(field_mutable_list:opencv_tensorflow.VersionDef.bad_consumers)
return &bad_consumers_;
}
@ -265,7 +265,7 @@ VersionDef::mutable_bad_consumers() {
// @@protoc_insertion_point(namespace_scope)
} // namespace tensorflow
} // namespace opencv_tensorflow
// @@protoc_insertion_point(global_scope)

View File

@ -3462,6 +3462,10 @@ Net readNet(const String& _model, const String& _config, const String& _framewor
std::swap(model, config);
return readNetFromModelOptimizer(config, model);
}
if (framework == "onnx" || modelExt == "onnx")
{
return readNetFromONNX(model);
}
CV_Error(Error::StsError, "Cannot determine an origin framework of files: " +
model + (config.empty() ? "" : ", " + config));
}

View File

@ -57,23 +57,6 @@ namespace dnn
class PermuteLayerImpl CV_FINAL : public PermuteLayer
{
public:
void checkCurrentOrder(int currentOrder)
{
if(currentOrder < 0 || currentOrder > 3)
{
CV_Error(
Error::StsBadArg,
"Orders of dimensions in Permute layer parameter"
"must be in [0...3] interval");
}
if(std::find(_order.begin(), _order.end(), currentOrder) != _order.end())
{
CV_Error(Error::StsBadArg,
"Permute layer parameter contains duplicated orders.");
}
}
void checkNeedForPermutation()
{
_needsPermute = false;
@ -96,19 +79,22 @@ public:
}
DictValue paramOrder = params.get("order");
if(paramOrder.size() > 4)
{
CV_Error(
Error::StsBadArg,
"Too many (> 4) orders of dimensions in Permute layer");
}
_numAxes = paramOrder.size();
for (size_t i = 0; i < _numAxes; i++)
{
int currentOrder = paramOrder.get<int>(i);
checkCurrentOrder(currentOrder);
if (currentOrder < 0 || currentOrder > _numAxes)
{
CV_Error(Error::StsBadArg,
format("Orders of dimensions in Permute layer parameter"
"must be in [0...%d]", _numAxes - 1));
}
if (std::find(_order.begin(), _order.end(), currentOrder) != _order.end())
{
CV_Error(Error::StsBadArg,
"Permute layer parameter contains duplicated orders.");
}
_order.push_back(currentOrder);
}

View File

@ -494,19 +494,16 @@ public:
max_val0 = v_max(max_val0, v0);
max_val1 = v_max(max_val1, v1);
}
#if CV_SSE2
else if( stride_w == 2 )
for (int k = 0; k < kernel_w*kernel_h; k++)
{
int index = ofsptr[k];
v_float32x4 v00 = v_load(srcData1 + index), v01 = v_load(srcData1 + index + 4);
v_float32x4 v0(_mm_shuffle_ps(v00.val, v01.val, _MM_SHUFFLE(2, 0, 2, 0)));
v_float32x4 v10 = v_load(srcData1 + index + 8), v11 = v_load(srcData1 + index + 12);
v_float32x4 v1(_mm_shuffle_ps(v10.val, v11.val, _MM_SHUFFLE(2, 0, 2, 0)));
v_float32x4 v0, v1, dummy;
v_load_deinterleave(srcData1 + index, v0, dummy); // f0 f2 f4 f6 ,f1 f3 f5 f7
v_load_deinterleave(srcData1 + index + 8, v1, dummy); // f8 f10 f12 f14 ,f9 f11 f13 f15
max_val0 = v_max(max_val0, v0);
max_val1 = v_max(max_val1, v1);
}
#endif
else
for (int k = 0; k < kernel_w*kernel_h; k++)
{

View File

@ -90,8 +90,13 @@ public:
std::vector<MatShape> &internals) const CV_OVERRIDE
{
CV_Assert(inputs.size() > 0);
// channels == cell_size*anchors
CV_Assert(inputs[0][3] == (1 + coords + classes)*anchors);
outputs = std::vector<MatShape>(1, shape(inputs[0][1] * inputs[0][2] * anchors, inputs[0][3] / anchors));
int batch_size = inputs[0][0];
if(batch_size > 1)
outputs = std::vector<MatShape>(1, shape(batch_size, inputs[0][1] * inputs[0][2] * anchors, inputs[0][3] / anchors));
else
outputs = std::vector<MatShape>(1, shape(inputs[0][1] * inputs[0][2] * anchors, inputs[0][3] / anchors));
return false;
}
@ -137,24 +142,28 @@ public:
UMat& inpBlob = inputs[ii];
UMat& outBlob = outputs[ii];
int batch_size = inpBlob.size[0];
int rows = inpBlob.size[1];
int cols = inpBlob.size[2];
// channels == cell_size*anchors, see l. 94
int sample_size = cell_size*rows*cols*anchors;
ocl::Kernel logistic_kernel("logistic_activ", ocl::dnn::region_oclsrc);
size_t global = rows*cols*anchors;
logistic_kernel.set(0, (int)global);
size_t nanchors = rows*cols*anchors*batch_size;
logistic_kernel.set(0, (int)nanchors);
logistic_kernel.set(1, ocl::KernelArg::PtrReadOnly(inpBlob));
logistic_kernel.set(2, (int)cell_size);
logistic_kernel.set(3, ocl::KernelArg::PtrWriteOnly(outBlob));
logistic_kernel.run(1, &global, NULL, false);
logistic_kernel.run(1, &nanchors, NULL, false);
if (useSoftmax)
{
// Yolo v2
// softmax activation for Probability, for each grid cell (X x Y x Anchor-index)
ocl::Kernel softmax_kernel("softmax_activ", ocl::dnn::region_oclsrc);
size_t nthreads = rows*cols*anchors;
softmax_kernel.set(0, (int)nthreads);
size_t nanchors = rows*cols*anchors*batch_size;
softmax_kernel.set(0, (int)nanchors);
softmax_kernel.set(1, ocl::KernelArg::PtrReadOnly(inpBlob));
softmax_kernel.set(2, ocl::KernelArg::PtrReadOnly(blob_umat));
softmax_kernel.set(3, (int)cell_size);
@ -165,14 +174,15 @@ public:
softmax_kernel.set(8, (int)anchors);
softmax_kernel.set(9, (float)thresh);
softmax_kernel.set(10, ocl::KernelArg::PtrWriteOnly(outBlob));
if (!softmax_kernel.run(1, &nthreads, NULL, false))
if (!softmax_kernel.run(1, &nanchors, NULL, false))
return false;
}
if (nmsThreshold > 0) {
Mat mat = outBlob.getMat(ACCESS_WRITE);
float *dstData = mat.ptr<float>();
do_nms_sort(dstData, rows*cols*anchors, thresh, nmsThreshold);
for (int b = 0; b < batch_size; ++b)
do_nms_sort(dstData + b*sample_size, rows*cols*anchors, thresh, nmsThreshold);
}
}
@ -212,8 +222,17 @@ public:
Mat &inpBlob = inputs[ii];
Mat &outBlob = outputs[ii];
int batch_size = inpBlob.size[0];
int rows = inpBlob.size[1];
int cols = inpBlob.size[2];
// address length for one image in batch, both for input and output
int sample_size = cell_size*rows*cols*anchors;
// assert that the comment above is true
CV_Assert(sample_size*batch_size == inpBlob.total());
CV_Assert(sample_size*batch_size == outBlob.total());
CV_Assert(inputs.size() < 2 || inputs[1].dims == 4);
int hNorm = inputs.size() > 1 ? inputs[1].size[2] : rows;
int wNorm = inputs.size() > 1 ? inputs[1].size[3] : cols;
@ -222,69 +241,66 @@ public:
float *dstData = outBlob.ptr<float>();
// logistic activation for t0, for each grid cell (X x Y x Anchor-index)
for (int i = 0; i < rows*cols*anchors; ++i) {
for (int i = 0; i < batch_size*rows*cols*anchors; ++i) {
int index = cell_size*i;
float x = srcData[index + 4];
dstData[index + 4] = logistic_activate(x); // logistic activation
}
if (useSoftmax) { // Yolo v2
// softmax activation for Probability, for each grid cell (X x Y x Anchor-index)
for (int i = 0; i < rows*cols*anchors; ++i) {
for (int i = 0; i < batch_size*rows*cols*anchors; ++i) {
int index = cell_size*i;
softmax_activate(srcData + index + 5, classes, 1, dstData + index + 5);
}
}
else if (useLogistic) { // Yolo v3
for (int i = 0; i < rows*cols*anchors; ++i)
{
for (int i = 0; i < batch_size*rows*cols*anchors; ++i){
int index = cell_size*i;
const float* input = srcData + index + 5;
float* output = dstData + index + 5;
for (int i = 0; i < classes; ++i)
output[i] = logistic_activate(input[i]);
for (int c = 0; c < classes; ++c)
output[c] = logistic_activate(input[c]);
}
}
for (int x = 0; x < cols; ++x)
for(int y = 0; y < rows; ++y)
for (int a = 0; a < anchors; ++a) {
int index = (y*cols + x)*anchors + a; // index for each grid-cell & anchor
int p_index = index * cell_size + 4;
float scale = dstData[p_index];
if (classfix == -1 && scale < .5) scale = 0; // if(t0 < 0.5) t0 = 0;
int box_index = index * cell_size;
for (int b = 0; b < batch_size; ++b)
for (int x = 0; x < cols; ++x)
for(int y = 0; y < rows; ++y)
for (int a = 0; a < anchors; ++a) {
// relative start address for image b within the batch data
int index_sample_offset = sample_size*b;
int index = (y*cols + x)*anchors + a; // index for each grid-cell & anchor
int p_index = index_sample_offset + index * cell_size + 4;
float scale = dstData[p_index];
if (classfix == -1 && scale < .5) scale = 0; // if(t0 < 0.5) t0 = 0;
int box_index = index_sample_offset + index * cell_size;
dstData[box_index + 0] = (x + logistic_activate(srcData[box_index + 0])) / cols;
dstData[box_index + 1] = (y + logistic_activate(srcData[box_index + 1])) / rows;
dstData[box_index + 2] = exp(srcData[box_index + 2]) * biasData[2 * a] / hNorm;
dstData[box_index + 3] = exp(srcData[box_index + 3]) * biasData[2 * a + 1] / wNorm;
dstData[box_index + 0] = (x + logistic_activate(srcData[box_index + 0])) / cols;
dstData[box_index + 1] = (y + logistic_activate(srcData[box_index + 1])) / rows;
dstData[box_index + 2] = exp(srcData[box_index + 2]) * biasData[2 * a] / hNorm;
dstData[box_index + 3] = exp(srcData[box_index + 3]) * biasData[2 * a + 1] / wNorm;
int class_index = index * cell_size + 5;
for (int j = 0; j < classes; ++j) {
float prob = scale*dstData[class_index + j]; // prob = IoU(box, object) = t0 * class-probability
dstData[class_index + j] = (prob > thresh) ? prob : 0; // if (IoU < threshold) IoU = 0;
int class_index = index_sample_offset + index * cell_size + 5;
for (int j = 0; j < classes; ++j) {
float prob = scale*dstData[class_index + j]; // prob = IoU(box, object) = t0 * class-probability
dstData[class_index + j] = (prob > thresh) ? prob : 0; // if (IoU < threshold) IoU = 0;
}
}
}
if (nmsThreshold > 0) {
do_nms_sort(dstData, rows*cols*anchors, thresh, nmsThreshold);
for (int b = 0; b < batch_size; ++b){
do_nms_sort(dstData+b*sample_size, rows*cols*anchors, thresh, nmsThreshold);
}
}
}
}
static inline float rectOverlap(const Rect2f& a, const Rect2f& b)
{
return 1.0f - jaccardDistance(a, b);
}
void do_nms_sort(float *detections, int total, float score_thresh, float nms_thresh)
{
std::vector<Rect2f> boxes(total);
std::vector<Rect2d> boxes(total);
std::vector<float> scores(total);
for (int i = 0; i < total; ++i)
{
Rect2f &b = boxes[i];
Rect2d &b = boxes[i];
int box_index = i * (classes + coords + 1);
b.width = detections[box_index + 2];
b.height = detections[box_index + 3];
@ -302,7 +318,7 @@ public:
scores[i] = detections[class_index + k];
detections[class_index + k] = 0;
}
NMSFast_(boxes, scores, score_thresh, nms_thresh, 1, 0, indices, rectOverlap);
NMSBoxes(boxes, scores, score_thresh, nms_thresh, indices);
for (int i = 0, n = indices.size(); i < n; ++i)
{
int box_index = indices[i] * (classes + coords + 1);

View File

@ -85,6 +85,54 @@ public:
return false;
}
virtual void finalize(InputArrayOfArrays inputs_arr, OutputArrayOfArrays outputs_arr) CV_OVERRIDE
{
std::vector<Mat> inputs, outputs;
inputs_arr.getMatVector(inputs);
outputs_arr.getMatVector(outputs);
Mat inp = inputs[0];
Mat out = outputs[0];
int batchSize = inp.size[0];
LayerParams permParams;
if (batchSize == 1)
{
int order[] = {1, 3, 0, 2};
permParams.set("order", DictValue::arrayInt(&order[0], 4));
permuteInpShape.resize(4);
permuteInpShape[0] = inp.size[1] * inp.size[2] / (reorgStride * reorgStride); // (channels*height)/(r*r)
permuteInpShape[1] = reorgStride;
permuteInpShape[2] = inp.size[3]; // width
permuteInpShape[3] = reorgStride;
permuteOutShape.resize(4);
for (int i = 0; i < 4; ++i)
permuteOutShape[i] = permuteInpShape[order[i]];
}
else
{
int order[] = {0, 2, 4, 1, 3};
permParams.set("order", DictValue::arrayInt(&order[0], 5));
permuteInpShape.resize(5);
permuteInpShape[0] = batchSize;
permuteInpShape[1] = inp.size[1] * inp.size[2] / (reorgStride * reorgStride); // (channels*height)/(r*r)
permuteInpShape[2] = reorgStride;
permuteInpShape[3] = inp.size[3]; // width
permuteInpShape[4] = reorgStride;
permuteOutShape.resize(5);
for (int i = 0; i < 5; ++i)
permuteOutShape[i] = permuteInpShape[order[i]];
}
permute = PermuteLayer::create(permParams);
std::vector<Mat> permuteInputs(1, inp.reshape(1, permuteInpShape));
std::vector<Mat> permuteOutputs(1, out.reshape(1, permuteOutShape));
permute->finalize(permuteInputs, permuteOutputs);
}
virtual bool supportBackend(int backendId) CV_OVERRIDE
{
return backendId == DNN_BACKEND_OPENCV || backendId == DNN_BACKEND_INFERENCE_ENGINE;
@ -96,36 +144,13 @@ public:
std::vector<UMat> inputs;
std::vector<UMat> outputs;
bool use_half = (inps.depth() == CV_16S);
inps.getUMatVector(inputs);
outs.getUMatVector(outputs);
String buildopt= format("-DDtype=%s ", use_half ? "half" : "float");
for (size_t i = 0; i < inputs.size(); i++)
{
ocl::Kernel kernel("reorg", ocl::dnn::reorg_oclsrc, buildopt);
if (kernel.empty())
return false;
UMat& srcBlob = inputs[i];
UMat& dstBlob = outputs[0];
int channels = srcBlob.size[1];
int height = srcBlob.size[2];
int width = srcBlob.size[3];
size_t nthreads = channels * height * width;
kernel.set(0, (int)nthreads);
kernel.set(1, ocl::KernelArg::PtrReadOnly(srcBlob));
kernel.set(2, (int)channels);
kernel.set(3, (int)height);
kernel.set(4, (int)width);
kernel.set(5, (int)reorgStride);
kernel.set(6, ocl::KernelArg::PtrWriteOnly(dstBlob));
if (!kernel.run(1, &nthreads, NULL, false))
return false;
}
inputs[0] = inputs[0].reshape(1, permuteInpShape.size(), &permuteInpShape[0]);
outputs[0] = outputs[0].reshape(1, permuteOutShape.size(), &permuteOutShape[0]);
permute->preferableTarget = preferableTarget;
permute->forward(inputs, outputs, internals);
return true;
}
#endif
@ -149,31 +174,9 @@ public:
inputs_arr.getMatVector(inputs);
outputs_arr.getMatVector(outputs);
for (size_t i = 0; i < inputs.size(); i++)
{
Mat srcBlob = inputs[i];
MatShape inputShape = shape(srcBlob), outShape = shape(outputs[i]);
float *dstData = outputs[0].ptr<float>();
const float *srcData = srcBlob.ptr<float>();
int channels = inputShape[1], height = inputShape[2], width = inputShape[3];
int out_c = channels / (reorgStride*reorgStride);
for (int k = 0; k < channels; ++k) {
for (int j = 0; j < height; ++j) {
for (int i = 0; i < width; ++i) {
int out_index = i + width*(j + height*k);
int c2 = k % out_c;
int offset = k / out_c;
int w2 = i*reorgStride + offset % reorgStride;
int h2 = j*reorgStride + offset / reorgStride;
int in_index = w2 + width*reorgStride*(h2 + height*reorgStride*c2);
dstData[out_index] = srcData[in_index];
}
}
}
}
inputs[0] = inputs[0].reshape(1, permuteInpShape);
outputs[0] = outputs[0].reshape(1, permuteOutShape);
permute->forward(inputs, outputs, internals_arr);
}
virtual Ptr<BackendNode> initInfEngine(const std::vector<Ptr<BackendWrapper> >&) CV_OVERRIDE
@ -202,6 +205,10 @@ public:
}
return flops;
}
private:
Ptr<PermuteLayer> permute;
std::vector<int> permuteInpShape, permuteOutShape;
};
Ptr<ReorgLayer> ReorgLayer::create(const LayerParams& params)

View File

@ -62,11 +62,40 @@ public:
}
}
#ifdef HAVE_OPENCL
bool forward_ocl(InputArrayOfArrays inps, OutputArrayOfArrays outs, OutputArrayOfArrays internals)
{
std::vector<UMat> inputs;
std::vector<UMat> outputs;
inps.getUMatVector(inputs);
outs.getUMatVector(outputs);
if (inputs[0].u != outputs[0].u)
{
if (!permute.empty())
{
inputs[0] = inputs[0].reshape(1, permuteInpShape.size(), &permuteInpShape[0]);
outputs[0] = outputs[0].reshape(1, permuteOutShape.size(), &permuteOutShape[0]);
permute->preferableTarget = preferableTarget;
permute->forward(inputs, outputs, internals);
}
else
inputs[0].copyTo(outputs[0]);
}
return true;
}
#endif
void forward(InputArrayOfArrays inputs_arr, OutputArrayOfArrays outputs_arr, OutputArrayOfArrays internals_arr) CV_OVERRIDE
{
CV_TRACE_FUNCTION();
CV_TRACE_ARG_VALUE(name, "name", name.c_str());
CV_OCL_RUN(IS_DNN_OPENCL_TARGET(preferableTarget) &&
OCL_PERFORMANCE_CHECK(ocl::Device::getDefault().isIntel()),
forward_ocl(inputs_arr, outputs_arr, internals_arr))
if (inputs_arr.depth() == CV_16S)
{
forward_fallback(inputs_arr, outputs_arr, internals_arr);

View File

@ -13,7 +13,8 @@
namespace cv { namespace dnn {
CV__DNN_INLINE_NS_BEGIN
static inline float rectOverlap(const Rect& a, const Rect& b)
template <typename T>
static inline float rectOverlap(const T& a, const T& b)
{
return 1.f - static_cast<float>(jaccardDistance(a, b));
}
@ -27,6 +28,15 @@ void NMSBoxes(const std::vector<Rect>& bboxes, const std::vector<float>& scores,
NMSFast_(bboxes, scores, score_threshold, nms_threshold, eta, top_k, indices, rectOverlap);
}
void NMSBoxes(const std::vector<Rect2d>& bboxes, const std::vector<float>& scores,
const float score_threshold, const float nms_threshold,
std::vector<int>& indices, const float eta, const int top_k)
{
CV_Assert_N(bboxes.size() == scores.size(), score_threshold >= 0,
nms_threshold >= 0, eta > 0);
NMSFast_(bboxes, scores, score_threshold, nms_threshold, eta, top_k, indices, rectOverlap);
}
static inline float rotatedRectIOU(const RotatedRect& a, const RotatedRect& b)
{
std::vector<Point2f> inter;

View File

@ -0,0 +1,585 @@
// This file is part of OpenCV project.
// It is subject to the license terms in the LICENSE file found in the top-level directory
// of this distribution and at http://opencv.org/license.html.
// Copyright (C) 2018, Intel Corporation, all rights reserved.
// Third party copyrights are property of their respective owners.
#include "../precomp.hpp"
#ifdef HAVE_PROTOBUF
#include <iostream>
#include <fstream>
#include <string>
#include <limits>
#include <algorithm>
#if defined(__GNUC__) && __GNUC__ >= 5
#pragma GCC diagnostic push
#pragma GCC diagnostic ignored "-Wsuggest-override"
#endif
#include "opencv-onnx.pb.h"
#if defined(__GNUC__) && __GNUC__ >= 5
#pragma GCC diagnostic pop
#endif
namespace cv {
namespace dnn {
CV__DNN_INLINE_NS_BEGIN
class ONNXImporter
{
opencv_onnx::ModelProto model_proto;
struct LayerInfo {
int layerId;
int outputId;
LayerInfo(int _layerId, int _outputId) : layerId(_layerId), outputId(_outputId) {}
};
std::map<std::string, Mat> getGraphTensors(
const opencv_onnx::GraphProto& graph_proto);
Mat getBlob(const opencv_onnx::NodeProto& node_proto, const std::map<std::string, Mat>& constBlobs, int index);
LayerParams getLayerParams(const opencv_onnx::NodeProto& node_proto);
bool isCeilMode(const LayerParams& layerParams);
public:
ONNXImporter(const char *onnxFile)
{
std::fstream input(onnxFile, std::ios::in | std::ios::binary);
if (!model_proto.ParseFromIstream(&input))
CV_Error(Error::StsUnsupportedFormat, "Failed to parse onnx model");
}
void populateNet(Net dstNet);
};
inline void replaceLayerParam(LayerParams& layerParams, const String& oldKey, const String& newKey)
{
if (layerParams.has(oldKey)) {
layerParams.set(newKey, layerParams.get(oldKey));
layerParams.erase(oldKey);
}
}
void releaseONNXTensor(opencv_onnx::TensorProto& tensor_proto)
{
if (!tensor_proto.raw_data().empty()) {
delete tensor_proto.release_raw_data();
}
}
template<typename T1, typename T2>
void convertInt64ToInt32(const T1& src, T2& dst, int size)
{
for (int i = 0; i < size; i++) {
if (src[i] < std::numeric_limits<int32_t>::min() || src[i] > std::numeric_limits<int32_t>::max()) {
CV_Error(Error::StsOutOfRange, "Input is out of OpenCV 32S range");
}
dst[i] = saturate_cast<int32_t>(src[i]);
}
}
Mat getMatFromTensor(opencv_onnx::TensorProto& tensor_proto)
{
CV_Assert(!tensor_proto.raw_data().empty() || !tensor_proto.float_data().empty()
|| !tensor_proto.double_data().empty() || !tensor_proto.int64_data().empty());
opencv_onnx::TensorProto_DataType datatype = tensor_proto.data_type();
Mat blob;
std::vector<int> sizes;
for (int i = 0; i < tensor_proto.dims_size(); i++) {
sizes.push_back(tensor_proto.dims(i));
}
if (datatype == opencv_onnx::TensorProto_DataType_FLOAT) {
if (!tensor_proto.float_data().empty()) {
const ::google::protobuf::RepeatedField<float> field = tensor_proto.float_data();
Mat(sizes, CV_32FC1, (void*)field.data()).copyTo(blob);
}
else {
char* val = const_cast<char*>(tensor_proto.raw_data().c_str());
Mat(sizes, CV_32FC1, val).copyTo(blob);
}
}
else if (datatype == opencv_onnx::TensorProto_DataType_DOUBLE)
{
const ::google::protobuf::RepeatedField<double> field = tensor_proto.double_data();
CV_Assert(!field.empty());
Mat(sizes, CV_64FC1, (void*)field.data()).convertTo(blob, CV_32FC1);
}
else if (datatype == opencv_onnx::TensorProto_DataType_INT64)
{
blob.create(sizes, CV_32SC1);
int32_t* dst = reinterpret_cast<int32_t*>(blob.data);
if (!tensor_proto.int64_data().empty()) {
::google::protobuf::RepeatedField< ::google::protobuf::int64> src = tensor_proto.int64_data();
convertInt64ToInt32(src, dst, blob.total());
}
else
{
char* val = const_cast<char*>(tensor_proto.raw_data().c_str());
int64_t* src = reinterpret_cast<int64_t*>(val);
convertInt64ToInt32(src, dst, blob.total());
}
}
else
CV_Error(Error::StsUnsupportedFormat, "Unsupported data type: " +
opencv_onnx::TensorProto_DataType_Name(datatype));
return blob;
}
std::map<std::string, Mat> ONNXImporter::getGraphTensors(
const opencv_onnx::GraphProto& graph_proto)
{
opencv_onnx::TensorProto tensor_proto;
std::map<std::string, Mat> layers_weights;
for (int i = 0; i < graph_proto.initializer_size(); i++)
{
tensor_proto = graph_proto.initializer(i);
Mat mat = getMatFromTensor(tensor_proto);
releaseONNXTensor(tensor_proto);
layers_weights.insert(std::make_pair(tensor_proto.name(), mat));
}
return layers_weights;
}
LayerParams ONNXImporter::getLayerParams(const opencv_onnx::NodeProto& node_proto)
{
LayerParams lp;
for(int i = 0; i < node_proto.attribute_size(); i++)
{
opencv_onnx::AttributeProto attribute_proto = node_proto.attribute(i);
std::string attribute_name = attribute_proto.name();
if(attribute_name == "kernel_shape")
{
CV_Assert(attribute_proto.ints_size() == 2);
lp.set("kernel_h", saturate_cast<int32_t>(attribute_proto.ints(0)));
lp.set("kernel_w", saturate_cast<int32_t>(attribute_proto.ints(1)));
}
else if(attribute_name == "strides")
{
CV_Assert(attribute_proto.ints_size() == 2);
lp.set("stride_h", saturate_cast<int32_t>(attribute_proto.ints(0)));
lp.set("stride_w", saturate_cast<int32_t>(attribute_proto.ints(1)));
}
else if(attribute_name == "pads")
{
CV_Assert(attribute_proto.ints_size() == 4);
lp.set("pad_h", saturate_cast<int32_t>(attribute_proto.ints(0)));
lp.set("pad_w", saturate_cast<int32_t>(attribute_proto.ints(1)));
// push pad_b and pad_r for compute ceil_mode
lp.set("pad_b", saturate_cast<int32_t>(attribute_proto.ints(2)));
lp.set("pad_r", saturate_cast<int32_t>(attribute_proto.ints(3)));
}
else if(attribute_name == "auto_pad")
{
if (attribute_proto.s() == "SAME_UPPER" || attribute_proto.s() == "SAME_LOWER") {
lp.set("pad_mode", "SAME");
}
else if (attribute_proto.s() == "VALID") {
lp.set("pad_mode", "VALID");
}
}
else if(attribute_name == "dilations")
{
CV_Assert(attribute_proto.ints_size() == 2);
lp.set("dilation_h", saturate_cast<int32_t>(attribute_proto.ints(0)));
lp.set("dilation_w", saturate_cast<int32_t>(attribute_proto.ints(1)));
}
else if (attribute_proto.has_i())
{
::google::protobuf::int64 src = attribute_proto.i();
if (src < std::numeric_limits<int32_t>::min() || src > std::numeric_limits<int32_t>::max())
CV_Error(Error::StsOutOfRange, "Input is out of OpenCV 32S range");
else
lp.set(attribute_name, saturate_cast<int32_t>(src));
}
else if (attribute_proto.has_f())
{
lp.set(attribute_name, attribute_proto.f());
}
else if (attribute_proto.has_s())
{
lp.set(attribute_name, attribute_proto.s());
}
else if (attribute_proto.floats_size() > 0)
{
lp.set(attribute_name, DictValue::arrayReal(
(float*)attribute_proto.mutable_floats(), attribute_proto.floats_size()));
}
else if (attribute_proto.ints_size() > 0)
{
const ::google::protobuf::RepeatedField< ::google::protobuf::int64> src = attribute_proto.ints();
std::vector<int32_t> dst(attribute_proto.ints_size());
convertInt64ToInt32(src, dst, attribute_proto.ints_size());
lp.set(attribute_proto.name(), DictValue::arrayInt(&dst[0], attribute_proto.ints_size()));
}
else if (attribute_proto.has_t())
{
opencv_onnx::TensorProto tensor = attribute_proto.t();
Mat blob = getMatFromTensor(tensor);
lp.blobs.push_back(blob);
}
else if (attribute_proto.has_g() || attribute_proto.strings_size() > 0 ||
attribute_proto.tensors_size() > 0 || attribute_proto.graphs_size() > 0)
{
CV_Error(Error::StsNotImplemented, "Unexpected attribute type");
}
else
CV_Error(Error::StsNotImplemented, "Unsupported attribute type");
}
return lp;
}
Mat ONNXImporter::getBlob(const opencv_onnx::NodeProto& node_proto,
const std::map<std::string, Mat>& constBlobs, int index)
{
CV_Assert(index < node_proto.input_size());
std::map<std::string, Mat>::const_iterator constBlob;
constBlob = constBlobs.find(node_proto.input(index));
if (constBlob == constBlobs.end()) {
CV_Error(Error::StsObjectNotFound,
"Blob " + node_proto.input(index) + " not found in const blobs");
}
return constBlob->second;
}
bool ONNXImporter::isCeilMode(const LayerParams& layerParams) {
if (!layerParams.has("pad_mode")) {
if (layerParams.has("pad_h")) {
return layerParams.get<int>("pad_h") != layerParams.get<int>("pad_b") ||
layerParams.get<int>("pad_w") != layerParams.get<int>("pad_r");
}
else
return false; // all pads == 0
}
return true;
}
void ONNXImporter::populateNet(Net dstNet)
{
CV_Assert(model_proto.has_graph());
opencv_onnx::GraphProto graph_proto = model_proto.graph();
std::map<std::string, Mat> constBlobs = getGraphTensors(graph_proto);
std::string framework_name;
if (model_proto.has_producer_name()) {
framework_name = model_proto.producer_name();
}
// create map with network inputs (without const blobs)
std::map<std::string, LayerInfo> layer_id;
std::map<std::string, LayerInfo>::iterator layerId;
// fill map: push layer name, layer id and output id
std::vector<String> netInputs;
for (int j = 0; j < graph_proto.input_size(); j++)
{
const std::string& name = graph_proto.input(j).name();
if (constBlobs.find(name) == constBlobs.end()) {
netInputs.push_back(name);
layer_id.insert(std::make_pair(name, LayerInfo(0, netInputs.size() - 1)));
}
}
dstNet.setInputsNames(netInputs);
int layersSize = graph_proto.node_size();
LayerParams layerParams;
opencv_onnx::NodeProto node_proto;
for(int i = 0; i < layersSize; i++)
{
node_proto = graph_proto.node(i);
layerParams = getLayerParams(node_proto);
CV_Assert(node_proto.output_size() >= 1);
layerParams.name = node_proto.output(0);
std::string layer_type = node_proto.op_type();
layerParams.type = layer_type;
if (layer_type == "MaxPool")
{
layerParams.type = "Pooling";
layerParams.set("pool", "MAX");
layerParams.set("ceil_mode", isCeilMode(layerParams));
}
else if (layer_type == "AveragePool")
{
layerParams.type = "Pooling";
layerParams.set("pool", "AVE");
layerParams.set("ceil_mode", isCeilMode(layerParams));
layerParams.set("ave_pool_padded_area", framework_name == "pytorch");
}
else if (layer_type == "GlobalAveragePool")
{
layerParams.type = "Pooling";
layerParams.set("pool", "AVE");
layerParams.set("global_pooling", true);
}
else if (layer_type == "Add" || layer_type == "Sum")
{
if (layer_id.find(node_proto.input(1)) == layer_id.end())
{
Mat blob = getBlob(node_proto, constBlobs, 1);
blob = blob.reshape(1, 1);
if (blob.total() == 1) {
layerParams.type = "Power";
layerParams.set("shift", blob.at<float>(0));
}
else {
layerParams.type = "Shift";
layerParams.blobs.push_back(blob);
}
}
else {
layerParams.type = "Eltwise";
}
}
else if (layer_type == "Sub")
{
Mat blob = (-1.0f) * getBlob(node_proto, constBlobs, 1);
blob = blob.reshape(1, 1);
if (blob.total() == 1) {
layerParams.type = "Power";
layerParams.set("shift", blob.at<float>(0));
}
else {
layerParams.type = "Shift";
layerParams.blobs.push_back(blob);
}
}
else if (layer_type == "Constant")
{
CV_Assert(node_proto.input_size() == 0);
CV_Assert(layerParams.blobs.size() == 1);
constBlobs.insert(std::make_pair(layerParams.name, layerParams.blobs[0]));
continue;
}
else if (layer_type == "ImageScaler")
{
const float scale = layerParams.has("scale") ? layerParams.get<float>("scale") : 1.0f;
layerParams.erase("scale");
if (layerParams.has("bias"))
{
layerParams.type = "Scale";
layerParams.blobs.push_back(
Mat(Size(1, layerParams.get("bias").size()), CV_32FC1, scale));
layerParams.set("bias_term", true);
Mat bias(1, layerParams.get("bias").size(), CV_32FC1);
for (int j = 0; j < bias.total(); j++) {
bias.at<float>(0, j) = layerParams.get("bias").getRealValue(j);
}
layerParams.blobs.push_back(bias);
layerParams.erase("bias");
}
else {
layerParams.set("scale", scale);
layerParams.type = "Power";
}
}
else if (layer_type == "LeakyRelu")
{
layerParams.type = "ReLU";
replaceLayerParam(layerParams, "alpha", "negative_slope");
}
else if (layer_type == "LRN")
{
replaceLayerParam(layerParams, "size", "local_size");
}
else if (layer_type == "BatchNormalization")
{
if (node_proto.input_size() != 5)
CV_Error(Error::StsNotImplemented,
"Expected input, scale, bias, mean and var");
layerParams.type = "BatchNorm";
replaceLayerParam(layerParams, "epsilon", "eps");
replaceLayerParam(layerParams, "spatial", "use_global_stats");
Mat meanData = getBlob(node_proto, constBlobs, 3);
Mat stdData = getBlob(node_proto, constBlobs, 4);
layerParams.blobs.push_back(meanData);
layerParams.blobs.push_back(stdData);
if (!node_proto.input(1).empty()) {
layerParams.set("has_weight", true);
layerParams.blobs.push_back(getBlob(node_proto, constBlobs, 1)); // weightData
} else {
layerParams.set("has_weight", false);
}
if (!node_proto.input(2).empty()) {
layerParams.set("has_bias", true);
layerParams.blobs.push_back(getBlob(node_proto, constBlobs, 2)); // biasData
} else {
layerParams.set("has_bias", false);
}
}
else if (layer_type == "Gemm")
{
CV_Assert(node_proto.input_size() >= 2);
layerParams.type = "InnerProduct";
Mat weights = getBlob(node_proto, constBlobs, 1);
int ind_num_out = 0;
if (layerParams.has("transB") && !layerParams.get<int>("transB")) {
transpose(weights, weights);
ind_num_out = 1;
}
layerParams.blobs.push_back(weights);
if (node_proto.input_size() == 3) {
Mat bias = getBlob(node_proto, constBlobs, 2);
layerParams.blobs.push_back(bias);
}
layerParams.set("num_output", layerParams.blobs[0].size[ind_num_out]);
layerParams.set("bias_term", node_proto.input_size() == 3);
}
else if (layer_type == "MatMul")
{
CV_Assert(node_proto.input_size() == 2);
layerParams.type = "InnerProduct";
Mat blob = getBlob(node_proto, constBlobs, 1);
layerParams.blobs.push_back(blob.t());
layerParams.set("bias_term", false);
layerParams.set("num_output", layerParams.blobs[0].size[0]);
}
else if (layer_type == "Mul")
{
CV_Assert(node_proto.input_size() == 2);
if (layer_id.find(node_proto.input(1)) == layer_id.end()) {
Mat blob = getBlob(node_proto, constBlobs, 1);
blob = blob.reshape(1, 1);
if (blob.total() == 1) {
layerParams.set("scale", blob.at<float>(0));
layerParams.type = "Power";
}
else {
layerParams.blobs.push_back(blob);
layerParams.type = "Scale";
}
}
else {
layerParams.type = "Eltwise";
layerParams.set("operation", "prod");
}
}
else if (layer_type == "Conv")
{
CV_Assert(node_proto.input_size() >= 2);
layerParams.type = "Convolution";
for (int j = 1; j < node_proto.input_size(); j++) {
layerParams.blobs.push_back(getBlob(node_proto, constBlobs, j));
}
layerParams.set("num_output", layerParams.blobs[0].size[0]);
layerParams.set("bias_term", node_proto.input_size() == 3);
}
else if (layer_type == "Unsqueeze")
{
CV_Assert(node_proto.input_size() == 1);
Mat input = getBlob(node_proto, constBlobs, 0);
DictValue axes = layerParams.get("axes");
std::vector<int> dims;
for (int j = 0; j < input.dims; j++) {
dims.push_back(input.size[j]);
}
CV_Assert(axes.getIntValue(axes.size()-1) <= dims.size());
for (int j = 0; j < axes.size(); j++) {
dims.insert(dims.begin() + axes.getIntValue(j), 1);
}
Mat out = input.reshape(0, dims);
constBlobs.insert(std::make_pair(layerParams.name, out));
continue;
}
else if (layer_type == "Reshape")
{
CV_Assert(node_proto.input_size() == 2 || layerParams.has("shape"));
if (node_proto.input_size() == 2) {
Mat blob = getBlob(node_proto, constBlobs, 1);
CV_Assert(blob.type() == CV_32SC1);
if (layer_id.find(node_proto.input(0)) == layer_id.end()) {
Mat input = getBlob(node_proto, constBlobs, 0);
Mat out = input.reshape(0, static_cast<std::vector<int> >(blob));
constBlobs.insert(std::make_pair(layerParams.name, out));
continue;
}
layerParams.set("dim", DictValue::arrayInt<int*>(
blob.ptr<int>(), blob.total() ));
}
else {
DictValue shape = layerParams.get("shape");
std::vector<int> dim;
for (int j = 0; j < shape.size(); j++) {
dim.push_back(shape.getIntValue(j));
}
if (layer_id.find(node_proto.input(0)) == layer_id.end()) {
Mat input = getBlob(node_proto, constBlobs, 0);
Mat out = input.reshape(0, dim);
constBlobs.insert(std::make_pair(layerParams.name, out));
continue;
}
replaceLayerParam(layerParams, "shape", "dim");
}
}
else
{
for (int j = 0; j < node_proto.input_size(); j++) {
if (layer_id.find(node_proto.input(j)) == layer_id.end())
layerParams.blobs.push_back(getBlob(node_proto, constBlobs, j));
}
}
int id = dstNet.addLayer(layerParams.name, layerParams.type, layerParams);
layer_id.insert(std::make_pair(layerParams.name, LayerInfo(id, 0)));
for (int j = 0; j < node_proto.input_size(); j++) {
layerId = layer_id.find(node_proto.input(j));
if (layerId != layer_id.end()) {
dstNet.connect(layerId->second.layerId, layerId->second.outputId, id, j);
}
}
}
}
Net readNetFromONNX(const String& onnxFile)
{
ONNXImporter onnxImporter(onnxFile.c_str());
Net net;
onnxImporter.populateNet(net);
return net;
}
Mat readTensorFromONNX(const String& path)
{
opencv_onnx::TensorProto tensor_proto = opencv_onnx::TensorProto();
std::fstream input(path.c_str(), std::ios::in | std::ios::binary);
if (!tensor_proto.ParseFromIstream(&input)) {
CV_Error(Error::StsUnsupportedFormat, "Failed to parse data");
}
Mat mat = getMatFromTensor(tensor_proto);
releaseONNXTensor(tensor_proto);
return mat;
}
CV__DNN_INLINE_NS_END
}} // namespace
#endif

View File

@ -0,0 +1,446 @@
//
// WARNING: This file is automatically generated! Please edit onnx.in.proto.
//
// Copyright (c) Facebook Inc. and Microsoft Corporation.
// Licensed under the MIT license.
syntax = "proto2";
package opencv_onnx;
// Overview
//
// ONNX is an open specification that is comprised of the following components:
//
// 1) A definition of an extensible computation graph model.
// 2) Definitions of standard data types.
// 3) Definitions of built-in operators.
//
// This document describes the syntax of models and their computation graphs,
// as well as the standard data types. Together, they are referred to as the ONNX
// Intermediate Representation, or 'IR' for short.
//
// The normative semantic specification of the ONNX IR is found in docs/IR.md.
// Definitions of the built-in neural network operators may be found in docs/Operators.md.
// Notes
//
// Release
//
// We are still in the very early stage of defining ONNX. The current
// version of ONNX is a starting point. While we are actively working
// towards a complete spec, we would like to get the community involved
// by sharing our working version of ONNX.
//
// Protobuf compatibility
//
// To simplify framework compatibility, ONNX is defined using the subset of protobuf
// that is compatible with both protobuf v2 and v3. This means that we do not use any
// protobuf features that are only available in one of the two versions.
//
// Here are the most notable contortions we have to carry out to work around
// these limitations:
//
// - No 'map' (added protobuf 3.0). We instead represent mappings as lists
// of key-value pairs, where order does not matter and duplicates
// are not allowed.
// Versioning
//
// ONNX versioning is specified in docs/IR.md and elaborated on in docs/Versioning.md
//
// To be compatible with both proto2 and proto3, we will use a version number
// that is not defined by the default value but an explicit enum number.
enum Version {
// proto3 requires the first enum value to be zero.
// We add this just to appease the compiler.
_START_VERSION = 0;
// The version field is always serialized and we will use it to store the
// version that the graph is generated from. This helps us set up version
// control.
// For the IR, we are using simple numbers starting with with 0x00000001,
// which was the version we published on Oct 10, 2017.
IR_VERSION_2017_10_10 = 0x0000000000000001;
// IR_VERSION 2 published on Oct 30, 2017
// - Added type discriminator to AttributeProto to support proto3 users
IR_VERSION_2017_10_30 = 0x0000000000000002;
// IR VERSION 3 published on Nov 3, 2017
// - For operator versioning:
// - Added new message OperatorSetIdProto
// - Added opset_import in ModelProto
// - For vendor extensions, added domain in NodeProto
IR_VERSION = 0x0000000000000003;
}
// Attributes
//
// A named attribute containing either singular float, integer, string, graph,
// and tensor values, or repeated float, integer, string, graph, and tensor values.
// An AttributeProto MUST contain the name field, and *only one* of the
// following content fields, effectively enforcing a C/C++ union equivalent.
message AttributeProto {
// Note: this enum is structurally identical to the OpSchema::AttrType
// enum defined in schema.h. If you rev one, you likely need to rev the other.
enum AttributeType {
UNDEFINED = 0;
FLOAT = 1;
INT = 2;
STRING = 3;
TENSOR = 4;
GRAPH = 5;
FLOATS = 6;
INTS = 7;
STRINGS = 8;
TENSORS = 9;
GRAPHS = 10;
}
// The name field MUST be present for this version of the IR.
optional string name = 1; // namespace Attribute
// if ref_attr_name is not empty, ref_attr_name is the attribute name in parent function.
// In this case, this AttributeProto does not contain data, and it's a reference of attribute
// in parent scope.
// NOTE: This should ONLY be used in function (sub-graph). It's invalid to be used in main graph.
optional string ref_attr_name = 21;
// A human-readable documentation for this attribute. Markdown is allowed.
optional string doc_string = 13;
// The type field MUST be present for this version of the IR.
// For 0.0.1 versions of the IR, this field was not defined, and
// implementations needed to use has_field hueristics to determine
// which value field was in use. For IR_VERSION 0.0.2 or later, this
// field MUST be set and match the f|i|s|t|... field in use. This
// change was made to accomodate proto3 implementations.
optional AttributeType type = 20; // discriminator that indicates which field below is in use
// Exactly ONE of the following fields must be present for this version of the IR
optional float f = 2; // float
optional int64 i = 3; // int
optional bytes s = 4; // UTF-8 string
optional TensorProto t = 5; // tensor value
optional GraphProto g = 6; // graph
// Do not use field below, it's deprecated.
// optional ValueProto v = 12; // value - subsumes everything but graph
repeated float floats = 7; // list of floats
repeated int64 ints = 8; // list of ints
repeated bytes strings = 9; // list of UTF-8 strings
repeated TensorProto tensors = 10; // list of tensors
repeated GraphProto graphs = 11; // list of graph
}
// Defines information on value, including the name, the type, and
// the shape of the value.
message ValueInfoProto {
// This field MUST be present in this version of the IR.
optional string name = 1; // namespace Value
// This field MUST be present in this version of the IR.
optional TypeProto type = 2;
// A human-readable documentation for this value. Markdown is allowed.
optional string doc_string = 3;
}
// Nodes
//
// Computation graphs are made up of a DAG of nodes, which represent what is
// commonly called a "layer" or "pipeline stage" in machine learning frameworks.
//
// For example, it can be a node of type "Conv" that takes in an image, a filter
// tensor and a bias tensor, and produces the convolved output.
message NodeProto {
repeated string input = 1; // namespace Value
repeated string output = 2; // namespace Value
// An optional identifier for this node in a graph.
// This field MAY be absent in ths version of the IR.
optional string name = 3; // namespace Node
// The symbolic identifier of the Operator to execute.
optional string op_type = 4; // namespace Operator
// The domain of the OperatorSet that specifies the operator named by op_type.
optional string domain = 7; // namespace Domain
// Additional named attributes.
repeated AttributeProto attribute = 5;
// A human-readable documentation for this node. Markdown is allowed.
optional string doc_string = 6;
}
// Models
//
// ModelProto is a top-level file/container format for bundling a ML model and
// associating its computation graph with metadata.
//
// The semantics of the model are described by the associated GraphProto.
message ModelProto {
// The version of the IR this model targets. See Version enum above.
// This field MUST be present.
optional int64 ir_version = 1;
// The OperatorSets this model relies on.
// All ModelProtos MUST have at least one entry that
// specifies which version of the ONNX OperatorSet is
// being imported.
//
// All nodes in the ModelProto's graph will bind against the operator
// with the same-domain/same-op_type operator with the HIGHEST version
// in the referenced operator sets.
repeated OperatorSetIdProto opset_import = 8;
// The name of the framework or tool used to generate this model.
// This field SHOULD be present to indicate which implementation/tool/framework
// emitted the model.
optional string producer_name = 2;
// The version of the framework or tool used to generate this model.
// This field SHOULD be present to indicate which implementation/tool/framework
// emitted the model.
optional string producer_version = 3;
// Domain name of the model.
// We use reverse domain names as name space indicators. For example:
// `com.facebook.fair` or `com.microsoft.cognitiveservices`
//
// Together with `model_version` and GraphProto.name, this forms the unique identity of
// the graph.
optional string domain = 4;
// The version of the graph encoded. See Version enum below.
optional int64 model_version = 5;
// A human-readable documentation for this model. Markdown is allowed.
optional string doc_string = 6;
// The parameterized graph that is evaluated to execute the model.
optional GraphProto graph = 7;
// Named metadata values; keys should be distinct.
repeated StringStringEntryProto metadata_props = 14;
};
// StringStringEntryProto follows the pattern for cross-proto-version maps.
// See https://developers.google.com/protocol-buffers/docs/proto3#maps
message StringStringEntryProto {
optional string key = 1;
optional string value= 2;
};
// Graphs
//
// A graph defines the computational logic of a model and is comprised of a parameterized
// list of nodes that form a directed acyclic graph based on their inputs and outputs.
// This is the equivalent of the "network" or "graph" in many deep learning
// frameworks.
message GraphProto {
// The nodes in the graph, sorted topologically.
repeated NodeProto node = 1;
// The name of the graph.
optional string name = 2; // namespace Graph
// A list of named tensor values, used to specify constant inputs of the graph.
// Each TensorProto entry must have a distinct name (within the list) that
// also appears in the input list.
repeated TensorProto initializer = 5;
// A human-readable documentation for this graph. Markdown is allowed.
optional string doc_string = 10;
// The inputs and outputs of the graph.
repeated ValueInfoProto input = 11;
repeated ValueInfoProto output = 12;
// Information for the values in the graph. The ValueInfoProto.name's
// must be distinct. It is optional for a value to appear in value_info list.
repeated ValueInfoProto value_info = 13;
// DO NOT USE the following fields, they were deprecated from earlier versions.
// repeated string input = 3;
// repeated string output = 4;
// optional int64 ir_version = 6;
// optional int64 producer_version = 7;
// optional string producer_tag = 8;
// optional string domain = 9;
}
// Tensors
//
// A serialized tensor value.
message TensorProto {
enum DataType {
UNDEFINED = 0;
// Basic types.
FLOAT = 1; // float
UINT8 = 2; // uint8_t
INT8 = 3; // int8_t
UINT16 = 4; // uint16_t
INT16 = 5; // int16_t
INT32 = 6; // int32_t
INT64 = 7; // int64_t
STRING = 8; // string
BOOL = 9; // bool
// Advanced types
FLOAT16 = 10;
DOUBLE = 11;
UINT32 = 12;
UINT64 = 13;
COMPLEX64 = 14; // complex with float32 real and imaginary components
COMPLEX128 = 15; // complex with float64 real and imaginary components
// Future extensions go here.
}
// The shape of the tensor.
repeated int64 dims = 1;
// The data type of the tensor.
optional DataType data_type = 2;
// For very large tensors, we may want to store them in chunks, in which
// case the following fields will specify the segment that is stored in
// the current TensorProto.
message Segment {
optional int64 begin = 1;
optional int64 end = 2;
}
optional Segment segment = 3;
// Tensor content must be organized in row-major order.
//
// Depending on the data_type field, exactly one of the fields below with
// name ending in _data is used to store the elements of the tensor.
// For float and complex64 values
// Complex64 tensors are encoded as a single array of floats,
// with the real components appearing in odd numbered positions,
// and the corresponding imaginary component apparing in the
// subsequent even numbered position. (e.g., [1.0 + 2.0i, 3.0 + 4.0i]
// is encoded as [1.0, 2.0 ,3.0 ,4.0]
// When this field is present, the data_type field MUST be FLOAT or COMPLEX64.
repeated float float_data = 4 [packed = true];
// For int32, uint8, int8, uint16, int16, bool, and float16 values
// float16 values must be bit-wise converted to an uint16_t prior
// to writing to the buffer.
// When this field is present, the data_type field MUST be
// INT32, INT16, INT8, UINT16, INT8, BOOL, or FLOAT16
repeated int32 int32_data = 5 [packed = true];
// For strings.
// Each element of string_data is a UTF-8 encoded Unicode
// string. No trailing null, no leading BOM. The protobuf "string"
// scalar type is not used to match ML community conventions.
// When this field is present, the data_type field MUST be STRING
repeated bytes string_data = 6;
// For int64.
// When this field is present, the data_type field MUST be INT64
repeated int64 int64_data = 7 [packed = true];
// Optionally, a name for the tensor.
optional string name = 8; // namespace Value
// A human-readable documentation for this tensor. Markdown is allowed.
optional string doc_string = 12;
// Serializations can either use one of the fields above, or use this
// raw bytes field. The only exception is the string case, where one is
// required to store the content in the repeated bytes string_data field.
//
// When this raw_data field is used to store tensor value, elements MUST
// be stored in as fixed-width, little-endian order.
// Floating-point data types MUST be stored in IEEE 754 format.
// Complex64 elements must be written as two consecutive FLOAT values, real component first.
// Complex128 elements must be written as two consecutive DOUBLE values, real component first.
// Boolean type MUST be written one byte per tensor element (00000001 for true, 00000000 for false).
//
// Note: the advantage of specific field rather than the raw_data field is
// that in some cases (e.g. int data), protobuf does a better packing via
// variable length storage, and may lead to smaller binary footprint.
// When this field is present, the data_type field MUST NOT be STRING or UNDEFINED
optional bytes raw_data = 9;
// For double
// Complex64 tensors are encoded as a single array of doubles,
// with the real components appearing in odd numbered positions,
// and the corresponding imaginary component apparing in the
// subsequent even numbered position. (e.g., [1.0 + 2.0i, 3.0 + 4.0i]
// is encoded as [1.0, 2.0 ,3.0 ,4.0]
// When this field is present, the data_type field MUST be DOUBLE or COMPLEX128
repeated double double_data = 10 [packed = true];
// For uint64 and uint32 values
// When this field is present, the data_type field MUST be
// UINT32 or UINT64
repeated uint64 uint64_data = 11 [packed = true];
}
// Defines a tensor shape. A dimension can be either an integer value
// or a symbolic variable. A symbolic variable represents an unknown
// dimension.
message TensorShapeProto {
message Dimension {
oneof value {
int64 dim_value = 1;
string dim_param = 2; // namespace Shape
};
// Standard denotation can optionally be used to denote tensor
// dimensions with standard semantic descriptions to ensure
// that operations are applied to the correct axis of a tensor.
// Refer to https://github.com/onnx/onnx/blob/master/docs/DimensionDenotation.md#denotation-definition
// for pre-defined dimension denotations.
optional string denotation = 3;
};
repeated Dimension dim = 1;
}
// Types
//
// The standard ONNX data types.
message TypeProto {
message Tensor {
// This field MUST NOT have the value of UNDEFINED
// This field MUST be present for this version of the IR.
optional TensorProto.DataType elem_type = 1;
optional TensorShapeProto shape = 2;
}
oneof value {
// The type of a tensor.
Tensor tensor_type = 1;
}
// An optional denotation can be used to denote the whole
// type with a standard semantic description as to what is
// stored inside. Refer to https://github.com/onnx/onnx/blob/master/docs/TypeDenotation.md#type-denotation-definition
// for pre-defined type denotations.
optional string denotation = 6;
}
// Operator Sets
//
// OperatorSets are uniquely identified by a (domain, opset_version) pair.
message OperatorSetIdProto {
// The domain of the operator set being identified.
// The empty string ("") or absence of this field implies the operator
// set that is defined as part of the ONNX specification.
// This field MUST be present in this version of the IR when referring to any other operator set.
optional string domain = 1;
// The version of the operator set being identified.
// This field MUST be present in this version of the IR.
optional int64 version = 2;
}

View File

@ -84,9 +84,9 @@ __kernel void softmax_activ(const int count,
output[i] = e;
}
int y = index / anchors / cols;
int x = index / anchors % cols;
int a = index - anchors * (x + y * cols);
int y = (index / (anchors * cols)) % rows;
int x = (index / anchors) % cols;
int a = index % anchors;
float scale = dst[box_index + 4];
if (classfix == -1 && scale < .5) scale = 0;

View File

@ -1,67 +0,0 @@
/*M///////////////////////////////////////////////////////////////////////////////////////
//
// IMPORTANT: READ BEFORE DOWNLOADING, COPYING, INSTALLING OR USING.
//
// By downloading, copying, installing or using the software you agree to this license.
// If you do not agree to this license, do not download, install,
// copy or use the software.
//
//
// License Agreement
// For Open Source Computer Vision Library
//
// Copyright (c) 2016-2017 Fabian David Tschopp, all rights reserved.
// Third party copyrights are property of their respective owners.
//
// Redistribution and use in source and binary forms, with or without modification,
// are permitted provided that the following conditions are met:
//
// * Redistribution's of source code must retain the above copyright notice,
// this list of conditions and the following disclaimer.
//
// * Redistribution's in binary form must reproduce the above copyright notice,
// this list of conditions and the following disclaimer in the documentation
// and/or other materials provided with the distribution.
//
// * The name of the copyright holders may not be used to endorse or promote products
// derived from this software without specific prior written permission.
//
// This software is provided by the copyright holders and contributors "as is" and
// any express or implied warranties, including, but not limited to, the implied
// warranties of merchantability and fitness for a particular purpose are disclaimed.
// In no event shall the Intel Corporation or contributors be liable for any direct,
// indirect, incidental, special, exemplary, or consequential damages
// (including, but not limited to, procurement of substitute goods or services;
// loss of use, data, or profits; or business interruption) however caused
// and on any theory of liability, whether in contract, strict liability,
// or tort (including negligence or otherwise) arising in any way out of
// the use of this software, even if advised of the possibility of such damage.
//
//M*/
#if defined(cl_khr_fp16)
#pragma OPENCL EXTENSION cl_khr_fp16 : enable
#endif
__kernel void reorg(const int count,
__global const Dtype* src,
const int channels,
const int height,
const int width,
const int reorgStride,
__global Dtype* dst)
{
for (int index = get_global_id(0); index < count; index += get_global_size(0))
{
int k = index / (height * width);
int j = (index - (k * height * width)) / width;
int i = (index - (k * height * width)) % width;
int out_c = channels / (reorgStride*reorgStride);
int c2 = k % out_c;
int offset = k / out_c;
int w2 = i*reorgStride + offset % reorgStride;
int h2 = j*reorgStride + offset / reorgStride;
int in_index = w2 + width*reorgStride*(h2 + height*reorgStride*c2);
dst[index] = src[in_index];
}
}

Some files were not shown because too many files have changed in this diff Show More