python 批量增广数据_Caffe数据增广扩展

Caffe Augmentation Extension

This is a modified caffe fork (version of 2017/3/10) with ImageData layer data augmentation, which is based on:

min_side_min nad 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)

and all functions

min_side - resize and crop preserving aspect ratio, default 0 (disabled);

max_rotation_angle - max angle for an image rotation, default 0;

contrast_brightness_adjustment - enable/disable contrast adjustment, default false;

smooth_filtering - enable/disable smooth filterion, default false;

min_contrast - min contrast multiplier (min alpha), default 0.8;

max_contrast - min contrast multiplier (max alpha), default 1.2;

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

max_smooth - max smooth multiplier, default 6;

max_color_shift - max color shift along RGB axes

apply_probability - how often every transformation should be applied, default 0.5;

debug_params - enable/disable printing tranformation parameters, default false;

from @kostyaev's caffe-augmentation are kept with slightly modifications:

How to use

You could specify your network prototxt as:

layer {

name: "data"

type: "ImageData"

top: "data"

top: "label"

include {

phase: TRAIN

}

transform_param {

mirror: true

contrast_brightness_adjustment: true

smooth_filtering: true

min_side_min: 256

min_side_max: 480

crop_size: 224

mean_file: "imagenet_mean.binaryproto"

min_contrast: 0.8

max_contrast: 1.2

max_smooth: 6

apply_probability: 0.5

max_color_shift: 20

debug_params: false

}

image_data_param {

source: "train_list.txt"

batch_size: 64

}

}

while in testing phase:

layer {

name: "data"

type: "ImageData"

top: "data"

top: "label"

include {

phase: TEST

}

transform_param {

mirror: false

min_side: 256

crop_size: 224

mean_file: "imagenet_mean.binaryproto"

}

image_data_param {

source: "test_list.txt"

batch_size: 32

}

}

评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值