(self, features)
return image, label
Returns 64x64x3 image and constant label.
Returns 64x64x3 image and constant label.
Returns 64x64x3 image and constant label .
def _parse_fn(self, features):
    """Returns 64x64x3 image and constant label."""
    image = features["image"]
    image = tf.image.resize_image_with_crop_or_pad(image, 160, 160)
    # Note: possibly consider using NumPy's imresize(image, (64, 64))
    image = tf.image.resize_images(image, [64, 64])
    image.set_shape(self.image_shape)
    image = tf.cast(image, tf.float32) / 255.0
    label = tf.constant(0, dtype=tf.int32)
    return image, label
def _parse_fn ( self , features ) : image = features [ "image" ] image = tf . image . resize_image_with_crop_or_pad ( image , 160 , 160 ) # Note: possibly consider using NumPy's imresize(image, (64, 64)) image = tf . image . resize_images ( image , [ 64 , 64 ] ) image . set_shape ( self . image_shape ) image = tf . cast ( image , tf . float32 ) / 255.0 label = tf . constant ( 0 , dtype = tf . int32 ) return image , label