Condividi tramite


LargePersonGroupClient.CreateAsync Method

Definition

Overloads

CreateAsync(String, String, Nullable<FaceRecognitionModel>, CancellationToken)

Create a new Large Person Group with user-specified largePersonGroupId, name, an optional userData and recognitionModel.

CreateAsync(RequestContent, RequestContext)

[Protocol Method] Create a new Large Person Group with user-specified largePersonGroupId, name, an optional userData and recognitionModel.

CreateAsync(String, String, Nullable<FaceRecognitionModel>, CancellationToken)

Source:
LargePersonGroupClient.cs

Create a new Large Person Group with user-specified largePersonGroupId, name, an optional userData and recognitionModel.

public virtual System.Threading.Tasks.Task<Azure.Response> CreateAsync (string name, string userData = default, Azure.AI.Vision.Face.FaceRecognitionModel? recognitionModel = default, System.Threading.CancellationToken cancellationToken = default);
abstract member CreateAsync : string * string * Nullable<Azure.AI.Vision.Face.FaceRecognitionModel> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response>
override this.CreateAsync : string * string * Nullable<Azure.AI.Vision.Face.FaceRecognitionModel> * System.Threading.CancellationToken -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function CreateAsync (name As String, Optional userData As String = Nothing, Optional recognitionModel As Nullable(Of FaceRecognitionModel) = Nothing, Optional cancellationToken As CancellationToken = Nothing) As Task(Of Response)

Parameters

name
String

User defined name, maximum length is 128.

userData
String

Optional user defined data. Length should not exceed 16K.

recognitionModel
Nullable<FaceRecognitionModel>

The 'recognitionModel' associated with this face list. Supported 'recognitionModel' values include 'recognition_01', 'recognition_02, 'recognition_03', and 'recognition_04'. The default value is 'recognition_01'. 'recognition_04' is recommended since its accuracy is improved on faces wearing masks compared with 'recognition_03', and its overall accuracy is improved compared with 'recognition_01' and 'recognition_02'.

cancellationToken
CancellationToken

The cancellation token to use.

Returns

Exceptions

name is null.

Examples

This sample shows how to call CreateAsync.

Uri endpoint = new Uri("<endpoint>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
LargePersonGroupClient client = new FaceAdministrationClient(endpoint, credential).GetLargePersonGroupClient("your_large_person_group_id");

Response response = await client.CreateAsync("your_large_person_group_name");

Remarks

Please refer to https://learn.microsoft.com/rest/api/face/person-group-operations/create-large-person-group for more details.

Applies to

CreateAsync(RequestContent, RequestContext)

Source:
LargePersonGroupClient.cs

[Protocol Method] Create a new Large Person Group with user-specified largePersonGroupId, name, an optional userData and recognitionModel.

public virtual System.Threading.Tasks.Task<Azure.Response> CreateAsync (Azure.Core.RequestContent content, Azure.RequestContext context = default);
abstract member CreateAsync : Azure.Core.RequestContent * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
override this.CreateAsync : Azure.Core.RequestContent * Azure.RequestContext -> System.Threading.Tasks.Task<Azure.Response>
Public Overridable Function CreateAsync (content As RequestContent, Optional context As RequestContext = Nothing) As Task(Of Response)

Parameters

content
RequestContent

The content to send as the body of the request.

context
RequestContext

The request context, which can override default behaviors of the client pipeline on a per-call basis.

Returns

The response returned from the service.

Exceptions

content is null.

Service returned a non-success status code.

Examples

This sample shows how to call CreateAsync.

Uri endpoint = new Uri("<endpoint>");
AzureKeyCredential credential = new AzureKeyCredential("<key>");
LargePersonGroupClient client = new FaceAdministrationClient(endpoint, credential).GetLargePersonGroupClient("your_large_person_group_id");

using RequestContent content = RequestContent.Create(new
{
    name = "your_large_person_group_name",
    userData = "your_user_data",
    recognitionModel = "recognition_01",
});
Response response = await client.CreateAsync(content);

Console.WriteLine(response.Status);

Applies to