Skip to content

Instantly share code, notes, and snippets.

@vertix
Last active June 3, 2018 15:08
Show Gist options
  • Save vertix/8c76a7678644e4c7d9726f9db3e3b834 to your computer and use it in GitHub Desktop.
Save vertix/8c76a7678644e4c7d9726f9db3e3b834 to your computer and use it in GitHub Desktop.
Using tf_models.slim.preprocessing
# You need to add your local TF-models slim directory to PYTHON_PATH
# or just run script from this directory.
import tensorflow as tf
from preprocessing import inception_preprocessing
# you can use any uint8 tensor of matching dimensions
single_image = tf.placeholder(tf.uint8, shape=(None, None, 3))
# Augmentation operations are created here
augmented_image = inception_preprocessing.preprocess_image(
single_image, height=299, width=299, is_training=True)
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment