How to crop multiple patches from training images

183 views
Skip to first unread message

Niko Gamulin

unread,
Mar 9, 2015, 8:08:20 AM3/9/15
to caffe...@googlegroups.com
Hi,

I have collection of images, which I resized to 1024x1024 and created training and test lmdb storages.

As I would like to classify patterns which are visible on smaller regions, it would be ideal if it would be possible to crop multiple smaller patches from every image so the number of training instances would be greater than the number of training images. Is there any way to crop multiple patches by simply create an appropriate definition of data layer?

Is there a simple way to modify the below definition to crop for example 4 patches:

layers {
  name: "data"
  type: DATA
  [...]
  transform_param {
    scale: 0.1
    mean_file_size: mean.binaryproto
    # for images in particular horizontal mirroring and random cropping
    # can be done as simple data augmentations.
    mirror: 1  # 1 = on, 0 = off
    # crop a `crop_size` x `crop_size` patch:
    # - at random during training
    # - from the center during testing
    crop_size: 227
  }
}


Thank you and best regards,

Niko
Reply all
Reply to author
Forward
0 new messages