Created
December 27, 2018 05:59
-
-
Save shangeth/5a466f97aba51a3ae0add0231f3d3296 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
import random | |
from scipy import ndarray | |
import skimage as sk | |
from skimage import transform | |
from skimage import util | |
def random_rotation(image_array: ndarray): | |
random_degree = random.uniform(-25, 25) | |
return sk.transform.rotate(image_array, random_degree) | |
def random_noise(image_array: ndarray): | |
return sk.util.random_noise(image_array) | |
def horizontal_flip(image_array: ndarray): | |
return image_array[:, ::-1] | |
def vertical_flip(image_array: ndarray): | |
return image_array[::-1, :] |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment