Amazon Rekognition · Arazzo Workflow

Amazon Rekognition Custom Labels and Moderate

Version 1.0.0

Run a Custom Labels model on an image and then screen the same image for unsafe content.

1 workflow 1 source API 1 provider
View Spec View on GitHub Celebrity RecognitionComputer VisionContent ModerationCustom LabelsDeep LearningFace LivenessFacial RecognitionImage AnalysisMachine LearningObject DetectionText DetectionVideo AnalysisArazzoWorkflows

Provider

amazon-rekognition

Workflows

custom-labels-and-moderate
Detect custom labels then detect moderation labels for the same image.
Applies a trained Custom Labels model to an image and screens the same image for unsafe content in one pass.
2 steps inputs: bucket, minCustomConfidence, minModerationConfidence, name, projectVersionArn outputs: customLabels, moderationLabels
1
detectCustomLabels
detectCustomLabels
Apply the trained Custom Labels model to the image.
2
detectModeration
detectModerationLabels
Screen the same image for unsafe or inappropriate content.

Source API Descriptions

Arazzo Workflow Specification

amazon-rekognition-custom-labels-and-moderate-workflow.yml Raw ↑
arazzo: 1.0.1
info:
  title: Amazon Rekognition Custom Labels and Moderate
  summary: Run a Custom Labels model on an image and then screen the same image for unsafe content.
  description: >-
    A domain-specific tagging-plus-safety flow for Amazon Rekognition. The
    workflow runs DetectCustomLabels against an image using a trained Custom
    Labels project version to apply business-specific labels, then runs
    DetectModerationLabels against the same image to screen it for unsafe
    content before the custom labels are trusted. Each step spells out its AWS
    JSON 1.1 request inline, including the protocol-required X-Amz-Target header.
  version: 1.0.0
sourceDescriptions:
- name: rekognitionApi
  url: ../openapi/amazon-rekognition-openapi.yml
  type: openapi
workflows:
- workflowId: custom-labels-and-moderate
  summary: Detect custom labels then detect moderation labels for the same image.
  description: >-
    Applies a trained Custom Labels model to an image and screens the same image
    for unsafe content in one pass.
  inputs:
    type: object
    required:
    - projectVersionArn
    - bucket
    - name
    properties:
      projectVersionArn:
        type: string
        description: ARN of the trained Custom Labels model version to use.
      bucket:
        type: string
        description: S3 bucket holding the image to analyze.
      name:
        type: string
        description: S3 object key of the image.
      minCustomConfidence:
        type: number
        description: Minimum confidence for returned custom labels.
        default: 70.0
      minModerationConfidence:
        type: number
        description: Minimum confidence for returned moderation labels.
        default: 50.0
  steps:
  - stepId: detectCustomLabels
    description: Apply the trained Custom Labels model to the image.
    operationId: detectCustomLabels
    parameters:
    - name: X-Amz-Target
      in: header
      value: RekognitionService.DetectCustomLabels
    requestBody:
      contentType: application/x-amz-json-1.1
      payload:
        ProjectVersionArn: $inputs.projectVersionArn
        Image:
          S3Object:
            Bucket: $inputs.bucket
            Name: $inputs.name
        MinConfidence: $inputs.minCustomConfidence
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      customLabels: $response.body#/CustomLabels
  - stepId: detectModeration
    description: Screen the same image for unsafe or inappropriate content.
    operationId: detectModerationLabels
    parameters:
    - name: X-Amz-Target
      in: header
      value: RekognitionService.DetectModerationLabels
    requestBody:
      contentType: application/x-amz-json-1.1
      payload:
        Image:
          S3Object:
            Bucket: $inputs.bucket
            Name: $inputs.name
        MinConfidence: $inputs.minModerationConfidence
    successCriteria:
    - condition: $statusCode == 200
    outputs:
      moderationLabels: $response.body#/ModerationLabels
      moderationModelVersion: $response.body#/ModerationModelVersion
  outputs:
    customLabels: $steps.detectCustomLabels.outputs.customLabels
    moderationLabels: $steps.detectModeration.outputs.moderationLabels