feature extraction

模型:caffe/models/bvlc_alexnet/bvlc_alexnet.caffemodel

网络:caffe/models/bvlc_alexnet/train_val.prototxt

网络为已经训练好的网络,对图片进行特征提取

自身图片所在路径为/caffe/examples/wiki-Alex/imageSegFix,其下有10类的图片

(1)修改网络的数据层

         进入/caffe/models/bvlc_alexnet,修改train_val.prototxt

         只用修改phase:TEST的,phase:TRAIN不用管

         type:"ImageData"

         mean_file:"model/bvlc_alexnet/vgg_mean.binaryprotp"

         image_data_param{

             source:"models/bvlc_alexnet/bvlc_alexnet.caffemodel"

             root_folder:"examples/wiki-Alex/imageSegFix/"

             batchsize:50

             new_height:256

             new_width:256

            }

(2)特征提取

./build/tools/extract_features.bin models/bvlc_alexnet/bvlc_alexnet.caffemodel models/bvlc_alexnet/train_val.prototxt fc7 examples/wiki-Alex/imageSegFix/features 516 leveldb GPU 0

            

        

 

你可能感兴趣的:(caffe)