def Reflect(X):
    Xt = []
    for x in X:
        if py_rng.random() > 0.5:
            x = np.flipud(x)
        if py_rng.random() > 0.5:
            x = np.fliplr(x)
        Xt.append(x)
    return Xt
Example #2
0
def Reflect(X):
	Xt = []
	for x in X:
		if py_rng.random() > 0.5:
			x = np.flipud(x)
		if py_rng.random() > 0.5:
			x = np.fliplr(x)
		Xt.append(x)
	return Xt
def ColorShift(X, p=1 / 3., scale=20):
    Xt = []
    for x in X:
        x = x.astype(np.int16)
        x[:, :, 0] += (py_rng.random() < p) * py_rng.randint(-scale, scale)
        x[:, :, 1] += (py_rng.random() < p) * py_rng.randint(-scale, scale)
        x[:, :, 2] += (py_rng.random() < p) * py_rng.randint(-scale, scale)
        x = np.clip(x, 0, 255).astype(np.uint8)
        Xt.append(x)
    return Xt
Example #4
0
def ColorShift(X, p=1/3., scale=20):
    Xt = []
    for x in X:
        x = x.astype(np.int16)
        x[:, :, 0] += (py_rng.random() < p)*py_rng.randint(-scale, scale)
        x[:, :, 1] += (py_rng.random() < p)*py_rng.randint(-scale, scale)
        x[:, :, 2] += (py_rng.random() < p)*py_rng.randint(-scale, scale)
        x = np.clip(x, 0, 255).astype(np.uint8)
        Xt.append(x)
    return Xt
def FlipHorizontal(X):
    Xt = []
    for x in X:
        if py_rng.random() > 0.5:
            x = np.fliplr(x)
        Xt.append(x)
    return Xt
def FlipVertical(X):
    Xt = []
    for x in X:
        if py_rng.random() > 0.5:
            x = np.flipud(x)
        Xt.append(x)
    return Xt
Example #7
0
def FlipHorizontal(X):
	Xt = []
	for x in X:
		if py_rng.random() > 0.5:
			x = np.fliplr(x)
		Xt.append(x)
	return Xt
Example #8
0
def FlipVertical(X):
	Xt = []
	for x in X:
		if py_rng.random() > 0.5:
			x = np.flipud(x)
		Xt.append(x)
	return Xt
def SeqDelete(X, p_delete):
    Xt = []
    for x in X:
        Xt.append([w for w in x if py_rng.random() > p_delete])
    return Xt
Example #10
0
def SeqDelete(X, p_delete):
    Xt = []
    for x in X:
        Xt.append([w for w in x if py_rng.random() > p_delete])
    return Xt