数据制作

1.数据准备,我们需要一个train和valid文件夹,一个train.txt和val.txt(图片文件夹的位置可以任意,但是这两个txt文件的位置在data/fingervein/目录下)

train和valid文件夹自然就存放着待训练的图片,train.txt和val.txt的数据格式如下

 

复制代码
FV_USM_beforeLMDB/train_example/1/1.jpg 0 
FV_USM_beforeLMDB/train_example/1/2.jpg 0
FV_USM_beforeLMDB/train_example/1/3.jpg 0
FV_USM_beforeLMDB/train_example/1/4.jpg 0
FV_USM_beforeLMDB/train_example/1/5.jpg 0
FV_USM_beforeLMDB/train_example/1/6.jpg 0
FV_USM_beforeLMDB/train_example/2/1.jpg 1
FV_USM_beforeLMDB/train_example/2/2.jpg 1
FV_USM_beforeLMDB/train_example/2/3.jpg 1
FV_USM_beforeLMDB/train_example/2/4.jpg 1
FV_USM_beforeLMDB/train_example/2/5.jpg 1
FV_USM_beforeLMDB/train_example/2/6.jpg 1
FV_USM_beforeLMDB/train_example/3/1.jpg 2
FV_USM_beforeLMDB/train_example/3/2.jpg 2
FV_USM_beforeLMDB/train_example/3/3.jpg 2
复制代码

前边是图片路径,后便是label,注意label是从0开始的。

 

2. 在example目录下创建自己的文件夹fingervein,将imagenet中所有的文件烤过来,然后进行修改。

create_imagenet.sh

复制代码
 //当前目录
EXAMPLE=/home/wuchao/caffe/examples/fingervein
//存放train.txt和val.txt的目录
DATA=/home/wuchao/caffe/data/fingervein
//不改动
TOOLS=/home/wuchao/caffe/build/tools

//图片存放的目录
TRAIN_DATA_ROOT=/home/wuchao/caffe/MyFiles/
VAL_DATA_ROOT=/home/wuchao/caffe/MyFiles/
复制代码

运行create_imagenet.sh,生成两个数据文件lmdb

posted @ 2016-09-18 21:10  且听风吟-wuchao  阅读(294)  评论(0编辑  收藏  举报