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: Optional[List[int]] = None, scene_group: Optional[str] = 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 (Optional[List[int]]) – 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 (Optional[str]) –

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: Optional[List[int]] = None, scene_group: Optional[str] = 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 (Optional[List[int]]) – 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 (Optional[str]) –

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