samgis.prediction_api package

Submodules

samgis.prediction_api.predictors module

functions using machine learning instance model(s)

samgis.prediction_api.predictors.samexporter_predict(bbox, prompt, zoom, model_name='mobile_sam', source='https://tile.openstreetmap.org/{z}/{x}/{y}.png', source_name=None)[source]

Return predictions as a geojson from a geo-referenced image using the given input prompt.

  1. if necessary instantiate a segment anything machine learning instance model

  2. download a geo-referenced raster image delimited by the coordinates bounding box (bbox)

  3. get a prediction image from the segment anything instance model using the input prompt

  4. get a geo-referenced geojson from the prediction image

Parameters:
  • bbox (LlistFloat) – coordinates bounding box

  • prompt (ListDict) – machine learning input prompt

  • zoom (float) – Level of detail

  • model_name (str, default: 'mobile_sam') – machine learning model name

  • source (str, default: 'https://tile.openstreetmap.org/{z}/{x}/{y}.png') – xyz tile provider object

  • source_name (str, default: None) – name of tile provider

Return type:

DictStrInt

Returns:

Affine transform

Module contents

functions useful to handle machine learning models