PyTorchObjectDetection#

class PyTorchObjectDetection[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: str | None = None, dataloader_kw: dict = {}) None#
Parameters:
Return type:

None

get_sample_writer()[source]#

Returns a SampleWriter for this Backend.

load_model(uri: str | None = None)#

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

Parameters:

uri (str | None) – Optional URI to load the model from.

predict_scene(scene: Scene, predict_options: ObjectDetectionPredictOptions) ObjectDetectionLabels[source]#

Return predictions for an entire scene using the model.

Parameters:
Returns:

Labels object containing predictions

Return type:

ObjectDetectionLabels

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.