frcnn_train_data_param
frcnn_train_data_param { source: "./data/train_list.txt" root_folder: "./data/train_images" num_classes: 4 ignore_label: 1 distort_param { brightness_prob: 0.5 brightness_delta: 32 contrast_prob: 0.5 contrast_lower: 0.5 contrast_upper: 1.5 hue_prob: 0.5 hue_delta: 18 saturation_prob: 0.5 saturation_lower: 0.5 saturation_upper: 1.5 random_order_prob: 0.0 } }
下面是frcnn_train_data_layer使用distort的代码,通过调用ApplyDistort函数来实现,这个函数是在im_transforms.cpp里实现的
DistortionParameter是caffe.proto中的message,就是一个类
if (param.has_distort_param()) { DistortionParameter distort_param = param.distort_param(); img = ApplyDistort(img, distort_param); }