@@ -60,9 +60,9 @@ class DictNetCaffeImpl: public DictNet{
60
60
61
61
void classifyMiniBatch (std::vector<Mat> inputImageList, Mat outputMat){
62
62
// Classifies a list of images containing at most minibatchSz_ images
63
- CV_Assert (inputImageList.size ()<=this ->minibatchSz_ );
63
+ CV_Assert (int ( inputImageList.size () )<=this ->minibatchSz_ );
64
64
CV_Assert (outputMat.isContinuous ());
65
- float * ouputPtr= ( float *)(outputMat. data );
65
+ # ifdef HAVE_CAFFE
66
66
net_->input_blobs ()[0 ]->Reshape (inputImageList.size (), 1 ,this ->inputGeometry_ .height ,this ->inputGeometry_ .width );
67
67
net_->Reshape ();
68
68
float * inputBuffer=net_->input_blobs ()[0 ]->mutable_cpu_data ();
@@ -78,6 +78,7 @@ class DictNetCaffeImpl: public DictNet{
78
78
const float * outputNetData=net_->output_blobs ()[0 ]->cpu_data ();
79
79
float *outputMatData=(float *)(outputMat.data );
80
80
memcpy (outputMatData,outputNetData,sizeof (float )*this ->outputSize_ *inputImageList.size ());
81
+ #endif
81
82
}
82
83
83
84
#ifdef HAVE_CAFFE
@@ -129,7 +130,7 @@ class DictNetCaffeImpl: public DictNet{
129
130
inputImageList.getMatVector (allImageVector);
130
131
classProbabilities.create (Size (this ->outputSize_ ,allImageVector.size ()),CV_32F);
131
132
Mat outputMat = classProbabilities.getMat ();
132
- for (int imgNum=0 ;imgNum<allImageVector.size ();imgNum+=this ->minibatchSz_ ){
133
+ for (int imgNum=0 ;imgNum<int ( allImageVector.size () );imgNum+=this ->minibatchSz_ ){
133
134
int rangeEnd=imgNum+std::min<int >(allImageVector.size ()-imgNum,this ->minibatchSz_ );
134
135
std::vector<Mat>::const_iterator from=allImageVector.begin ()+imgNum;
135
136
std::vector<Mat>::const_iterator to=allImageVector.begin ()+rangeEnd;
@@ -208,7 +209,7 @@ class OCRHolisticWordRecognizerImpl: public OCRHolisticWordRecognizer{
208
209
while (std::getline (labelsFile, line)){
209
210
labels_.push_back (std::string (line));
210
211
}
211
- CV_Assert (this ->classifier_ ->getOutputSize ()==this ->labels_ .size ());
212
+ CV_Assert (this ->classifier_ ->getOutputSize ()==int ( this ->labels_ .size () ));
212
213
}
213
214
214
215
void recogniseImage (InputArray inputImage,CV_OUT String& transcription,CV_OUT double & confidence){
0 commit comments