detection_caffe::detection_caffe(string prototxt_file, string caffe_model){
caffe_net = new Net<float>(prototxt_file, caffe::TEST);
caffe_net->CopyTrainedLayersFrom(caffe_model);
memory_data_layer = boost::static_pointer_cast<MemoryDataLayer<float> >(caffe_net->layer_by_name("data"));
}
void detection_caffe::classifySingleImage(const cv::Mat &rgb, std::vector<float> &prob_out)
{
std::vector<int> labels(1, 0);
cv::resize(rgb,cv_img,sz,0,0,cv::INTER_CUBIC);
std::vector<cv::Mat> images(1, cv_img);
memory_data_layer->AddMatVector(images, labels);
float loss;
caffe_net->ForwardPrefilled(&loss);
boost::shared_ptr<Blob<float> > prob = caffe_net->blob_by_name("prob");
prob_out.resize(prob->count());
for (int i = 0; i < prob->count(); i++)
{
prob_out[i] = prob->cpu_data()[i];
}
}
W0804 10:53:22.878911 9671 memory_data_layer.cpp:87] MemoryData does not transform array data on Reset()
W0804 10:53:22.887466 9671 memory_data_layer.cpp:87] MemoryData does not transform array data on Reset()
W0804 10:53:22.896996 9671 memory_data_layer.cpp:87] MemoryData does not transform array data on Reset()
What does this mean? Is there an operation I am supposed to be performing that I am not currently running? I can, of course, comment out the line in memory_data_layer.cpp and recompile, but I don't know why it is there in the first place, and whether or not I am supposed to be using it differently.