# PYCAFFE_SRC is the python wrapper for caffe
PYCAFFE_SRC := python/caffe/pycaffe.cpp
PYCAFFE_SO := python/caffe/pycaffe.so
+# MATCAFFE_SRC is the matlab wrapper for caffe
+MATCAFFE_SRC := matlab/caffe/matcaffe.cpp
+MATCAFFE_SO := matlab/caffe/caffe
##############################
# Derive generated files
$(CXX) -shared -o $(PYCAFFE_SO) $(PYCAFFE_SRC) \
$(STATIC_NAME) $(CXXFLAGS) $(PYTHON_LDFLAGS)
+matcaffe: $(STATIC_NAME) $(MATCAFFE_SRC)
+ mex $(MATCAFFE_SRC) $(STATIC_NAME) \
+ CXXFLAGS="\$$CXXFLAGS $(CXXFLAGS) $(WARNINGS)" \
+ CXXLIBS="\$$CXXLIBS $(LDFLAGS)" \
+ -o $(MATCAFFE_SO)
+
$(NAME): $(PROTO_OBJS) $(OBJS)
$(CXX) -shared -o $(NAME) $(OBJS) $(LDFLAGS) $(WARNINGS)
%
% output
% scores 1000-dimensional ILSVRC score vector
+%
+% You may need to do the following before you start matlab:
+% $ export LD_LIBRARY_PATH=/opt/intel/mkl/lib/intel64:/usr/local/cuda/lib64
+% $ export LD_PRELOAD=/usr/lib/x86_64-linux-gnu/libstdc++.so.6
+% Or the equivalent based on where things are installed on your system
+%
+% Usage:
+% im = imread('../../examples/cat.jpg');
+% scores = matcaffe_demo(im, 1);
+% [score, class] = max(scores);
model_def_file = '../../examples/imagenet_deploy.prototxt';
% NOTE: you'll have to get the pre-trained ILSVRC network