Introduction: convert_imageset is an image conversion tool provided by Caffe to convert training and validation image sets into lmdb or leveldb datasets that Caffe can easily process.
Application method: The tool is used in a command-line manner, which is formatted as follows: convert_imageset [FLAGS] ROOTFOLDER/ LISTFILE DB_NAME Among them DB_NAME you can also set some optional parameters, see the "Optional Parameter Settings Section" for specific optional parameters where ROOTFOLDER is the root directory of the image set LISTFILE is the path of a file that records the path and corresponding annotations of each pattern in the image set DB_NAME the name of the database to be generated
For example: convert_imageset ImgSetRootDir/ ImgFileList.txt imgSet.lmdb None of the lines in the ImgFileList.txt (i.e., LISTFILE) give information about an image, such as: subfolder1/file1. JPEG 7 where subfolder1/file1. JPEG is the image path, 7 is the category of the image, and there is a space in the middle
Optional parameter settings
- gray:bool type, default to false, if set to true, it means that the image is treated as a grayscale image, otherwise it is treated as a color image
- shuffle:bool type, defaults to false, and if set to true, it means randomly shuffling the order of the images in the image set
- backend:string type, the collection of values that can be taken is {"lmdb", "leveldb"}, and the default is "lmdb", which represents the form in which the converted data is stored
- resize_width: int32 type, the default value is 0, if it is a non-0 value, it means that the width of the image will be resized to resize_width
- resize_height: int32 type, the default value is 0, if it is a non-0 value, it means that the height of the image will be resized to resize_height
- check_size:bool type, the default value is false, if the value is true, the data will be checked to see if each piece of data is the same size when processing the data
- encoded:bool type, the default value is false, if true, it means that the encoded image will be stored, and the specific encoding method is specified by the parameter encode_type
- encode_type: string type, the default value is "", which is used to specify the encoded image to be stored, and the value is the suffix of the encoding method (e.g. 'png', 'jpg',...)
Commands with parameters: convert_imageset ImgSetRootDir/ ImgFileList.txt imgSet.lmdb --gray=true --resize_width=160 --resize_height=160
Finally, attach the bat script:
make-lmdb.bat
(875 Bytes, Number of downloads: 0)
|