Call caffe script convert the picture format in order lmdb

#! / usr / bin / env  SH 
# lmdb the Create at The ImageNet the Inputs 
# NB path to the SET at The Train at The ImageNet + Val the Data dirs 

the EXAMPLE = examples / ImageNet # can change your own folder name 
the DATA = the Data / ilsvrc12 #txt file storage location 
TOOLS = Build / Tools 

TRAIN_DATA_ROOT = / path / to / ImageNet / Train /   # to change their own path to the file 
VAL_DATA_ROOT = / path / to / ImageNet / Val / 

# the Set RESIZE = to true to of a resize to 256x256 at the ImagesRF Royalty Free. the Leave AS false  IF ImagesRF Royalty Free have have 
# already been Resized a using Another Tool. 
RESIZE = false 
IF $RESIZE; then
  RESIZE_HEIGHT=256
  RESIZE_WIDTH=256
else
  RESIZE_HEIGHT=0
  RESIZE_WIDTH=0
fi

if [ ! -d "$TRAIN_DATA_ROOT" ]; then
  echo "Error: TRAIN_DATA_ROOT is not a path to a directory: $TRAIN_DATA_ROOT"
  echo "Set the TRAIN_DATA_ROOT variable in create_imagenet.sh to the path" \
       "where the ImageNet training data is stored."
  exit 1
fi

if [ ! -d "$VAL_DATA_ROOT" ]; then
  echo "Error: VAL_DATA_ROOT is not a path to a directory: $VAL_DATA_ROOT"
  echo "Set the VAL_DATA_ROOT variable in create_imagenet.sh to the path" \
       "where the ImageNet validation data is stored."
  exit 1
fi

echo "Creating train lmdb..."

GLOG_logtostderr=1 $TOOLS/convert_imageset \
    --resize_height=$RESIZE_HEIGHT \
    --resize_width=$RESIZE_WIDTH \
    --shuffle \ 
    $ TRAIN_DATA_ROOT \ 
    $ the DATA / train.txt \ # # into a training set their own txt file name 
    $ the EXAMPLE / ilsvrc12_train_lmdb # Name into their own folder, do not change, then it is automatically generated 

echo  " Creating Val lmdb ... " 

GLOG_logtostderr = 1 $ TOOLS / convert_imageset \
     --resize_height = $ RESIZE_HEIGHT \
     --resize_width = $ RESIZE_WIDTH \
     - shuffle \ 
    $ VAL_DATA_ROOT \ 
    $ the DATA / val.txt \ # into their own set of tests txt file name 
    $ the EXAMPLE / ilsvrc12_val_lmdb # into your own folder name, do not change, then it is automatically generated 

echo  " Done. "

 

Guess you like

Origin www.cnblogs.com/tay007/p/11244316.html