v0.21 to v0.30#

v0.30 makes a number of breaking API changes, most of which are described below. You should also check out the updated examples and tutorials. Note that despite these changes, v0.30 is still backward compatible with model-bundles produced via older versions.

If something has been missed or you are unsure how to migrate a particular piece of code, please do not hesitate to open a new discussion.

Chip sampling configuration#

Sample code changes (also applies to chip classification and object detection):

v0.21:

window_opts = GeoDataWindowConfig(
    method=GeoDataWindowMethod.sliding, stride=chip_sz, size=chip_sz)

data = SemanticSegmentationGeoDataConfig(
    ...,
    window_opts=window_opts,
    ...,
)

pipeline = SemanticSegmentationConfig(
    ...,
    train_chip_sz=chip_sz,
)

v0.30:

from rastervision.core.rv_pipeline import (
    SemanticSegmentationChipOptions, WindowSamplingConfig, WindowSamplingMethod)

chip_options = SemanticSegmentationChipOptions(
    sampling=WindowSamplingConfig(
        method=WindowSamplingMethod.sliding, stride=chip_sz, size=chip_sz))

data = SemanticSegmentationGeoDataConfig(
    ...,
    sampling=chip_options.sampling,
    ...,
)

pipeline = SemanticSegmentationConfig(
    ...,
    chip_options=chip_options,
)

PredictOptions#

  • predict_chip_sz and predict_batch_sz have been moved to PredictOptions which also provides the new stride field.

  • ChipClassificationConfig now also expects a predict_options. Previously, this was only true for semantic segmentation and object detection.

Sample code changes (also applies to chip classification and object detection):

v0.21:

pipeline = SemanticSegmentationConfig(
    ...,
    predict_chip_sz=chip_sz,
    predict_batch_sz=batch_sz,
)

v0.30:

predict_options = SemanticSegmentationPredictOptions(
    chip_sz=chip_sz, batch_sz=batch_sz)

pipeline = SemanticSegmentationConfig(
    ...,
    predict_options=predict_options,
)

Other changes#