-
-
Save Johnson145/272377c6deff9cb96cc0aeed42922e41 to your computer and use it in GitHub Desktop.
Using tf_models.slim.preprocessing
This file contains 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 | |
# (no batch support 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