Commit 878258bc authored by Suman Ghosh's avatar Suman Ghosh

modified initializers

parent 887e6e5e
...@@ -271,9 +271,9 @@ protected: ...@@ -271,9 +271,9 @@ protected:
//Size outputGeometry_;//= Size(1,1); //Size outputGeometry_;//= Size(1,1);
//int channelCount_; //int channelCount_;
// int inputChannel_ ;//=1; // int inputChannel_ ;//=1;
int _inputHeight; // int _inputHeight;
int _inputWidth ; //int _inputWidth ;
int _inputChannel ; //int _inputChannel ;
public: public:
DeepCNNOpenCvDNNImpl(const DeepCNNOpenCvDNNImpl& dn): DeepCNNOpenCvDNNImpl(const DeepCNNOpenCvDNNImpl& dn):
minibatchSz_(dn.minibatchSz_),outputSize_(dn.outputSize_){ minibatchSz_(dn.minibatchSz_),outputSize_(dn.outputSize_){
...@@ -300,8 +300,8 @@ public: ...@@ -300,8 +300,8 @@ public:
//Implemented to supress Visual Studio warning "assignment operator could not be generated" //Implemented to supress Visual Studio warning "assignment operator could not be generated"
} }
DeepCNNOpenCvDNNImpl(String modelArchFilename, String modelWeightsFilename,Ptr<ImagePreprocessor> preprocessor, int maxMinibatchSz,int inputWidth =100,int inputHeight = 32,int inputChannel =1) DeepCNNOpenCvDNNImpl(String modelArchFilename, String modelWeightsFilename,Ptr<ImagePreprocessor> preprocessor, int maxMinibatchSz,int inputWidth ,int inputHeight ,int inputChannel )
:minibatchSz_(maxMinibatchSz),_inputWidth(inputWidth),_inputHeight(inputHeight),_inputChannel(inputChannel) :minibatchSz_(maxMinibatchSz)
{ {
CV_Assert(this->minibatchSz_>0); CV_Assert(this->minibatchSz_>0);
...@@ -326,8 +326,8 @@ public: ...@@ -326,8 +326,8 @@ public:
} }
this->inputGeometry_=Size(_inputWidth,_inputHeight);// Size(inputLayer->width(), inputLayer->height()); this->inputGeometry_=Size(inputWidth,inputHeight);// Size(inputLayer->width(), inputLayer->height());
this->channelCount_ = _inputChannel;//inputLayer->channels(); this->channelCount_ = inputChannel;//inputLayer->channels();
//inputLayer->Reshape(this->minibatchSz_,this->channelCount_,this->inputGeometry_.height, this->inputGeometry_.width); //inputLayer->Reshape(this->minibatchSz_,this->channelCount_,this->inputGeometry_.height, this->inputGeometry_.width);
Ptr< Layer > outLayer= net_->getLayer (net_->getLayerId (net_->getLayerNames()[net_->getLayerNames().size()-2])); Ptr< Layer > outLayer= net_->getLayer (net_->getLayerId (net_->getLayerNames()[net_->getLayerNames().size()-2]));
...@@ -408,7 +408,7 @@ Ptr<DeepCNN> DeepCNN::create(String archFilename,String weightsFilename,Ptr<Imag ...@@ -408,7 +408,7 @@ Ptr<DeepCNN> DeepCNN::create(String archFilename,String weightsFilename,Ptr<Imag
return Ptr<DeepCNN>(new DeepCNNCaffeImpl(archFilename, weightsFilename,preprocessor, minibatchSz)); return Ptr<DeepCNN>(new DeepCNNCaffeImpl(archFilename, weightsFilename,preprocessor, minibatchSz));
#elif defined(HAVE_DNN) #elif defined(HAVE_DNN)
return Ptr<DeepCNN>(new DeepCNNOpenCvDNNImpl(archFilename, weightsFilename,preprocessor, minibatchSz)); return Ptr<DeepCNN>(new DeepCNNOpenCvDNNImpl(archFilename, weightsFilename,preprocessor, minibatchSz,100,32,1));
#else #else
CV_Error(Error::StsError,"DeepCNN::create backend not implemented"); CV_Error(Error::StsError,"DeepCNN::create backend not implemented");
return Ptr<DeepCNN>(); return Ptr<DeepCNN>();
...@@ -419,7 +419,7 @@ Ptr<DeepCNN> DeepCNN::create(String archFilename,String weightsFilename,Ptr<Imag ...@@ -419,7 +419,7 @@ Ptr<DeepCNN> DeepCNN::create(String archFilename,String weightsFilename,Ptr<Imag
return Ptr<DeepCNN>(new DeepCNNCaffeImpl(archFilename, weightsFilename,preprocessor, minibatchSz)); return Ptr<DeepCNN>(new DeepCNNCaffeImpl(archFilename, weightsFilename,preprocessor, minibatchSz));
break; break;
case OCR_HOLISTIC_BACKEND_DNN: case OCR_HOLISTIC_BACKEND_DNN:
return Ptr<DeepCNN>(new DeepCNNOpenCvDNNImpl(archFilename, weightsFilename,preprocessor, minibatchSz)); return Ptr<DeepCNN>(new DeepCNNOpenCvDNNImpl(archFilename, weightsFilename,preprocessor, minibatchSz,100,32,1));
break; break;
case OCR_HOLISTIC_BACKEND_NONE: case OCR_HOLISTIC_BACKEND_NONE:
default: default:
...@@ -440,7 +440,7 @@ Ptr<DeepCNN> DeepCNN::createDictNet(String archFilename,String weightsFilename,i ...@@ -440,7 +440,7 @@ Ptr<DeepCNN> DeepCNN::createDictNet(String archFilename,String weightsFilename,i
return Ptr<DeepCNN>(new DeepCNNCaffeImpl(archFilename, weightsFilename,preprocessor, 100)); return Ptr<DeepCNN>(new DeepCNNCaffeImpl(archFilename, weightsFilename,preprocessor, 100));
#elif defined(HAVE_DNN) #elif defined(HAVE_DNN)
return Ptr<DeepCNN>(new DeepCNNOpenCvDNNImpl(archFilename, weightsFilename,preprocessor, 100)); return Ptr<DeepCNN>(new DeepCNNOpenCvDNNImpl(archFilename, weightsFilename,preprocessor, 100,100,32,1));
#else #else
CV_Error(Error::StsError,"DeepCNN::create backend not implemented"); CV_Error(Error::StsError,"DeepCNN::create backend not implemented");
return Ptr<DeepCNN>(); return Ptr<DeepCNN>();
...@@ -451,7 +451,7 @@ Ptr<DeepCNN> DeepCNN::createDictNet(String archFilename,String weightsFilename,i ...@@ -451,7 +451,7 @@ Ptr<DeepCNN> DeepCNN::createDictNet(String archFilename,String weightsFilename,i
return Ptr<DeepCNN>(new DeepCNNCaffeImpl(archFilename, weightsFilename,preprocessor, 100)); return Ptr<DeepCNN>(new DeepCNNCaffeImpl(archFilename, weightsFilename,preprocessor, 100));
break; break;
case OCR_HOLISTIC_BACKEND_DNN: case OCR_HOLISTIC_BACKEND_DNN:
return Ptr<DeepCNN>(new DeepCNNOpenCvDNNImpl(archFilename, weightsFilename,preprocessor, 100)); return Ptr<DeepCNN>(new DeepCNNOpenCvDNNImpl(archFilename, weightsFilename,preprocessor, 100,100,32,1));
break; break;
case OCR_HOLISTIC_BACKEND_NONE: case OCR_HOLISTIC_BACKEND_NONE:
default: default:
......
...@@ -376,7 +376,7 @@ Ptr<DeepCNNTextDetector> DeepCNNTextDetector::create(String archFilename,String ...@@ -376,7 +376,7 @@ Ptr<DeepCNNTextDetector> DeepCNNTextDetector::create(String archFilename,String
return Ptr<DeepCNNTextDetector>(new DeepCNNTextDetectorCaffeImpl(archFilename, weightsFilename,preprocessor, minibatchSz)); return Ptr<DeepCNNTextDetector>(new DeepCNNTextDetectorCaffeImpl(archFilename, weightsFilename,preprocessor, minibatchSz));
#elif defined(HAVE_DNN) #elif defined(HAVE_DNN)
return Ptr<DeepCNNTextDetector>(new DeepCNNTextDetectorDNNImpl(archFilename, weightsFilename,preprocessor, minibatchSz)); return Ptr<DeepCNNTextDetector>(new DeepCNNTextDetectorDNNImpl(archFilename, weightsFilename,preprocessor, minibatchSz,700,700,3));
#else #else
CV_Error(Error::StsError,"DeepCNNTextDetector::create backend not implemented"); CV_Error(Error::StsError,"DeepCNNTextDetector::create backend not implemented");
return Ptr<DeepCNNTextDetector>(); return Ptr<DeepCNNTextDetector>();
...@@ -387,7 +387,7 @@ Ptr<DeepCNNTextDetector> DeepCNNTextDetector::create(String archFilename,String ...@@ -387,7 +387,7 @@ Ptr<DeepCNNTextDetector> DeepCNNTextDetector::create(String archFilename,String
break; break;
case OCR_HOLISTIC_BACKEND_DNN: case OCR_HOLISTIC_BACKEND_DNN:
return Ptr<DeepCNNTextDetector>(new DeepCNNTextDetectorDNNImpl(archFilename, weightsFilename,preprocessor, minibatchSz)); return Ptr<DeepCNNTextDetector>(new DeepCNNTextDetectorDNNImpl(archFilename, weightsFilename,preprocessor, minibatchSz,700,700,3));
break; break;
case OCR_HOLISTIC_BACKEND_NONE: case OCR_HOLISTIC_BACKEND_NONE:
...@@ -420,7 +420,7 @@ Ptr<DeepCNNTextDetector> DeepCNNTextDetector::createTextBoxNet(String archFilena ...@@ -420,7 +420,7 @@ Ptr<DeepCNNTextDetector> DeepCNNTextDetector::createTextBoxNet(String archFilena
return Ptr<DeepCNNTextDetector>(new DeepCNNTextDetectorCaffeImpl(archFilename, weightsFilename,preprocessor, 1)); return Ptr<DeepCNNTextDetector>(new DeepCNNTextDetectorCaffeImpl(archFilename, weightsFilename,preprocessor, 1));
#elif defined(HAVE_DNN) #elif defined(HAVE_DNN)
return Ptr<DeepCNNTextDetector>(new DeepCNNTextDetectorDNNImpl(archFilename, weightsFilename,preprocessor, 1)); return Ptr<DeepCNNTextDetector>(new DeepCNNTextDetectorDNNImpl(archFilename, weightsFilename,preprocessor, 1,700,700,3));
#else #else
CV_Error(Error::StsError,"DeepCNNTextDetector::create backend not implemented"); CV_Error(Error::StsError,"DeepCNNTextDetector::create backend not implemented");
return Ptr<DeepCNNTextDetector>(); return Ptr<DeepCNNTextDetector>();
...@@ -430,7 +430,7 @@ Ptr<DeepCNNTextDetector> DeepCNNTextDetector::createTextBoxNet(String archFilena ...@@ -430,7 +430,7 @@ Ptr<DeepCNNTextDetector> DeepCNNTextDetector::createTextBoxNet(String archFilena
return Ptr<DeepCNNTextDetector>(new DeepCNNTextDetectorCaffeImpl(archFilename, weightsFilename,preprocessor, 1)); return Ptr<DeepCNNTextDetector>(new DeepCNNTextDetectorCaffeImpl(archFilename, weightsFilename,preprocessor, 1));
break; break;
case OCR_HOLISTIC_BACKEND_DNN: case OCR_HOLISTIC_BACKEND_DNN:
return Ptr<DeepCNNTextDetector>(new DeepCNNTextDetectorDNNImpl(archFilename, weightsFilename,preprocessor, 1)); return Ptr<DeepCNNTextDetector>(new DeepCNNTextDetectorDNNImpl(archFilename, weightsFilename,preprocessor, 1,700,700,3));
break; break;
case OCR_HOLISTIC_BACKEND_NONE: case OCR_HOLISTIC_BACKEND_NONE:
default: default:
......
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