PyTorchObjectDetection#
- class PyTorchObjectDetection[source]#
Bases:
PyTorchLearnerBackend
- __init__(pipeline_cfg: RVPipelineConfig, learner_cfg: LearnerConfig, tmp_dir: str)#
- Parameters:
pipeline_cfg (RVPipelineConfig) –
learner_cfg (LearnerConfig) –
tmp_dir (str) –
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, ...)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:
pipeline_cfg (RVPipelineConfig) –
learner_cfg (LearnerConfig) –
tmp_dir (str) –
- chip_dataset(dataset: DatasetConfig, chip_options: ChipOptions, dataloader_kw: dict = {}) None [source]#
Create and write chips for scenes in a
DatasetConfig
.- Parameters:
scenes – Scenes to chip.
dataset (DatasetConfig) –
chip_options (ChipOptions) –
dataloader_kw (dict) –
- Return type:
None
- chip_pytorch_dataset(dataset: Dataset, sample_writer: PyTorchLearnerSampleWriter, chip_options: ChipOptions, split: str | None = None, dataloader_kw: dict = {}) None #
- Parameters:
dataset (Dataset) –
sample_writer (PyTorchLearnerSampleWriter) –
chip_options (ChipOptions) –
split (str | None) –
dataloader_kw (dict) –
- Return type:
None
- 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:
scene (Scene) – Scene to run inference on.
predict_options (ObjectDetectionPredictOptions) – Prediction options.
- Returns:
Labels object containing predictions
- Return type:
- 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.