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

發表評論
所有評論
還沒有人評論,想成為第一個評論的人麼? 請在上方評論欄輸入並且點擊發布.
相關文章