convert_mat.cpp
To use it, put it under Caffe_directory/tools, and include proper Matlab headers and libraries in Caffe Makefile. I also included an example of the CMakeLists.txt:
CMakeLists.txt
This works for Mac. Under linux, the matlab path would probably be
-I/opt/matlab/extern/include
-L/opt/matlab/bin/glnxa64
Hope this small piece of code would be helpful.
Hi,
ReplyDeleteThanks for sharing. What is the efficiency? Before I am using convert_image_net, which is extremely slow.
The time it takes is almost the same as the underlying mechanism is similar (convert image/mat to datum). Another option is to use matio library for reading .mat into C.
Delete