Close

Setup the AWS SageMaker pre-trained model

Primer plano de Kev Zettler
Kev Zettler

Desarrollador web de pila completa, DevOps

To demonstrate how to develop, deploy, and manage applications using Jira Software and various connected tools, our team created ImageLabeller, a simple demo application built on AWS that uses machine learning to apply labels to images.

This page covers how to setup an AWS SageMaker predefined model, a prerequisite for ImageLabeller to successfully process images. Before you begin, we recommend reading the ImageLabeller architecture for context.


Log in to AWS Console and navigate to Amazon SageMaker.

Screenshot of AWS console

Go to Amazon SageMaker Studio.

Screenshot of Amazon SageMaker Studio

Choose Quick start > Execution role > Create an IAM role.

Screenshot of Quick start

Click Create role. Then click Submit.

Screenshot of Create an IAM role

SageMaker will take a while to setup. Once it’s ready, click Open Studio.

Screenshot of post-setup

Click Go to SageMake JumpStart.

Screenshot of SageMaker JumpStart

Locate, and click on Inception V3.

Screenshot of vision models

Change the Machine Type to ml.m5.large, change the Endpoint Name to something more readable like “image-labeller-endpoint”, and click Deploy.

Screenshot of deploy model

AWS SageMaker will start to deploy the model.

Screenshot of deployment starting

Click Open Notebook when the deployment is finished.

Screenshot of endpoint status

Run all three of the notebook code blocks in order to verify things are working. Make a note of the endpoint_name in query_endpoint. You need to add this, and the region your AWS SageMaker notebook is in to the InvokeLabeller AWS Lambda.

For information on how to use Jupyter notebooks please read the documentation.

Screenshot query endpoint

Open InvokeLabeller’s src/app.py file and look for query_endpoint. change the endpoint_name, and client region_name to match your AWS SageMaker notebook.

def query_endpoint(img):
  endpoint_name = 'jumpstart-dft-image-labeller-endpoint'
  client = boto3.client(service_name='runtime.sagemaker', region_name='us-west-1')
  response = client.invoke_endpoint(EndpointName=endpoint_name, ContentType='application/x-image', Body=img)
  model_predictions = json.loads(response['Body'].read())['predictions'][0]
  return model_predictions

With SageMaker configuration complete, the next step is to deploy ImageLabeller with either Bitbucket, GitHub, or GitLab.

Warren Marusiak
Warren Marusiak

Warren is a Canadian developer from Vancouver, BC with over 10 years of experience. He came to Atlassian from AWS in January of 2021.


Share this article

Lecturas recomendadas

Consulta estos recursos para conocer los tipos de equipos de DevOps o para estar al tanto de las novedades sobre DevOps en Atlassian.

Ilustración de Devops

La comunidad de DevOps

Ilustración de Devops

Ruta de aprendizaje de DevOps

Ilustración de un mapa

Pruébalo gratis

Suscríbete para recibir el boletín de DevOps

Thank you for signing up