Example #1
0
 def preprocess_image(cls, image, is_training, normalize_image=True):
     return VGGPreprocessing.preprocess_image(
         image=image,
         output_height=cls.INPUT_SHAPE[0],
         output_width=cls.INPUT_SHAPE[1],
         mean_center_image=normalize_image,
         is_training=is_training)
Example #2
0
    def _resize_for_compression(self, _input_image, height, width):
        """ resize image as in VGG preprocessing

        args:
          _input_image: 3-D tensor

        returns:
          resized image
        """
        if self._dataset_name == 'kodak':
            _input_image.set_shape([height, width, 3])
            return _input_image
        else:
            return VGGPreprocessing.preprocess_image(image=_input_image,
                                                     output_height=height,
                                                     output_width=width,
                                                     mean_center_image=False)
Example #3
0
 def standardize_tensor(input_tensor):
     return VGGPreprocessing.mean_image_subtraction(input_tensor)