# Amazon Rekognition

> Find objects, text, faces, celebrities, unsafe content and protective equipment in images stored in Amazon S3, and keep face collections for matching people across photos.

App · 20 actions. Web page: https://docs.lodol.com/docs/integrations/amazon-rekognition

## Actions

### Compare faces

Compare the largest face in one image with the faces in another and say how similar each is.

**Inputs**

- Source image bucket (`source_image_bucket`, text, required): S3 bucket containing the image, in the selected AWS region.
- Source image key (`source_image_key`, text, required): Object key of the image in that S3 bucket.
- Target image bucket (`target_image_bucket`, text, required): S3 bucket containing the image, in the selected AWS region.
- Target image key (`target_image_key`, text, required): Object key of the image in that S3 bucket.
- Similarity threshold (`similarity_threshold`, number): Similarity threshold. From 0 to 100.
- Quality filter (`quality_filter`, text): Quality filter. One of: `NONE`, `AUTO`, `LOW`, `MEDIUM`, `HIGH`.

**Outputs**

- `data` (object): Response.
- `next_cursor` (text): Continuation token, when returned by the service.

**Example output**

```json
{
  "data": {
    "FaceMatches": [],
    "SourceImageFace": {
      "BoundingBox": {
        "Height": 1.0,
        "Left": 1.0,
        "Top": 1.0,
        "Width": 1.0
      },
      "Confidence": 1.0
    },
    "SourceImageOrientationCorrection": "ROTATE_0",
    "TargetImageOrientationCorrection": "ROTATE_0",
    "UnmatchedFaces": []
  },
  "next_cursor": ""
}
```

### Create collection

Create a collection to store faces in, so they can be searched later.

**Inputs**

- Collection (`collection_id`, text, required): Collection id.
- Tags (`tags`, object): Tags.

**Outputs**

- `data` (object): Response.
- `next_cursor` (text): Continuation token, when returned by the service.

**Example output**

```json
{
  "data": {
    "CollectionArn": "example",
    "FaceModelVersion": "example",
    "StatusCode": 1
  },
  "next_cursor": ""
}
```

### Create user

Create a user in a collection, to group several faces of the same person.

**Inputs**

- Collection (`collection_id`, text, required): Collection id.
- User id (`rekognition_user_id`, text, required): User id.
- Client request token (`client_request_token`, text): Client request token.

**Outputs**

- `data` (object): Response.
- `next_cursor` (text): Continuation token, when returned by the service.

**Example output**

```json
{
  "data": {},
  "next_cursor": ""
}
```

### Delete collection

Delete a face collection and every face stored in it.

**Inputs**

- Collection (`collection_id`, text, required): Collection id.

**Outputs**

- `data` (object): Response.
- `next_cursor` (text): Continuation token, when returned by the service.

**Example output**

```json
{
  "data": {
    "StatusCode": 1
  },
  "next_cursor": ""
}
```

### Delete faces

Delete faces from a collection by their face IDs.

**Inputs**

- Collection (`collection_id`, text, required): Collection id.
- Face ids (`face_ids`, list, required): Face ids.

**Outputs**

- `data` (object): Response.
- `next_cursor` (text): Continuation token, when returned by the service.

**Example output**

```json
{
  "data": {
    "DeletedFaces": [],
    "UnsuccessfulFaceDeletions": []
  },
  "next_cursor": ""
}
```

### Delete user

Delete a user from a collection.

**Inputs**

- Collection (`collection_id`, text, required): Collection id.
- User (`rekognition_user_id`, text, required): User id.
- Client request token (`client_request_token`, text): Client request token.

**Outputs**

- `data` (object): Response.
- `next_cursor` (text): Continuation token, when returned by the service.

**Example output**

```json
{
  "data": {},
  "next_cursor": ""
}
```

### Describe collection

Get a face collection's details, such as how many faces and users it holds.

**Inputs**

- Collection (`collection_id`, text, required): Collection id.

**Outputs**

- `data` (object): Response.
- `next_cursor` (text): Continuation token, when returned by the service.

**Example output**

```json
{
  "data": {
    "CollectionARN": "example",
    "CreationTimestamp": "example",
    "FaceCount": 1,
    "FaceModelVersion": "example",
    "UserCount": 1
  },
  "next_cursor": ""
}
```

### Detect faces

Find the faces in an image stored in S3, with each face's position and, if asked, attributes such as age range and emotions.

**Inputs**

- Image bucket (`image_bucket`, text, required): S3 bucket containing the image, in the selected AWS region.
- Image key (`image_key`, text, required): Object key of the image in that S3 bucket.
- Attributes (`attributes`, list): Attributes. One or more of: `DEFAULT`, `ALL`, `AGE_RANGE` (Age range), `BEARD`, `EMOTIONS`, `EYE_DIRECTION` (Eye direction), `EYEGLASSES`, `EYES_OPEN` (Eyes open), `GENDER`, `MOUTH_OPEN` (Mouth open), and 4 more.

