index
Objects
BaseInput
@dataclass
class BaseInput()
Input for running the main lambda handler.
Attributes:
training_tilestr - object path to the raster tile.pointsstr - a table reference in AuroraDB or an object path to a .shp file.bucketstr, optional - bucket name in which to search for data.buffer_sizefloat - radius of the buffer. This determines the size of the box around the annotation. Defaults to **4.3**m.clean_edgesbool - switch to reduce the size of polygons that fall out of bounds to within the bounds. Defaults to True.culturestr, optional - this will change the annotation class to the specifiedculture. Use this if you want to create a dataset of multiple classes. Defaults to Tree.datestr - specify a date to subset the data. Can be generated frompoints. Optional when loading a .shp file.edge_casesbool - 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_idstr, 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.layernamestr, optional - Define a layername if you plan to collect annotations from AuroraDB.pointsneeds to be defined as such.validatebool - run a validation on the inputpoints.workspacestr, optional - Define a workspace if you plan to collect annotations from AuroraDB.pointsneeds 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:
eventdict - should fit the BaseInput.contextdict - lambda context object.
Raises:
Exception- raised when there is an issue with the loaded geometry.
Returns:
dict- the original event with a consumed array intraining_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"
}