class RandomFlip(object):
def __cal__(self, data):
label, input = data['label'], data['input']
if np.random.rand() > 0.5:
label = np.fliplr(label) # 2차원 배열에서 좌우로 뒤집습니다.
input = np.fliplr(input)
if np.random.rand() > 0.5:
label = np.flipud(label) # 2차원 배열에서 위아래로 뒤집습니다.
input = np.flipud(input)
data = {'label':label, 'input': input}
return data
함수에서 def cal 이름 오류
__call__
으로 고치면 해결됨. call로 넣어야 callable함.