**Outputs**

- `data` (object): Response.
- `next_cursor` (text): Continuation token, when returned by the service.

**Example output**

```json
{
  "data": {
    "FaceDetails": [],
    "OrientationCorrection": "ROTATE_0"
  },
  "next_cursor": ""
}
```

### Detect labels

Find the objects, scenes and concepts in an image stored in S3, each with a confidence score.

**Inputs**

- Image bucket (`image_bucket`, text, required): S3 bucket containing the image, in the selected AWS region.
- Image key (`image_key`, text, required): Object key of the image in that S3 bucket.
- Max labels (`max_labels`, number): Max labels. At least 0.
- Min confidence (`min_confidence`, number): Min confidence. From 0 to 100.
- Features (`features`, list): Features. One or more of: `GENERAL_LABELS` (General labels), `IMAGE_PROPERTIES` (Image properties).
- Settings (`settings`, object): Settings.

**Outputs**

- `data` (object): Response.
- `next_cursor` (text): Continuation token, when returned by the service.

**Example output**

```json
{
  "data": {
    "ImageProperties": {
      "Background": {
        "DominantColors": [],
        "Quality": {}
      },
      "DominantColors": [],
      "Foreground": {
        "DominantColors": [],
        "Quality": {}
      },
      "Quality": {
        "Brightness": 1.0,
        "Contrast": 1.0,
        "Sharpness": 1.0
      }
    },
    "LabelModelVersion": "example",
    "Labels": [],
    "OrientationCorrection": "ROTATE_0"
  },
  "next_cursor": ""
}
```

### Detect moderation labels

Check an image stored in S3 for unsafe or inappropriate content, such as nudity or violence.

**Inputs**

- Image bucket (`image_bucket`, text, required): S3 bucket containing the image, in the selected AWS region.
- Image key (`image_key`, text, required): Object key of the image in that S3 bucket.
- Min confidence (`min_confidence`, number): Min confidence. From 0 to 100.
- Human loop config (`human_loop_config`, object): Human loop config.
- Project version (`project_version`, text): Project version.

**Outputs**

- `data` (object): Response.
- `next_cursor` (text): Continuation token, when returned by the service.

**Example output**

```json
{
  "data": {
    "ContentTypes": [],
    "HumanLoopActivationOutput": {
      "HumanLoopActivationConditionsEvaluationResults": "example",
      "HumanLoopActivationReasons": [],
      "HumanLoopArn": "example"
    },
    "ModerationLabels": [],
    "ModerationModelVersion": "example",
    "ProjectVersion": "example"
  },
  "next_cursor": ""
}
```

### Detect protective equipment

Find people in an image stored in S3 and whether they wear face covers, hand covers or head covers.

**Inputs**

- Image bucket (`image_bucket`, text, required): S3 bucket containing the image, in the selected AWS region.
- Image key (`image_key`, text, required): Object key of the image in that S3 bucket.
- Summarization attributes (`summarization_attributes`, object): Summarization attributes.

**Outputs**

- `data` (object): Response.
- `next_cursor` (text): Continuation token, when returned by the service.

**Example output**

```json
{
  "data": {
    "Persons": [],
    "ProtectiveEquipmentModelVersion": "example",
    "Summary": {
      "PersonsIndeterminate": [],
      "PersonsWithRequiredEquipment": [],
      "PersonsWithoutRequiredEquipment": []
    }
  },
  "next_cursor": ""
}
```

### Detect text

Read the words and lines of text in an image stored in S3.

**Inputs**

- Image bucket (`image_bucket`, text, required): S3 bucket containing the image, in the selected AWS region.
- Image key (`image_key`, text, required): Object key of the image in that S3 bucket.
- Filters (`filters`, object): Filters.

**Outputs**

- `data` (object): Response.
- `next_cursor` (text): Continuation token, when returned by the service.

**Example output**

```json
{
  "data": {
    "TextDetections": [],
    "TextModelVersion": "example"
  },
  "next_cursor": ""
}
```

### Get celebrity info

Get a celebrity's name and links to more about them, by the ID Recognize celebrities returned.

**Inputs**

- Id (`id`, text, required): Id.

**Outputs**

- `data` (object): Response.
- `next_cursor` (text): Continuation token, when returned by the service.

**Example output**

```json
{
  "data": {
    "KnownGender": {
      "Type": "Male"
    },
    "Name": "example",
    "Urls": []
  },
  "next_cursor": ""
}
```

### Index faces

Add the faces found in an image stored in S3 to a collection, so they can be searched later.

**Inputs**

