ObjectDetection#

class ObjectDetection[source]#

Bases: RVPipeline

Attributes

commands

Built-in mutable sequence.

gpu_commands

Built-in mutable sequence.

split_commands

Built-in mutable sequence.

__init__(config: RVPipelineConfig, tmp_dir: str)#

Constructor

Parameters
  • config (RVPipelineConfig) – the configuration of this pipeline

  • tmp_dir (str) – the root any temporary directories created by running this pipeline

Methods

__init__(config, tmp_dir)

Constructor

analyze()

Run each analyzer over training scenes.

bundle()

Save a model bundle with whatever is needed to make predictions.

chip([split_ind, num_splits])

Save training and validation chips.

eval()

Evaluate predictions against ground truth.

get_train_labels(window, scene)

Return the training labels in a window for a scene.

get_train_windows(scene)

Return the training windows for a Scene.

post_process_batch(windows, chips, labels)

Post-process a batch of predictions.

post_process_predictions(labels, scene)

Post-process all labels at end of prediction.

post_process_sample(sample)

Post-process sample in pipeline-specific way.

predict([split_ind, num_splits])

Make predictions over each validation and test scene.

predict_scene(scene, backend)

test_cpu([split_ind, num_splits])

A command to test the ability to run split jobs on CPU.

test_gpu()

A command to test the ability to run on GPU.

train()

Train a model and save it.

__init__(config: RVPipelineConfig, tmp_dir: str)#

Constructor

Parameters
  • config (RVPipelineConfig) – the configuration of this pipeline

  • tmp_dir (str) – the root any temporary directories created by running this pipeline

analyze()#

Run each analyzer over training scenes.

bundle()#

Save a model bundle with whatever is needed to make predictions.

The model bundle is a zip file and it is used by the Predictor and predict CLI subcommand.

chip(split_ind: int = 0, num_splits: int = 1)#

Save training and validation chips.

Parameters
  • split_ind (int) –

  • num_splits (int) –

eval()#

Evaluate predictions against ground truth.

get_train_labels(window, scene)[source]#

Return the training labels in a window for a scene.

Returns

Labels that lie within window

get_train_windows(scene)[source]#

Return the training windows for a Scene.

Each training window represents the spatial extent of a training chip to generate.

Parameters

scene – Scene to generate windows for

post_process_batch(windows: List[Box], chips: ndarray, labels: Labels) Labels#

Post-process a batch of predictions.

Parameters
Return type

Labels

post_process_predictions(labels, scene)[source]#

Post-process all labels at end of prediction.

post_process_sample(sample: DataSample) DataSample#

Post-process sample in pipeline-specific way.

This should be called before writing a sample during chipping.

Parameters

sample (DataSample) –

Return type

DataSample

predict(split_ind=0, num_splits=1)#

Make predictions over each validation and test scene.

This uses a sliding window.

predict_scene(scene: Scene, backend: Backend) Labels[source]#
Parameters
Return type

Labels

test_cpu(split_ind: int = 0, num_splits: int = 1)#

A command to test the ability to run split jobs on CPU.

Parameters
  • split_ind (int) –

  • num_splits (int) –

test_gpu()#

A command to test the ability to run on GPU.

train()#

Train a model and save it.

property commands#

Built-in mutable sequence.

If no argument is given, the constructor creates a new empty list. The argument must be an iterable if specified.

property gpu_commands#

Built-in mutable sequence.

If no argument is given, the constructor creates a new empty list. The argument must be an iterable if specified.

property split_commands#

Built-in mutable sequence.

If no argument is given, the constructor creates a new empty list. The argument must be an iterable if specified.