Windows+caffe (ii)--image conversion to LEVEDB format

Source: Internet
Author: User
Tags shuffle

Draw on the http://blog.csdn.net/langb2014/article/details/50458520 of langb2014

And the http://blog.csdn.net/liukailun09/article/details/51119052 of liukailun09

1. Data

Download: Data from langb2014 great God: Http://pan.baidu.com/s/1nuqlTnN

Data introduction: A total of 500 pictures, divided into buses, dinosaurs, elephants, flowers and horses five classes, each class 100. The numbers begin with 3,4,5,6,7, each of which is a category. Each category was selected for 20 tests and the remaining 80 for training. So the final training picture 400, the test picture 100, a total of 5 categories. Place the picture under the Data folder in the Caffe root directory. Training Picture Catalog: data/re/train/, test picture catalog: data/re/test/

2. Convert picture to Lmdb format

(1) Create a myfile folder under examples to store the configuration files and script files.

(2) Write a script create_filelist.sh that is used to generate Train.txt and test.txt manifest files.

Because the picture is more, and I will not write the. bat file under Windows (if you write this bat file or you can use MATLAB, Python to do it: The main thing is to extract the image name and label, Write. txt file), so I downloaded Cygwin, which is a Linux command that can be emulated in Windows.

Use notepad++ to open this. sh file

"Note to change the space below windows to the specific http://www.cnblogs.com/LiuSY/p/5728855.html under Linux"

Open Cygwin to your own caffe root (enter Cd/cygdrive/d/deeptools/caffe-windows-master carriage return), then enter SH examples/myfile/create_ Filelist.sh Enter. Generates Train.txt and Test.txt

Open Train.txt

(3) Call the Convert_imageset command to convert the data format-I'm using. bat under Windows instead of. Sh. New Trconvert.bat and Teconvert.bat open with Notepad

Add in Trconvert.bat

D:/deeptools/caffe-windows-master/bin/convert_imageset.exe--shuffle--resize_height=256--resize_width=256 D:/ Deeptools/caffe-windows-master/data/re/d:/deeptools/caffe-windows-master/examples/myfile/train.txt D:/deeptools /caffe-windows-master/examples/myfile/train_db
Pause

Similarly Teconvert.bat also ibid, just change a catalogue only.

Explain the specific http://www.cnblogs.com/denny402/p/5082341.html of langb2014:

"1" D:/deeptools/caffe-windows-master/bin/convert_imageset.exe is your convert_. Imageset.exe location, I use the absolute path (if you are using the Happynear, the Caffe root directory under the bin, if you are using the official website, should be under the build/!! If not then you want to open MainBuilder.sln, right-Convert_imageset project, only for project-Generate Convert_imageset only. );

"2"--shuffle--Set the parameter-shuffle, disturb the picture order;

"3"--resize_height=256--resize_width=256 re-set the image size

"4" D:/deeptools/caffe-windows-master/data/re/d:/deeptools/caffe-windows-master/examples/myfile/train.txt Where Train.txt is located

"5" d:/deeptools/caffe-windows-master/examples/myfile/train_db data into the position after conversion to Lmdb

(4) Double-click the two bat

Look at the infor in our log.

The data is converted to Lmdb format and placed under TRAIN_DB, test_db

Windows+caffe (ii)--image conversion to LEVEDB format

Related Article

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.