- Collection (`collection_id`, text, required): Collection id.
- Image bucket (`image_bucket`, text, required): S3 bucket containing the image, in the selected AWS region.
- Image key (`image_key`, text, required): Object key of the image in that S3 bucket.
- External image id (`external_image_id`, text): External image id.
- Detection attributes (`detection_attributes`, list): Detection attributes. One or more of: `DEFAULT`, `ALL`, `AGE_RANGE` (Age range), `BEARD`, `EMOTIONS`, `EYE_DIRECTION` (Eye direction), `EYEGLASSES`, `EYES_OPEN` (Eyes open), `GENDER`, `MOUTH_OPEN` (Mouth open), and 4 more.
- Max faces (`max_faces`, number): Max faces. At least 1.
- Quality filter (`quality_filter`, text): Quality filter. One of: `NONE`, `AUTO`, `LOW`, `MEDIUM`, `HIGH`.

**Outputs**

- `data` (object): Response.
- `next_cursor` (text): Continuation token, when returned by the service.

**Example output**

```json
{
  "data": {
    "FaceModelVersion": "example",
    "FaceRecords": [],
    "OrientationCorrection": "ROTATE_0",
    "UnindexedFaces": []
  },
  "next_cursor": ""
}
```

### List collections

List the face collections in your account.

**Inputs**

- Next token (`next_token`, text): Next token.
- Max results (`max_results`, number): Max results. From 0 to 4096.

**Outputs**

- `data` (object): Response.
- `next_cursor` (text): Continuation token, when returned by the service.

**Example output**

```json
{
  "data": {
    "CollectionIds": [],
    "FaceModelVersions": [],
    "NextToken": "example"
  },
  "next_cursor": ""
}
```

### List faces

List the faces stored in a collection.

**Inputs**

- Collection (`collection_id`, text, required): Collection id.
- Next token (`next_token`, text): Next token.
- Max results (`max_results`, number): Max results. From 0 to 4096.
- User (`rekognition_user_id`, text): User id.
- Face ids (`face_ids`, list): Face ids.

**Outputs**

- `data` (object): Response.
- `next_cursor` (text): Continuation token, when returned by the service.

**Example output**

```json
{
  "data": {
    "FaceModelVersion": "example",
    "Faces": [],
    "NextToken": "example"
  },
  "next_cursor": ""
}
```

### List users

List the users in a collection.

**Inputs**

- Collection (`collection_id`, text, required): Collection id.
- Max results (`max_results`, number): Max results. From 1 to 500.
- Next token (`next_token`, text): Next token.

**Outputs**

- `data` (object): Response.
- `next_cursor` (text): Continuation token, when returned by the service.

**Example output**

```json
{
  "data": {
    "NextToken": "example",
    "Users": []
  },
  "next_cursor": ""
}
```

### Recognize celebrities

Name the celebrities whose faces appear in an image stored in S3.

**Inputs**

- Image bucket (`image_bucket`, text, required): S3 bucket containing the image, in the selected AWS region.
- Image key (`image_key`, text, required): Object key of the image in that S3 bucket.

**Outputs**

- `data` (object): Response.
- `next_cursor` (text): Continuation token, when returned by the service.

**Example output**

```json
{
  "data": {
    "CelebrityFaces": [],
    "OrientationCorrection": "ROTATE_0",
    "UnrecognizedFaces": []
  },
  "next_cursor": ""
}
```

### Search faces

Find the faces in a collection that match a face already stored in it.

**Inputs**

- Collection (`collection_id`, text, required): Collection id.
- Face (`face_id`, text, required): Face id.
- Max faces (`max_faces`, number): Max faces. From 1 to 4096.
- Face match threshold (`face_match_threshold`, number): Face match threshold. From 0 to 100.

**Outputs**

- `data` (object): Response.
- `next_cursor` (text): Continuation token, when returned by the service.

**Example output**

```json
{
  "data": {
    "FaceMatches": [],
    "FaceModelVersion": "example",
    "SearchedFaceId": "example"
  },
  "next_cursor": ""
}
```

### Search faces by image

Find the faces in a collection that match the largest face in an image stored in S3.

**Inputs**

- Collection (`collection_id`, text, required): Collection id.
- Image bucket (`image_bucket`, text, required): S3 bucket containing the image, in the selected AWS region.
- Image key (`image_key`, text, required): Object key of the image in that S3 bucket.
- Max faces (`max_faces`, number): Max faces. From 1 to 4096.
- Face match threshold (`face_match_threshold`, number): Face match threshold. From 0 to 100.
- Quality filter (`quality_filter`, text): Quality filter. One of: `NONE`, `AUTO`, `LOW`, `MEDIUM`, `HIGH`.

**Outputs**

- `data` (object): Response.
- `next_cursor` (text): Continuation token, when returned by the service.

**Example output**

```json
{
  "data": {
    "FaceMatches": [],
    "FaceModelVersion": "example",
    "SearchedFaceBoundingBox": {
      "Height": 1.0,
      "Left": 1.0,
      "Top": 1.0,
      "Width": 1.0
    },
    "SearchedFaceConfidence": 1.0
  },
  "next_cursor": ""
}
```
