caffe convert_image
2016-04-11 16:34
435 查看
http://stackoverflow.com/questions/31427094/guide-to-use-convert-imageset-cpp
Images: put all images in a folder (I'll call it here
Labels: create a text file (e.g.,
with a line per input image . For example:
img_0000.jpeg 1
img_0001.jpeg 0
img_0002.jpeg 0
In this example the first image is labeled
the other two are labeled
Note that label starting from zero, and continuous (连续的)
Run the binary in shell
Command line explained:
is set to 1 before calling
the logging mechanism to redirect log messages to stderr.
images to same size
change the order of images and does not preserve the order in the
Following are the path to the images folder, the labels text file and the output name. Note that the output name should not exist prior to calling
you'll get a scary error message.
Other flags that might be useful:
allows you to choose between an
or
convert all images to gray scale.
shows some help, see all relevant flags under Flags from tools/convert_imageset.cpp
https://github.com/BVLC/caffe/issues/1538#
Difference between "DataLayer" and "ImageDataLayer"
Prepare your data
Images: put all images in a folder (I'll call it here /path/to/jpegs/).
Labels: create a text file (e.g.,
/path/to/labels/train.txt)
with a line per input image . For example:
img_0000.jpeg 1
img_0001.jpeg 0
img_0002.jpeg 0
In this example the first image is labeled
1while
the other two are labeled
0.
Note that label starting from zero, and continuous (连续的)
Convert the dataset
Run the binary in shell~$ GLOG_logtostderr=1 $CAFFE_ROOT/build/tools/convert_imageset \ --resize_height=200 --resize_width=200 --shuffle \ /path/to/jpegs/ \ /path/to/labels/train.txt \ /path/to/lmdb/train_lmdb
Command line explained:
GLOG_logtostderrflag
is set to 1 before calling
convert_imagesetindicates
the logging mechanism to redirect log messages to stderr.
--resize_heightand
--resize_widthresize all input
images to same size
200x200.
--shufflerandomly
change the order of images and does not preserve the order in the
/path/to/labels/train.txtfile.
Following are the path to the images folder, the labels text file and the output name. Note that the output name should not exist prior to calling
convert_imagesetotherwise
you'll get a scary error message.
Other flags that might be useful:
--backend-
allows you to choose between an
lmdbdataset
or
levelDB.
--gray-
convert all images to gray scale.
--help-
shows some help, see all relevant flags under Flags from tools/convert_imageset.cpp
https://github.com/BVLC/caffe/issues/1538#
Difference between "DataLayer" and "ImageDataLayer"
相关文章推荐
- the 7 habits of highly effective people - be proactive
- HTML 表格表单
- Javascript 转换&#x的unicode编码字符
- js 之 this的用法
- 对Json文件的解析(读取)
- 对象信息生成Json串
- CSS的水平居中与垂直居中
- JSP - WEB组件关系(请求转发/重定向/包含)
- 未能加载文件或程序集“Newtonsoft.Json, Version=4.5.0.0, xxx”或它的某一个依赖项
- JQuery fullcalender文档
- html元素
- js插件--基于原生js写的autoComplete插件
- 服务之间Json转实体
- 向Web开发人员推荐12款优秀的 Twitter Bootstrap 组件和工具
- jsoncpp开源库简单使用
- jquery 选项卡demo
- 【今日推荐】10大流行的 Metro UI 风格的 Bootstrap 主题和模板
- CSS强制英文、中文换行与不换行 强制英文换行
- 学习前端的小天地
- MVC通过扩展HtmlHelper实现RadioButtonList