def translate_y(image, pixels, replace): """Equivalent of PIL Translate in Y dimension.""" image = contrib_image.translate(wrap(image), [0, -pixels]) return unwrap(image, replace)
def _translate_y(image, pixels, replace): """Equivalent of PIL Translate in Y dimension.""" image = image_ops.translate(_wrap(image), [0, -pixels]) return _unwrap(image, replace)
def translate_x(image, pixels, replace): '''Equivalent of PIL Translate in X dimension.''' image = contrib_image.translate(wrap(image), [-pixels, 0]) return unwrap(image, replace)
def translate_x(image, pixels, replace): """Equivalent of PIL Translate in X dimension.""" image = image_ops.translate(wrap(image), [-pixels, 0]) return unwrap(image, replace)
def shift(self, state, img): return translate(img.astype(np.float32), state)