Last active
June 3, 2018 15:08
-
-
Save vertix/8c76a7678644e4c7d9726f9db3e3b834 to your computer and use it in GitHub Desktop.
Using tf_models.slim.preprocessing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
# 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