Skip to content

Commit

Permalink
Changed name of Imagenet mean variable, fixes #21
Browse files Browse the repository at this point in the history
  • Loading branch information
kratzert committed Oct 22, 2017
1 parent 17ff178 commit 3882adb
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions datagenerator.py
Original file line number Diff line number Diff line change
Expand Up @@ -11,7 +11,7 @@
from tensorflow.python.framework import dtypes
from tensorflow.python.framework.ops import convert_to_tensor

VGG_MEAN = tf.constant([123.68, 116.779, 103.939], dtype=tf.float32)
IMAGENET_MEAN = tf.constant([123.68, 116.779, 103.939], dtype=tf.float32)


class ImageDataGenerator(object):
Expand Down Expand Up @@ -120,7 +120,7 @@ def _parse_function_train(self, filename, label):
"""
Dataaugmentation comes here.
"""
img_centered = tf.subtract(img_resized, VGG_MEAN)
img_centered = tf.subtract(img_resized, IMAGENET_MEAN)

# RGB -> BGR
img_bgr = img_centered[:, :, ::-1]
Expand All @@ -136,7 +136,7 @@ def _parse_function_inference(self, filename, label):
img_string = tf.read_file(filename)
img_decoded = tf.image.decode_png(img_string, channels=3)
img_resized = tf.image.resize_images(img_decoded, [227, 227])
img_centered = tf.subtract(img_resized, VGG_MEAN)
img_centered = tf.subtract(img_resized, IMAGENET_MEAN)

# RGB -> BGR
img_bgr = img_centered[:, :, ::-1]
Expand Down

0 comments on commit 3882adb

Please sign in to comment.