23
23
from official .vision .ops import augment
24
24
from official .vision .ops import preprocess_ops
25
25
26
- MEAN_RGB = (0.485 * 255 , 0.456 * 255 , 0.406 * 255 )
27
- STDDEV_RGB = (0.229 * 255 , 0.224 * 255 , 0.225 * 255 )
28
-
29
26
DEFAULT_IMAGE_FIELD_KEY = 'image/encoded'
30
27
DEFAULT_LABEL_FIELD_KEY = 'image/class/label'
31
28
@@ -223,7 +220,7 @@ def _parse_train_image(self, decoded_tensors):
223
220
224
221
# Normalizes image with mean and std pixel values.
225
222
image = preprocess_ops .normalize_image (
226
- image , offset = MEAN_RGB , scale = STDDEV_RGB )
223
+ image , offset = preprocess_ops . MEAN_RGB , scale = preprocess_ops . STDDEV_RGB )
227
224
228
225
# Random erasing after the image has been normalized
229
226
if self ._random_erasing is not None :
@@ -258,7 +255,7 @@ def _parse_eval_image(self, decoded_tensors):
258
255
259
256
# Normalizes image with mean and std pixel values.
260
257
image = preprocess_ops .normalize_image (
261
- image , offset = MEAN_RGB , scale = STDDEV_RGB )
258
+ image , offset = preprocess_ops . MEAN_RGB , scale = preprocess_ops . STDDEV_RGB )
262
259
263
260
# Convert image to self._dtype.
264
261
image = tf .image .convert_image_dtype (image , self ._dtype )
@@ -284,6 +281,6 @@ def inference_fn(cls,
284
281
285
282
# Normalizes image with mean and std pixel values.
286
283
image = preprocess_ops .normalize_image (
287
- image , offset = MEAN_RGB , scale = STDDEV_RGB )
284
+ image , offset = preprocess_ops . MEAN_RGB , scale = preprocess_ops . STDDEV_RGB )
288
285
image .set_shape (input_image_size + [num_channels ])
289
286
return image
0 commit comments