Commit 7c7ecd71 authored by Anguelos Nicolaou's avatar Anguelos Nicolaou

Fixing warnings

parent 551d1e68
...@@ -60,9 +60,9 @@ protected: ...@@ -60,9 +60,9 @@ protected:
void classifyMiniBatch(std::vector<Mat> inputImageList, Mat outputMat){ void classifyMiniBatch(std::vector<Mat> inputImageList, Mat outputMat){
//Classifies a list of images containing at most minibatchSz_ images //Classifies a list of images containing at most minibatchSz_ images
CV_Assert(inputImageList.size()<=this->minibatchSz_); CV_Assert(int(inputImageList.size())<=this->minibatchSz_);
CV_Assert(outputMat.isContinuous()); CV_Assert(outputMat.isContinuous());
float* ouputPtr= (float*)(outputMat.data); #ifdef HAVE_CAFFE
net_->input_blobs()[0]->Reshape(inputImageList.size(), 1,this->inputGeometry_.height,this->inputGeometry_.width); net_->input_blobs()[0]->Reshape(inputImageList.size(), 1,this->inputGeometry_.height,this->inputGeometry_.width);
net_->Reshape(); net_->Reshape();
float* inputBuffer=net_->input_blobs()[0]->mutable_cpu_data(); float* inputBuffer=net_->input_blobs()[0]->mutable_cpu_data();
...@@ -78,6 +78,7 @@ protected: ...@@ -78,6 +78,7 @@ protected:
const float* outputNetData=net_->output_blobs()[0]->cpu_data(); const float* outputNetData=net_->output_blobs()[0]->cpu_data();
float*outputMatData=(float*)(outputMat.data); float*outputMatData=(float*)(outputMat.data);
memcpy(outputMatData,outputNetData,sizeof(float)*this->outputSize_*inputImageList.size()); memcpy(outputMatData,outputNetData,sizeof(float)*this->outputSize_*inputImageList.size());
#endif
} }
#ifdef HAVE_CAFFE #ifdef HAVE_CAFFE
...@@ -129,7 +130,7 @@ public: ...@@ -129,7 +130,7 @@ public:
inputImageList.getMatVector(allImageVector); inputImageList.getMatVector(allImageVector);
classProbabilities.create(Size(this->outputSize_,allImageVector.size()),CV_32F); classProbabilities.create(Size(this->outputSize_,allImageVector.size()),CV_32F);
Mat outputMat = classProbabilities.getMat(); Mat outputMat = classProbabilities.getMat();
for(int imgNum=0;imgNum<allImageVector.size();imgNum+=this->minibatchSz_){ for(int imgNum=0;imgNum<int(allImageVector.size());imgNum+=this->minibatchSz_){
int rangeEnd=imgNum+std::min<int>(allImageVector.size()-imgNum,this->minibatchSz_); int rangeEnd=imgNum+std::min<int>(allImageVector.size()-imgNum,this->minibatchSz_);
std::vector<Mat>::const_iterator from=allImageVector.begin()+imgNum; std::vector<Mat>::const_iterator from=allImageVector.begin()+imgNum;
std::vector<Mat>::const_iterator to=allImageVector.begin()+rangeEnd; std::vector<Mat>::const_iterator to=allImageVector.begin()+rangeEnd;
...@@ -208,7 +209,7 @@ public: ...@@ -208,7 +209,7 @@ public:
while (std::getline(labelsFile, line)){ while (std::getline(labelsFile, line)){
labels_.push_back(std::string(line)); labels_.push_back(std::string(line));
} }
CV_Assert(this->classifier_->getOutputSize()==this->labels_.size()); CV_Assert(this->classifier_->getOutputSize()==int(this->labels_.size()));
} }
void recogniseImage(InputArray inputImage,CV_OUT String& transcription,CV_OUT double& confidence){ void recogniseImage(InputArray inputImage,CV_OUT String& transcription,CV_OUT double& confidence){
......
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment