caffe converts image data to lmdb file

1. Caffe installation

Installation steps: https://blog.csdn.net/yql_617540298/article/details/82718889

Second, caffe converts image data into lmdb files

I wrote a similar one before: https://blog.csdn.net/yql_617540298/article/details/82872626

After successful installation of caffe, you can see cat.jpg and fish-bike.jpg images in caffe / examples / images. At the same time, caffe provides the code to convert images, convert_imageset.cpp, which is stored in the caffe / build / tools / folder.

convert_imageset.cpp:

The format of this file: convert_imageset [FLAGS] ROOTFOLDER / LISTFILE DB_NAME
needs to take four parameters:
(1) FLAGS: picture parameter group
(2) ROOTFOLDER /: absolute path of picture storage, starting from the root directory of the Linux system
(3) LISTFILE : List of picture file list, generally a txt file, one picture
per line (4) DB_NAME: The final db file storage directory

1. List of picture files

Create script under caffe / examples / images: create_filelist.sh

# /usr/bin/env sh
MY=~/caffe/examples/images
echo "Create train.txt..."
rm -rf $MY/train.txt
f

Guess you like

Origin blog.csdn.net/yql_617540298/article/details/89792613