Commit efc864c5 authored by Suman Ghosh's avatar Suman Ghosh

removed hard coding height and width

parent af536b13
...@@ -59,8 +59,10 @@ if(HAVE_CAFFE AND HAVE_GLOG AND HAVE_PROTOBUF) ...@@ -59,8 +59,10 @@ if(HAVE_CAFFE AND HAVE_GLOG AND HAVE_PROTOBUF)
list(APPEND Caffe_LINKER_LIBS ${HDF5_LIBRARIES}) list(APPEND Caffe_LINKER_LIBS ${HDF5_LIBRARIES})
find_package(Boost 1.46 REQUIRED COMPONENTS system thread filesystem) find_package(Boost 1.46 REQUIRED COMPONENTS system thread filesystem)
include_directories(SYSTEM ${Boost_INCLUDE_DIR}) include_directories(SYSTEM ${Boost_INCLUDE_DIR})
include_directories(SYSTEM /usr/local/cuda-8.0/targets/x86_64-linux/include/ usr/local/cuda-8.0/include/ /usr/local/cuda-7.5/targets/x86_64-linux/include/ ) include_directories(SYSTEM ${CUDA_INCLUDE_DIR})
link_directories(SYSTEM /usr/local/cuda-8.0/targets/x86_64-linux/lib/ usr/local/cuda-8.0/lib/ /usr/local/cuda-7.5/targets/x86_64-linux/lib/ /usr/lib/openblas-base/lib /usr/local/cuda-8.0/lib64) link_directories(SYSTEM ${CUDA_LIBS})
# include_directories(SYSTEM /usr/local/cuda-8.0/targets/x86_64-linux/include/ usr/local/cuda-8.0/include/ /usr/local/cuda-7.5/targets/x86_64-linux/include/ )
#link_directories(SYSTEM /usr/local/cuda-8.0/targets/x86_64-linux/lib/ usr/local/cuda-8.0/lib/ /usr/local/cuda-7.5/targets/x86_64-linux/lib/ /usr/lib/openblas-base/lib /usr/local/cuda-8.0/lib64)
list(APPEND Caffe_LINKER_LIBS ${Boost_LIBRARIES}) list(APPEND Caffe_LINKER_LIBS ${Boost_LIBRARIES})
target_link_libraries(opencv_text atlas blas ${Caffe_LIBS} ${Glog_LIBS} ${Protobuf_LIBS} ${HDF5_LIBRARIES} ${Boost_LIBRARIES}) target_link_libraries(opencv_text atlas blas ${Caffe_LIBS} ${Glog_LIBS} ${Protobuf_LIBS} ${HDF5_LIBRARIES} ${Boost_LIBRARIES})
add_definitions(-DHAVE_CAFFE) add_definitions(-DHAVE_CAFFE)
......
...@@ -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;
const int _inputHeight =32; //const int _inputHeight =32;
const int _inputWidth =100; //const int _inputWidth =100;
const int _inputChannel =1; //const int _inputChannel =1;
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) DeepCNNOpenCvDNNImpl(String modelArchFilename, String modelWeightsFilename,Ptr<ImagePreprocessor> preprocessor, int maxMinibatchSz,int inputWidth =100,int inputHeight = 32)
:minibatchSz_(maxMinibatchSz) :minibatchSz_(maxMinibatchSz),_inputWidth(inputWidth),_inputHeight(inputHeight)
{ {
CV_Assert(this->minibatchSz_>0); CV_Assert(this->minibatchSz_>0);
...@@ -612,13 +612,13 @@ public: ...@@ -612,13 +612,13 @@ public:
this->classifier_->classifyBatch(inputImageList,netOutput); this->classifier_->classifyBatch(inputImageList,netOutput);
for(int k=0;k<netOutput.rows;k++) for(int k=0;k<netOutput.rows;k++)
{ {https://www.google.es/?gfe_rd=cr&dcr=0&ei=4fq7We8Bk9jyB8zPp5AL
int classNum; int classNum;
double confidence; double confidence;
NetOutput::getClassification((float*)(netOutput.row(k).data),this->classifier_->getOutputSize(),classNum,confidence); NetOutput::getClassification((float*)(netOutput.row(k).data),this->classifier_->getOutputSize(),classNum,confidence);
transcriptionVec.push_back(this->labels_[classNum]); transcriptionVec.push_back(this->labels_[classNum]);
confidenceVec.push_back(confidence); confidenceVec.push_back(confidence);
} }https://www.google.es/?gfe_rd=cr&dcr=0&ei=4fq7We8Bk9jyB8zPp5AL
} }
......
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