def rand_rotate(image): angle = randint(1, 360) return rotate(image, angle, preserve_range=True).astype(np.uint8)