This article is a mirror article of machine translation, please click here to jump to the original article.

View: 10964|Reply: 0

The image conversion tool in Caffe convert_imageset

[Copy link]
Posted on 4/24/2018 7:30:28 PM | | | |
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)





Previous:Antminer B3 tells you what to dig!
Next:How to use a function in a python package
Disclaimer:
All software, programming materials or articles published by Code Farmer Network are only for learning and research purposes; The above content shall not be used for commercial or illegal purposes, otherwise, users shall bear all consequences. The information on this site comes from the Internet, and copyright disputes have nothing to do with this site. You must completely delete the above content from your computer within 24 hours of downloading. If you like the program, please support genuine software, purchase registration, and get better genuine services. If there is any infringement, please contact us by email.

Mail To:help@itsvse.com