# Quickstart - Compare Faces

> The purpose of this guide is to help you create a working sample of the [Compare Faces](https://docs.uipath.com/activities/other/latest/legacy-integrations/amazon-rekognition-compare-faces#compare-faces) activity. This working sample enables you to quickly verify the connection to your AWS account and get familiar with the activity's input/output datatypes.

## Overview

The purpose of this guide is to help you create a working sample of the [Compare Faces](https://docs.uipath.com/activities/other/latest/legacy-integrations/amazon-rekognition-compare-faces#compare-faces) activity. This working sample enables you to quickly verify the connection to your AWS account and get familiar with the activity's input/output datatypes.

By completing the steps in this guide, you'll have an automation sequence that does the following:

1. Establishes a connection to your AWS account and Amazon Rekognition service via the [Amazon Scope](https://docs.uipath.com/activities/other/latest/legacy-integrations/amazon-rekognition-amazon-scope#amazon-scope) activity.
2. Compares the the most prominent face in your source image to the faces detected in your target image, returning an array of face matches via the [Compare Faces](https://docs.uipath.com/activities/other/latest/legacy-integrations/amazon-rekognition-compare-faces#compare-faces) activity.
3. Tests the **Compare Faces** input/output properties via the [If](https://docs.uipath.com/activities/docs/if), [For Each](https://docs.uipath.com/activities/docs/for-each) and [Write Line](https://docs.uipath.com/activities/docs/write-line) activities.

   ![docs image](https://dev-assets.cms.uipath.com/assets/images/activities/legacy-integrations-docs-image-23787-4ad5f080-1f83743c.webp)

## Prerequisites

Before you begin, complete the applicable prerequisites below.

If you've completed the prerequisites for a different Amazon Rekognition [Quickstart](https://docs.uipath.com/activities/other/latest/legacy-integrations/amazon-rekognition-quickstarts) guide, you'r all set and can go straight to the **Steps** section below.

1. Complete the Amazon Rekognition [Setup](https://docs.uipath.com/activities/other/latest/legacy-integrations/amazon-rekognition-setup#setup) steps.
2. Create a new automation project.
   1. Open UiPath Studio.
   2. Under **New Project**, click **Process** (this opens a **New Blank Process** window).
   3. Enter a project **Name**, **Location**, and **Description**.
   4. Click **Create**.

      ![docs image](https://dev-assets.cms.uipath.com/assets/images/activities/legacy-integrations-docs-image-22859-60ad26ab-2f6dd8e4.webp)
3. Install the **UiPath.Amazon.Scope.Activities** and **UiPath.Amazon.Rekognition.Activities** packages.
   1. In the **Design** ribbon, click **Manage Packages** (this opens the **Manage Packages** window).
   2. Under **All Packages**, click **Go!**
   3. In the **Search** bar, enter *Amazon*.
   4. Click, install and accept the license for both the **UiPath.Amazon.Scope.Activities** and **UiPath.Amazon.Rekognition.Activities**.
      * For more information about Uipath Studio packages, see [Managing Packages](https://docs.uipath.com/studio/docs/managing-activities-packages) in the Studio Guide.

        ![docs image](https://dev-assets.cms.uipath.com/assets/images/activities/legacy-integrations-docs-image-24511-ed4ba018-b4d3e230.webp)

## Steps

Build Your Project

1. Add the [Amazon Scope](https://docs.uipath.com/activities/other/latest/legacy-integrations/amazon-rekognition-amazon-scope#amazon-scope) activity to your project.
2. Add the [Compare Faces](https://docs.uipath.com/activities/other/latest/legacy-integrations/amazon-rekognition-compare-faces#compare-faces) activity after the **Amazon Scope** activity.
3. Enter the **SourceImagePath** or **SourceImageURL** of the image that includes the face you want compared to the target input image.
   * Recommendation: create a `String` variable for your image location so that you can reuse it in other activities (e.g., **Identify Faces**, **Add Faces**).
4. Enter the **TargetImagePath** or **TargetImageURL** of the image that includes the face you want compared to the source input image.
   * Recommendation: create a `String` variable for your image location so that you can reuse it in other activities (e.g., **Identify Faces**, **Add Faces**).
5. (Optional) Enter a **Confidence** value (for testing purposes, set this value low so that you can easily compare images with different faces while still seeing the output data).
6. Create and enter a `FaceMatch[]` variable for your **MatchingFaces** value (e.g., *matchingFaces*).
   * When creating your variable, select the *UiPath.Amazon.Rekognition.Models.Face[]* variable type.

     ![docs image](https://dev-assets.cms.uipath.com/assets/images/activities/legacy-integrations-docs-image-23251-de8cd00c-bdb20c1f.webp)

Test Your Project

1. To test the **Compare Face** activity, add an [If](https://docs.uipath.com/activities/docs/if) activity that includes a a [For Each](https://docs.uipath.com/activities/docs/for-each) with a [Write Line](https://docs.uipath.com/activities/docs/write-line) activity in both the **Then** and **Else** statement box.
2. In the **Condition** property, enter a value that measures the **Confidence** level of your **MatchingFaces** `FaceMatch[]` variable by writing the following: *matchingFaces.Length>=.98* (e.g., if the confidence level of the matching faces is equal to or greater than 98%).
3. In the **Then** statement box, add a **For Each** activity with a **Write Line** activity.
   1. In the **TypeArgument** property, select *UiPath.Amazon.Rekognition.Models.FaceMatch*.
   2. In the **Values** property, enter the `Face[]` variable you created in step 4 above (e.g., *matchingFaces*)..
   3. In the **Text** property, enter *"The faces match! | " + item.Confidence.ToString*.
4. Copy the the **For Each** activity from the **Then** statement box and paste it into the **Else** statement box. In the **Else** statement box, add a **For Each** activity with a **Write Line** activity.
   1. Edit the **Text** property value to *"The faces don't match | " + item.Confidence.ToString*.
5. Click **Run** and verify the **Output** window includes the face detail values you entered in the **Write Line** activity.

   ![docs image](https://dev-assets.cms.uipath.com/assets/images/activities/legacy-integrations-docs-image-24151-106d7eac-27c894ff.webp)

You're done!

When you're ready, try the other [Quickstart](https://docs.uipath.com/activities/other/latest/legacy-integrations/amazon-rekognition-quickstarts) guides to get more familiar with the different Amazon Rekognition activities.

To learn more about the other Amazon Rekognition activities, see the [Activities](https://docs.uipath.com/activities/other/latest/legacy-integrations/amazon-rekognition-activities#activities) page for a complete activity list and links to the activity detail pages.
