train.py
def split_dataset(image_paths, mask_paths, train_percentage=0.8):
    """
    Splits the dataset into a training and test set.
    image and mask paths are assumed to be in corresponding order.
    :return: train_image_paths, train_mask_paths, test_image_paths, test_mask_paths
    """
    if train_percentage > 0.0:
        all_data = list(zip(image_paths, mask_paths))
        random.shuffle(all_data)
        num_train = int(np.floor(len(image_paths) * train_percentage))
        train_image_paths = [x[0] for x in all_data[:num_train]]
        train_mask_paths = [x[1] for x in all_data[:num_train]]
        test_image_paths = [x[0] for x in all_data[num_train:]]
        test_mask_paths = [x[1] for x in all_data[num_train:]]
        #zip(*all_data[:num_train]), zip(*all_data[num_train:])
        print("Dataset split into {} training examples and {} test examples".format(len(train_mask_paths), len(test_mask_paths)))
        return train_image_paths, train_mask_paths, test_image_paths, test_mask_paths
    else:
        return image_paths, mask_paths, None, None

    Splits the dataset into a training and test set.
    image and mask paths are assumed to be in corresponding order.
    :return: train_image_paths, train_mask_paths, test_image_paths, test_mask_paths
    
Splits the dataset into a training and test set.
image and mask paths are assumed to be in corresponding order.
Splits the dataset into a training and test set . image and mask paths are assumed to be in corresponding order .
def split_dataset(image_paths, mask_paths, train_percentage=0.8):
    if train_percentage > 0.0:
        all_data = list(zip(image_paths, mask_paths))
        random.shuffle(all_data)
        num_train = int(np.floor(len(image_paths) * train_percentage))
        train_image_paths = [x[0] for x in all_data[:num_train]]
        train_mask_paths = [x[1] for x in all_data[:num_train]]
        test_image_paths = [x[0] for x in all_data[num_train:]]
        test_mask_paths = [x[1] for x in all_data[num_train:]]
        print("Dataset split into {} training examples and {} test examples".format(len(train_mask_paths), len(test_mask_paths)))
        return train_image_paths, train_mask_paths, test_image_paths, test_mask_paths
    else:
        return image_paths, mask_paths, None, None
def split_dataset ( image_paths , mask_paths , train_percentage = 0.8 ) : if train_percentage > 0.0 : all_data = list ( zip ( image_paths , mask_paths ) ) random . shuffle ( all_data ) num_train = int ( np . floor ( len ( image_paths ) * train_percentage ) ) train_image_paths = [ x [ 0 ] for x in all_data [ : num_train ] ] train_mask_paths = [ x [ 1 ] for x in all_data [ : num_train ] ] test_image_paths = [ x [ 0 ] for x in all_data [ num_train : ] ] test_mask_paths = [ x [ 1 ] for x in all_data [ num_train : ] ] print ( "Dataset split into {} training examples and {} test examples" . format ( len ( train_mask_paths ) , len ( test_mask_paths ) ) ) return train_image_paths , train_mask_paths , test_image_paths , test_mask_paths else : return image_paths , mask_paths , None , None
Splits the dataset into a training and test set.
Splits the dataset into a training and test set .
"""
    Splits the dataset into a training and test set.
    image and mask paths are assumed to be in corresponding order.
    :return: train_image_paths, train_mask_paths, test_image_paths, test_mask_paths
    """ #zip(*all_data[:num_train]), zip(*all_data[num_train:])
None
image_paths
mask_paths
train_percentage