Backend#
- class Backend[source]#
Bases:
ABC
Abstraction around core ML functionality used by an RVPipeline.
This should be subclassed to enable use of a third party ML library with an RVPipeline. There is a one-to-many relationship from RVPipeline to Backend.
- __init__()#
Methods
__init__
()chip_dataset
(dataset, chip_options)Create and write chips for scenes in a
DatasetConfig
.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
()Train a model.
- abstract chip_dataset(dataset: DatasetConfig, chip_options: ChipOptions) None [source]#
Create and write chips for scenes in a
DatasetConfig
.- Parameters:
scenes – Scenes to chip.
dataset (DatasetConfig) –
chip_options (ChipOptions) –
- Return type:
None
- abstract load_model(uri: str | None = None)[source]#
Load the model in preparation for one or more prediction calls.
- Parameters:
uri (str | None) – Optional URI to load the model from.
- abstract predict_scene(scene: Scene, predict_options: PredictOptions) Labels [source]#
Return predictions for an entire scene using the model.
- Parameters:
scene (Scene) – Scene to run inference on.
predict_options (PredictOptions) – Prediction options.
- Returns:
Labels object containing predictions
- Return type: