def crop_central_whiten_images(images=None, height=24, width=24):
 print ' [Warning] crop_central_whiten_images will be deprecated due to speed, see TFRecord tutorial for more info...'
 try:
  batch_size = int(images._shape[0])
 except:
  raise Exception('unknow batch_size of images')
 central_x = tf.Variable(tf.constant(0.1, shape=[1, height, width, 3]))
 i = tf.Variable(tf.constant(0))
 c = (lambda central_x, i: tf.less(i, batch_size))
 def body(central_x, i):
  image = tf.image.resize_image_with_crop_or_pad(tf.gather(images, i), height, width)
  image = tf.image.per_image_whitening(image)
  image = tf.expand_dims(image, 0)
  return (tf.concat(0, [central_x, image]), tf.add(i, 1))
 result = tf.while_loop(cond=c, body=body, loop_vars=(central_x, i), parallel_iterations=16)
 return result

def crop_central_whiten_images ( images = None , height = 24 , width = 24 ) : print ' [Warning] crop_central_whiten_images will be deprecated due to speed, see TFRecord tutorial for more info...' try : batch_size = int ( images . _shape [ 0 ] ) except : raise Exception ( 'unknow batch_size of images' ) central_x = tf . Variable ( tf . constant ( 0.1 , shape = [ 1 , height , width , 3 ] ) ) i = tf . Variable ( tf . constant ( 0 ) ) c = ( lambda central_x , i : tf . less ( i , batch_size ) ) def body ( central_x , i ) : image = tf . image . resize_image_with_crop_or_pad ( tf . gather ( images , i ) , height , width ) image = tf . image . per_image_whitening ( image ) image = tf . expand_dims ( image , 0 ) return ( tf . concat ( 0 , [ central_x , image ] ) , tf . add ( i , 1 ) ) result = tf . while_loop ( cond = c , body = body , loop_vars = ( central_x , i ) , parallel_iterations = 16 ) return result
crop the central of image .