code: def imagenet_preprocess_example(example, mode, resize_size=None,
                                  normalize=True):
    
    resize_size = resize_size or [299, 299]
    assert resize_size[0] == resize_size[1]
  
    image = example["inputs"]
    if mode == tf.estimator.ModeKeys.TRAIN:
      image = preprocess_for_train(image, image_size=resize_size[0],
                                   normalize=normalize)
    else:
      image = preprocess_for_eval(image, image_size=resize_size[0],
                                  normalize=normalize)
  
    example["inputs"] = image
    return example
docs: Preprocessing used for Imagenet and similar problems.