Predictor#

class Predictor[source]#

Bases: object

Class for making predictions based off of a model bundle.

__init__(model_bundle_uri: str, tmp_dir: str, update_stats: bool = False, channel_order: list[int] | None = None, scene_group: str | None = None)[source]#

Creates a new Predictor.

Parameters:
  • model_bundle_uri (str) – URI of the model bundle to use. Can be any type of URI that Raster Vision can read.

  • tmp_dir (str) – Temporary directory in which to store files that are used by the Predictor. This directory is not cleaned up by this class.

  • channel_order (list[int] | None) – Option for a new channel order to use for the imagery being predicted against. If not present, the channel_order from the original configuration in the predict package will be used.

  • update_stats (bool) –

  • scene_group (str | None) –

Methods

__init__(model_bundle_uri, tmp_dir[, ...])

Creates a new Predictor.

predict(image_uris, label_uri)

Generate predictions for the given image.

__init__(model_bundle_uri: str, tmp_dir: str, update_stats: bool = False, channel_order: list[int] | None = None, scene_group: str | None = None)[source]#

Creates a new Predictor.

Parameters:
  • model_bundle_uri (str) – URI of the model bundle to use. Can be any type of URI that Raster Vision can read.

  • tmp_dir (str) – Temporary directory in which to store files that are used by the Predictor. This directory is not cleaned up by this class.

  • channel_order (list[int] | None) – Option for a new channel order to use for the imagery being predicted against. If not present, the channel_order from the original configuration in the predict package will be used.

  • update_stats (bool) –

  • scene_group (str | None) –

predict(image_uris: list[str], label_uri: str) None[source]#

Generate predictions for the given image.

Parameters:
  • image_uris (list[str]) – URIs of the images to make predictions against. This can be any type of URI readable by Raster Vision FileSystems.

  • label_uri (str) – URI to save labels off into

Return type:

None