function [scores, maxlabel] = classification_demo(im, use_gpu)
% [scores, maxlabel] = classification_demo(im, use_gpu)
%
% 使用BVLC CaffeNet进行图像分类的示例
% 重要:运行前,应首先从Model Zoo(http://caffe.berkeleyvision.org/model_zoo.html)
%下载BVLC CaffeNet训练好的权值
%
% ****************************************************************************
% For detailed documentation and usage on Caffe's Matlab interface, please
% refer to Caffe Interface Tutorial at
% http://caffe.berkeleyvision.org/tutorial/interfaces.html#matlab
% ****************************************************************************
%
% input
% im color image as uint8 HxWx3
% use_gpu 1 to use the GPU, 0 to use the CPU
%
% output
% scores 1000-dimensional ILSVRC score vector 1000维的特征向量
% maxlabel the label of the highest score 对应分类匹配最大score的标签
%
% You may need to do the following before you start matlab:
% $ export LD_LIBRARY_PATH=/opt/intel/mkl/lib/intel64:/usr/local/cuda-5.5/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/images/cat.jpg');
% scores = classification_demo(im, 1);
% [score, class] = max(scores);
% Five things to be aware of: //五点需要注意
% caffe uses row-major order //caffe使用行主序
% matlab uses column-major order //matlab使用列主序
% caffe uses BGR color channel order //caffe使用BGR顺序
% matlab uses RGB color channel order //matlab使用RGB顺序
% images
% [scores, maxlabel] = classification_demo(im, use_gpu)
%
% 使用BVLC CaffeNet进行图像分类的示例
% 重要:运行前,应首先从Model Zoo(http://caffe.berkeleyvision.org/model_zoo.html)
%下载BVLC CaffeNet训练好的权值
%
% ****************************************************************************
% For detailed documentation and usage on Caffe's Matlab interface, please
% refer to Caffe Interface Tutorial at
% http://caffe.berkeleyvision.org/tutorial/interfaces.html#matlab
% ****************************************************************************
%
% input
% im color image as uint8 HxWx3
% use_gpu 1 to use the GPU, 0 to use the CPU
%
% output
% scores 1000-dimensional ILSVRC score vector 1000维的特征向量
% maxlabel the label of the highest score 对应分类匹配最大score的标签
%
% You may need to do the following before you start matlab:
% $ export LD_LIBRARY_PATH=/opt/intel/mkl/lib/intel64:/usr/local/cuda-5.5/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/images/cat.jpg');
% scores = classification_demo(im, 1);
% [score, class] = max(scores);
% Five things to be aware of: //五点需要注意
% caffe uses row-major order //caffe使用行主序
% matlab uses column-major order //matlab使用列主序
% caffe uses BGR color channel order //caffe使用BGR顺序
% matlab uses RGB color channel order //matlab使用RGB顺序
% images