[caffe]extract feature
2016-06-08 18:27
423 查看
记得最开始看caffe的时候就在纠结
deploy.prototxt
看,deploy.prototxt里没有data层!那怎么输入图像???
网上说
http://caffe.berkeleyvision.org/gathered/examples/feature_extraction.html
我照着这个把deploy.prototxt加了一层data层然后出错了..
好像大家都是拿pyhton+deploy.prototxt去提取特征.
http://stackoverflow.com/questions/32379878/cheat-sheet-for-caffe-pycaffe
http://christopher5106.github.io/deep/learning/2015/09/04/Deep-learning-tutorial-on-Caffe-Technology.html
这是单张图的
我修改了下,可以读入一个txt,提取多张图的特征
https://github.com/apsvvfb/caffe_extract_features/tree/master
最后读数据的时候
2.这里用了
explanation: http://www.marekrei.com/blog/transforming-images-to-feature-vectors/
github: https://gist.github.com/marekrei/7adc87d2c4fde941cea6
http://blog.csdn.net/guoyilin/article/details/42886365
train_val.prototxt和
deploy.prototxt到底有啥区别, 今天要用别人的一个模型提特征, 网站上(https://staff.fnwi.uva.nl/p.s.m.mettes/index.html#data)提供的是caffe model 和 deploy.prototxt, 查了一下午到底怎么提…
deploy.prototxt
name: "CaffeNet" input: "data" input_shape { dim: 10 dim: 3 dim: 227 dim: 227 } layer { name: "conv1" type: "Convolution" bottom: "data" top: "conv1" convolution_param { num_output: 96 kernel_size: 11 stride: 4 } }
看,deploy.prototxt里没有data层!那怎么输入图像???
网上说
train_val.prototxt是用来训练的,
deploy.prototxt是用来提特征/分类的.
1. c++
caffe官方的提特征是用的train_val.prototxt
http://caffe.berkeleyvision.org/gathered/examples/feature_extraction.html
我照着这个把deploy.prototxt加了一层data层然后出错了..
好像大家都是拿pyhton+deploy.prototxt去提取特征.
2. python
tutorial
http://nbviewer.jupyter.org/github/BVLC/caffe/blob/master/examples/01-learning-lenet.ipynbhttp://stackoverflow.com/questions/32379878/cheat-sheet-for-caffe-pycaffe
http://christopher5106.github.io/deep/learning/2015/09/04/Deep-learning-tutorial-on-Caffe-Technology.html
code
http://nbviewer.jupyter.org/github/BVLC/caffe/blob/master/examples/00-classification.ipynb这是单张图的
#Load an image (that comes with Caffe) and perform the preprocessing we've set up. image = caffe.io.load_image(caffe_root + 'examples/images/cat.jpg') transformed_image = transformer.preprocess('data', image) #copy the image data into the memory allocated for the net net.blobs['data'].data[ ...] = transformed_image
我修改了下,可以读入一个txt,提取多张图的特征
https://github.com/apsvvfb/caffe_extract_features/tree/master
image = caffe.io.load_image(caffe_root + 'examples/images/cat.jpg') transformed_image = transformer.preprocess('data', image) net.blobs['data'].data[0, ...] = transformed_image image = caffe.io.load_image(caffe_root + 'examples/images/fish-bike.jpg') transformed_image = transformer.preprocess('data', image) net.blobs['data'].data[1, ...] = transformed_image
最后读数据的时候
# The first layer output of first image, conv1 (rectified responses of the filters above, first 36 only) feat = net.blobs['conv1'].data[0, :36] # The first layer output of second image feat = net.blobs['conv1'].data[1, :36]
2.这里用了
caffe.Classifier(), 我看到说现在都用
forward()函数了
explanation: http://www.marekrei.com/blog/transforming-images-to-feature-vectors/
github: https://gist.github.com/marekrei/7adc87d2c4fde941cea6
http://blog.csdn.net/guoyilin/article/details/42886365
相关文章推荐
- VC中程序调用Js自定义函数的注意事项
- 【JSHint解读二】 jshint 配置解析
- Javascript 注入攻击
- WebBrowser介绍——Javascript与C++互操作
- 前端路由
- 实例讲解JavaScript中instanceof运算符的用法
- [前端框架]React
- nodejs从零开始--菜鸟爬坑之旅
- javascript浅谈数组的声明
- Bootstrap输入框组
- WordPress init admin_init 加载多次js文件后,js扩展不能运行
- js cookie 读和写
- 前端画面-下拉后滚动
- jQuery中checkbox的checked属性
- html弹出浮动层
- JavaScript DOM(三) Element 类型
- 网页展示本地图片
- node express安装
- javascript 常用函数(二)
- NodeJS 学习记录