Caffe - Image augmentation by cropping

↘锁芯ラ 提交于 2019-12-12 02:17:28

问题


The cropping strategy of caffe is to apply random-crop for training and center-crop for testing.

From experiment, I observed that accuracy of recognition improves if I can provide two cropped version (random and center) for the same image during training. These experimental data (size 100x100) are generated offline (not using caffe) by applying random and center cropping on a 115x115 sized image.

I would like to know how to perform this task in caffe?

Note: I was thinking to use 2 data layers, each with different cropping (center and random), and then perform concatenation. However, I found that caffe does not allow center crop during training.


回答1:


Easy answer would be to prepare another already-cropped dataset of your training data, cropped to 100x100. Then mix this dataset with your original data and train. In this way, random cropping of your new images will actually give you center cropping.

More complex way is hand-crafting your batches using caffe APIs (MATLAB and Python) and feeding the hand-crafted batches on-the-fly to the network. You can check this link for different ways to achieve this.



来源:https://stackoverflow.com/questions/39633624/caffe-image-augmentation-by-cropping

标签
易学教程内所有资源均来自网络或用户发布的内容,如有违反法律规定的内容欢迎反馈
该文章没有解决你所遇到的问题?点击提问,说说你的问题,让更多的人一起探讨吧!