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__()

get_sample_writer()

Returns a SampleWriter for this Backend.

load_model()

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

predict_scene(scene, chip_sz, stride)

Return predictions for an entire scene using the model.

train()

Train a model.

abstract get_sample_writer()[source]#

Returns a SampleWriter for this Backend.

abstract load_model()[source]#

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

abstract predict_scene(scene: Scene, chip_sz: int, stride: int) Labels[source]#

Return predictions for an entire scene using the model.

Parameters
  • scene (Scene) – Scene to run inference on.

  • chip_sz (int) –

  • stride (int) –

Returns

Labels object containing predictions

Return type

Labels

abstract train()[source]#

Train a model.

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