def parse_data(path):
    x_path = os.path.join(path, 'images/')
    y_path = os.path.join(path, 'masks/')
    x_file = glob(os.path.join(x_path, '*.png'))[0]
    y_files = glob(os.path.join(y_path, '*.png'))
    x = imageio.imread(x_file)
    if (x.shape != (256, 256, 4)):
        return (None, None, None)
    masks = np.array([imageio.imread(y) for y in y_files])
    y = np.zeros_like(masks[0])
    for y_raw in masks:
        y = np.maximum(y, y_raw)
    x = (x / 255.0)
    y = (y / 255.0)
    masks = (masks / 255.0)
    x = np.transpose(x, (2, 0, 1))
    return (x, y, masks)
def parse_data(path):
    x_path = os.path.join(path, 'images/')
    y_path = os.path.join(path, 'masks/')
    x_file = glob(os.path.join(x_path, '*.png'))[0]
    y_files = glob(os.path.join(y_path, '*.png'))
    x = imageio.imread(x_file)
    if (x.shape != (256, 256, 4)):
        return (None, None, None)
    masks = np.array([imageio.imread(y) for y in y_files])
    y = np.zeros_like(masks[0])
    for y_raw in masks:
        y = np.maximum(y, y_raw)
    x = (x / 255.0)
    y = (y / 255.0)
    masks = (masks / 255.0)
    x = np.transpose(x, (2, 0, 1))
    return (x, y, masks)