Exemplo n.º 1
0
def build_dataset_from_catalog(catalog: Catalog, class_config: ClassConfig,
                               use_hand: bool,
                               three_class: bool) -> DatasetConfig:

    # Read taining scenes from STAC
    train_collection = catalog.get_child(id="train")
    train_scenes = make_scenes(train_collection, use_hand, three_class)

    # Read validation scenes from STAC
    validation_collection = catalog.get_child(id="validation")
    validation_scenes = make_scenes(validation_collection, use_hand,
                                    three_class)

    # Read test scenes from STAC
    test_collection = catalog.get_child(id="test")
    test_scenes = make_scenes(test_collection, use_hand, three_class)

    return DatasetConfig(
        class_config=class_config,
        train_scenes=train_scenes,
        validation_scenes=(validation_scenes + test_scenes),
    )
def build_dataset_from_catalog(catalog: Catalog, channel_order: [int],
                               class_config: ClassConfig) -> DatasetConfig:

    # Read taining scenes from STAC
    train_collection = catalog.get_child(id="training_imagery")
    train_scenes = make_scenes(train_collection, channel_order)

    # Read validation scenes from STAC
    validation_collection = catalog.get_child(id="validation_imagery")
    validation_scenes = make_scenes(validation_collection, channel_order)

    # Read testing scenes from STAC
    test_collection_0 = catalog.get_child(id="test_imagery_0")
    test_scenes_0 = make_scenes(test_collection_0, channel_order)
    test_collection_1 = catalog.get_child(id="test_imagery_1")
    test_scenes_1 = make_scenes(test_collection_1, channel_order)

    return DatasetConfig(
        class_config=class_config,
        train_scenes=train_scenes,
        validation_scenes=(test_scenes_0 + test_scenes_1),
    )
Exemplo n.º 3
0
def build_dataset_from_catalog(catalog: Catalog, channel_order: [int],
                               class_config: ClassConfig) -> DatasetConfig:

    # Read taining scenes from STAC
    train_collection = catalog.get_child(id="train")
    train_scenes = make_scenes(train_collection, channel_order)

    # Read validation scenes from STAC
    validation_collection = catalog.get_child(id="validation")
    validation_scenes = make_scenes(validation_collection, channel_order)

    # Read testing scenes from STAC
    test_collection = catalog.get_child(id="test")
    test_scenes = make_scenes(test_collection, channel_order)

    return DatasetConfig(
        class_config=class_config,
        train_scenes=train_scenes,
        test_scenes=test_scenes,
        validation_scenes=validation_scenes,
        img_channels=3,
    )