segmentation-labeling-app
This repository contains the required infrastructure and data transformations to deploy a custom labeling workflow using AWS Sagemaker Ground Truth. It is currently in active development. The community is welcome to use this repository as a template or resource for creating Sagemaker Ground Truth applications.
Level of support
We are not currently supporting this code, but simply releasing it to the community AS IS. We are not able to provide any guarantees of support. The community may submit issues, but you should not expect an active response.
Contributing
This tool is important for internal use at the Allen Institute. Because it's designed for internal needs, we are not anticipating external contributions. Pull requests may not be accepted if they conflict with our existing plans.
Steps to deploy on Sagemaker Ground Truth
Deploy Lambdas
From the top level directory, run:
sam build
sam deploy
This will deploy the lambda stack with the following values:
Stack name : gt-lambdas
Region : us-west-2
Confirm changeset : True
Deployment s3 bucket : aws-sam-cli-managed-default-samclisourcebucket-1jbjkzibjwsu5
Capabilities : ["CAPABILITY_IAM"]
To change these default values, see the documentation for sam deploy
,
or use sam deploy --guided
to deploy in guided mode.
Create SageMaker Ground Truth Job
Create Private Workforce
If you want to use a private labelling workforce (that doesn't already exist), you'll need to create it ahead of time. The easist way to do this is through the console.
- Access SageMaker through the AWS Console
- Ground Truth > Labeling Workforces > Private > Create private team
- Follow the instructions in the console to finish team creation
Once you create the team, you'll need to add workers to it.
- Access SageMaker through the AWS Console
- Ground Truth > Labeling Workforces > Private
- Under Workers, click "Invite new workers"
- Add the email addresses of the workers you want to invite
- Go back to SageMaker > Ground Truth > Labeling Workforces > Private
- Click on the name of the team you want to add the user to, under Private Teams
- Under the summary, click on the Workers tab
- Select "Add workers to team". You should see the users you invited in step 4.
Collect Input Data
Prior to creating a labeling job, ensure the following:
- All data required for the labeling job are uploaded to an s3 bucket
- A json manifest file in the proper format specifies the inputs to be labeled is uploaded to s3
- If you want to save your annotation data in a separate bucket, ensure that bucket is created.
Note that the region of the Sagemaker GT Job and S3 buckets must be the same.
Create Job via Console
- Access SageMaker through the AWS Console
- Ground Truth > Labeling Jobs > Create Labeling Job
- Follow the prompts to provide your input data manifest, output data location, etc.
- For Task Type, choose "Custom" from the dropdown menu
- Click "next"
- Under "Workers", click "Private"
- Select your private team from the dropdown menu below, and follow the rest of the instructions for timeout and workers per task
- Under Templates, "Custom" should be selected from the dropdown menu, and you should see a form field with some boilerplate html code
- Copy the contents of
slapp/app/index.html
into the form box
- Select your Lambda functions. If you used the default values for deployment during the deploy lambdas step, then the relevant Lambdas should be named "gt-lambdas-PreAnnotationLabelingFunction-\<id>"
and "gt-lambdas-PostAnnotationLabelingFunction-\<id>".
- Click "Create"
User Interface
The user interface contains the following features:
- 128x128 px views of the ROI, including:
- Full playable 2p recording (downsampled to 4Hz)
- Maximum projection image
- Average projection image
- ROI "postal stamp"
- Toggle-able ROI overlays, including:
- Weighted mask
- Outline
- None
- Interactive chart of 2p recording trace with the following features:
- Select and zoom points by clicking and dragging
- Select and navigate points with navigation bar
- Play 2p recording for the selected points
- Skip to a point in movie by selecting point in trace
- Adjust 2p recording (using CSS Filters)
- Zoom in views on mouse hover
- Colorblind mode