How to randomly crop training images along with its position label.
I'm preprocessing images data and its labels for caffe input. I want to crop my training images randomly online (when caffe running) and I know caffe provide a random crop param in layer random crop. The issues is that my label of each corresponding image is variant when image is transformed. So in this way I have to change my label together with transformed image. I try to search my issue long time, but no use. Then I realized maybe there were two ways to solve the issues:
- get the offset of random crop image on original image. But I googled it with no answer about it.
- I'll specify the random offset online, then crop image by the specific offset crop specific offset. But how can i generate a random number when caffe training time.
- I kown preprocessing the random crop image and its label offline may be a workable method. However, it will occupied considerable space of disk, for my data-set for training is too large.
my position corresponding label:
I split each of training image as 10x10=100
grids. the label is the index of grid for specific keypoint in image. for instance, the label will be 11, when my head key-point is at position of <2th row, 1th col>
grid of image.