get_sam_masks()#

function get_sam_masks(prediction_image, gdf_bb, signal_image=None, sam=None, predictor=None)#

Run sam over an image to get predicted masks on bounding box regions.

Parameters:
  • prediction_image (ndarray) – the image to predict masks on

  • gdf_bb (GeoDataFrame) – a geopandas object with an envelope (bounding box) of image regions

  • signal_image (ndarray) – the image to get signal points from

  • sam (segment_anything.predictor.Sam) – sam model (if one not provided will create one)

  • predictor (segment_anything.SamPredictor) – the sam predictor (if one not provided will create one)

Return type:

Tensor