caffe中Image Data layer的图像增强操作-transformer_param

caffe中ImageData layer的图像增强操作

  • mirror

    mirror:ture代表随机的左右翻转。

    It is random left-right flipping, a common operating when training models.

  • contrast_brightness_adjustment

    开启或者禁止对比度调节,默认禁止(false)
    contrast_brightness_adjustment:true

  • min_side_min

    min_side_min and min_side_max are added for random cropping while keeping the aspect ratio。 as mentioned in “Deep Residual Learning for Image Recognition”(http://arxiv.org/abs/1512.03385)
    min_side_min:224

    使用了min_side_min和min_side_max就不需要再在image_data_param中设置new_height和new_width两个参数。在这里图片将被随机resize到这个区间内

  • min_side_max

    min_side_max:256

  • crop_size

    crop_size:224
    在caffe中,如果定义了crop_size,那么在train时会对大于crop_size的图片进行随机裁剪,而在test时只是截取中间部分

  • max_rotation_angle

    图片最大的旋转角度,默认为0
    max_rotation_angle:15

  • min_contrast

    最小的对比度乘子(min alpha),默认0.8

  • max_contrast

    最大对比度乘子(max alpha),默认1.2

  • max_smooth

    最大平滑乘子,默认6
    进行高斯平滑

  • apply_probability

    每个操作被执行的概率,默认为0.5

  • max_color_shift

    在RGB轴上最大的色彩偏移
    max_color_shift:20

  • mean_value:

    BGR顺序的均值

  • debug_params

    使能或禁止打印操作参数,默认禁止
    debug_params:false

  • min_side

    resize & crop 保持纵横比,默认0,disabled

  • max_brightness_shift

    max brightness shift in positive and negative directions (beta), default 5;

  • smooth_filtering

    enable/disable smooth filterion, default false;

例子

   layer {
     name: "in_shop"
     type: "ImageData"
     top: "data"
     top: "label"
     include{
       phase: TRAIN
     }
     transform_param {
       mirror: true
       contrast_brightness_adjustment: true
       min_side_min: 224
       min_side_max: 256
       crop_size: 224
       max_rotation_angle: 15
       min_contrast: 0.8
       max_contrast: 1.2
       max_smooth: 6
       apply_probability: 0.5
       max_color_shift: 20
       mean_value: 104
       mean_value: 117
       mean_value: 123
       debug_params: false
     }
    image_data_param {
       source: "/export/home/dyh/workspace/circle_k/for_douyuhao/all-sample.txt"
       batch_size: 128
       new_height: 256
       new_width: 256
       shuffle: true
       root_folder: "/export/home/dyh/workspace/circle_k/for_douyuhao/all-images/"
     }
   }

参考:https://github.com/twtygqyy/caffe-augmentation/blob/master/README.md

你可能感兴趣的:(caffe)