Added option in parameters for flip augmentation
@@ -207,6 +207,21 @@ def build_parser(parents, defaults):
type=int,
default=3
)
+ parser.add_argument(
+ "--random_flip",
+ help="Indicates whether 'flipping' should be performed "
+ "as a data-augmentation step. Please set --flip_axes"
+ " as well for correct functioning.",
+ default='False'
+ )
+ parser.add_argument(
+ "--flip_axes",
+ help="The axes which can be flipped to augment the data. Supply as "
+ "comma-separated values within single quotes, e.g. '0,1'. Note "
+ "that these are 0-indexed, so choose some combination of 0, 1, 2.",
+ type=str,
+ default=''
+ )
parser.add_argument(
"--spatial_scaling",
help="Indicates if the spatial scaling must be performed (zooming"
@@ -470,6 +485,9 @@ def correct_args_types(args):
args.rotation = True if args.rotation == "True" else False
args.spatial_scaling = True if args.spatial_scaling == "True" else False
args.output_prob = True if args.output_prob == "True" else False
+ args.random_flip = True if args.random_flip == "True" else False
+ args.flip_axes = ([int(x.strip()) for x in args.flip_axes.split(',')
+ if x.strip() in ['0', '1', '2']])
return args
