#NEWLINE# def perturb_and_dscrop( img , ds_transforms , augmentation_params , target_sizes = None ) : #NEWLINE# #INDENT# if ( target_sizes is None ) : #NEWLINE# #INDENT# target_sizes = [ ( 53 , 53 ) for _ in xrange ( len ( ds_transforms ) ) ] #NEWLINE# #UNINDENT# tform_augment = random_perturbation_transform ( ** augmentation_params ) #NEWLINE# result = [ ] #NEWLINE# for ( tform_ds , target_size ) in zip ( ds_transforms , target_sizes ) : #NEWLINE# #INDENT# result . append ( fast_warp ( img , ( tform_ds + tform_augment ) , output_shape = target_size , mode = 'reflect' ) . astype ( 'float32' ) ) #NEWLINE# #UNINDENT# return result