Datum::set_data(const ::std::string& value),what does the parameter 'value' mean?

19 views
Skip to first unread message

Rx Hu

unread,
Dec 8, 2016, 9:08:29 AM12/8/16
to Caffe Users
I want to modify the convert_imageset.cpp to read .raw file into lmdb database. I have read about the function ReadImageToDatum.
The part to input image data into datum is below:

std::vector<uchar> buf;

cv::imencode("." + encoding, cv_img, buf);

datum->set_data(std::string(reinterpret_cast<char*>(&buf[0]),buf.size()));  


I have searched the source code about the set_data function.It is as following,

Datum::set_data(const ::std::string& value)


My data is .raw file and the data type is short int.

How can I put short int type data into the datum with the function Datum::set_data(const ::std::string& value)?

What does the parameter 'value' mean in the function?

Reply all
Reply to author
Forward
0 new messages