You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The Identify operation takes an image of a person (or multiple people) and looks to find the identity of each face in the image. It compares each detected face to a **PersonGroup**, a database of different **Person** objects whose facial features are known. In order to do the Identify operation, you first need to create and train a **PersonGroup**
177
+
178
+
### Create and train a person group
175
179
176
180
The following code creates a **PersonGroup** with six different **Person** objects. It associates each **Person** with a set of example images, and then it trains to recognize each person by their facial characteristics. **Person** and **PersonGroup** objects are used in the Verify, Identify, and Group operations.
177
181
@@ -183,35 +187,28 @@ The code later in this section will specify a recognition model to extract data
In a new method, add the following code. This code associates the names of persons with their example images.
196
+
In a new method, add the following code. This method will carry out the Identify operation. The first block of code associates the names of persons with their example images.
Next, add the following code to create a **Person** object for each person in the Dictionary and add the face data from the appropriate images. Each **Person** object is associated with the same **PersonGroup** through its unique ID string. Remember to pass the variables `client`, `url`, and `RECOGNITION_MODEL1` into this method.
Once you've extracted face data from your images and sorted it into different **Person** objects, you must train the **PersonGroup** to identify the visual features associated with each of its **Person** objects. The following code calls the asynchronous **train** method and polls the results, printing the status to the console.
This **Person** group and its associated **Person** objects are now ready to be used in the Verify, Identify, or Group operations.
207
211
208
-
## Identify a face
209
-
210
-
The Identify operation takes an image of a person (or multiple people) and looks to find the identity of each face in the image. It compares each detected face to a **PersonGroup**, a database of different **Person** objects whose facial features are known.
211
-
212
-
> [!IMPORTANT]
213
-
> In order to run this example, you must first run the code in [Create and train a person group](#create-and-train-a-person-group). The variables used in that section—`client`, `url`, and `RECOGNITION_MODEL1`—must also be available here.
214
-
215
212
### Get a test image
216
213
217
214
Notice that the code for [Create and train a person group](#create-and-train-a-person-group) defines a variable `sourceImageFileName`. This variable corresponds to the source image—the image that contains people to identify.
@@ -222,7 +219,7 @@ The following code takes the source image and creates a list of all the faces de
The next code snippet calls the Identify operation and prints the results to the console. Here, the service attempts to match each face from the source image to a **Person** in the given **PersonGroup**.
222
+
The next code snippet calls the **IdentifyAsync** operation and prints the results to the console. Here, the service attempts to match each face from the source image to a **Person** in the given **PersonGroup**. This closes out your Identify method.
0 commit comments