コード例 #1
0
def datasets():

    raw_pairs = generate_pairs("../inputs/train_data01")

    train_pairs = [
        p for p in raw_pairs if p[0][0].split("/")[-2][7] not in ["7"]
    ]
    eval_pairs = [p for p in raw_pairs if p[0][0].split("/")[-2][7] in ["7"]]

    print("len of train=", len(train_pairs), "len of eval=", len(eval_pairs))
    data_train = WeatherRadarDataset(pairs=train_pairs)
    data_eval = WeatherRadarDataset(pairs=eval_pairs)

    loader_train = DataLoader(data_train,
                              batch_size=4,
                              shuffle=True,
                              drop_last=False,
                              num_workers=4)

    loader_eval = DataLoader(data_eval,
                             batch_size=4,
                             shuffle=True,
                             drop_last=False,
                             num_workers=4)

    return loader_train, loader_eval
コード例 #2
0
def datasets():

    test_pairs = generate_pairs("../inputs/test_data/TEST1/")

    data_test = WeatherRadarDataset(pairs=test_pairs)

    loader_test = DataLoader(data_test, batch_size=4, drop_last=False, num_workers=4)

    return loader_test, test_pairs