Skip to main content

index

Objects

BaseInput

@dataclass
class BaseInput()

Input for running the main lambda handler.

Attributes:

  • training_tile str - object path to the raster tile.
  • points str - a table reference in AuroraDB or an object path to a .shp file.
  • bucket str, optional - bucket name in which to search for data.
  • buffer_size float - radius of the buffer. This determines the size of the box around the annotation. Defaults to **4.3**m.
  • clean_edges bool - switch to reduce the size of polygons that fall out of bounds to within the bounds. Defaults to True.
  • culture str, optional - this will change the annotation class to the specified culture. Use this if you want to create a dataset of multiple classes. Defaults to Tree.
  • date str - specify a date to subset the data. Can be generated from points. Optional when loading a .shp file.
  • edge_cases bool - switch that will trigger an intersect instead of a contains. Overall this generates more annotations, but also has a higher chance of receiving edge cases. This operation is performed after converting the annotated point into the annotation box. Defaults to False.
  • job_id str, optional - Use this to collect the right image tiles from the DynamoDB. Not using this, might collect the wrong images. However, setting a unique ImageID for images during tiling & recording will circumvent this.
  • layername str, optional - Define a layername if you plan to collect annotations from AuroraDB. points needs to be defined as such.
  • validate bool - run a validation on the input points.
  • workspace str, optional - Define a workspace if you plan to collect annotations from AuroraDB. points needs to be defined as such.

Functions

lambda_handler

@tracer.capture_lambda_handler
@logger.inject_lambda_context()
def lambda_handler(event: dict, context: dict) -> dict

Function to generate annotations in a box format with image coordinates and a label.

Arguments:

  • event dict - should fit the BaseInput.
  • context dict - lambda context object.

Raises:

  • Exception - raised when there is an issue with the loaded geometry.

Returns:

  • dict - the original event with a consumed array in training_tile. This is used by the Step Function to retry on the same array.

Examples:

This examples uses a AuroraDB table.

{
"edge_cases": true,
"training_tile": [
"20211201_rgb-52-67_1387_tiled_0_0.jpeg",
"20211201_rgb-52-67_1387_tiled_1_0.jpeg",
"20211201_rgb-52-67_1387_tiled_2_0.jpeg"
],
"buffer_size": 4.3,
"points": "sipefci_113_civ_1:treecount:20211201"
}