PyTorchSemanticSegmentation#

class PyTorchSemanticSegmentation[source]#

Bases: PyTorchLearnerBackend

__init__(pipeline_cfg: RVPipelineConfig, learner_cfg: LearnerConfig, tmp_dir: str)#
Parameters

Methods

__init__(pipeline_cfg, learner_cfg, tmp_dir)

chip_dataset(dataset, chip_options[, ...])

Create and write chips for scenes in a DatasetConfig.

chip_pytorch_dataset(dataset, sample_writer, ...)

get_sample_writer()

Returns a SampleWriter for this Backend.

load_model([uri])

Load the model in preparation for one or more prediction calls.

predict_scene(scene, predict_options)

Return predictions for an entire scene using the model.

train([source_bundle_uri])

Train a model.

__init__(pipeline_cfg: RVPipelineConfig, learner_cfg: LearnerConfig, tmp_dir: str)#
Parameters
chip_dataset(dataset: DatasetConfig, chip_options: ChipOptions, dataloader_kw: dict = {}) None[source]#

Create and write chips for scenes in a DatasetConfig.

Parameters
Return type

None

chip_pytorch_dataset(dataset: Dataset, sample_writer: PyTorchLearnerSampleWriter, chip_options: ChipOptions, split: Optional[str] = None, dataloader_kw: dict = {}) None#
Parameters
Return type

None

get_sample_writer()[source]#

Returns a SampleWriter for this Backend.

load_model(uri: Optional[str] = None)#

Load the model in preparation for one or more prediction calls.

Parameters

uri (Optional[str]) – Optional URI to load the model from.

predict_scene(scene: Scene, predict_options: SemanticSegmentationPredictOptions) SemanticSegmentationLabels[source]#

Return predictions for an entire scene using the model.

Parameters
Returns

Labels object containing predictions

Return type

SemanticSegmentationLabels

train(source_bundle_uri=None)#

Train a model.

This should download chips created by the SampleWriter, train the model, and then saving it to disk.