LargeFaceListClient.CreateAsync Method
Definition
Important
Some information relates to prerelease product that may be substantially modified before it’s released. Microsoft makes no warranties, express or implied, with respect to the information provided here.
Overloads
CreateAsync(RequestContent, RequestContext) |
[Protocol Method] Create an empty Large Face List with user-specified largeFaceListId, name, an optional userData and recognitionModel.
|
CreateAsync(String, String, Nullable<FaceRecognitionModel>, CancellationToken) |
Create an empty Large Face List with user-specified largeFaceListId, name, an optional userData and recognitionModel. |
CreateAsync(RequestContent, RequestContext)
- Source:
- LargeFaceListClient.cs
[Protocol Method] Create an empty Large Face List with user-specified largeFaceListId, name, an optional userData and recognitionModel.
- This protocol method allows explicit creation of the request and processing of the response for advanced scenarios.
- Please try the simpler CreateAsync(String, String, Nullable<FaceRecognitionModel>, CancellationToken) convenience overload with strongly typed models first.
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>");
LargeFaceListClient client = new FaceAdministrationClient(endpoint, credential).GetLargeFaceListClient("your_large_face_list_id");
using RequestContent content = RequestContent.Create(new
{
name = "your_large_face_list_name",
userData = "your_user_data",
recognitionModel = "recognition_01",
});
Response response = await client.CreateAsync(content);
Console.WriteLine(response.Status);
Applies to
CreateAsync(String, String, Nullable<FaceRecognitionModel>, CancellationToken)
- Source:
- LargeFaceListClient.cs
Create an empty Large Face List with user-specified largeFaceListId, 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>");
LargeFaceListClient client = new FaceAdministrationClient(endpoint, credential).GetLargeFaceListClient("your_large_face_list_id");
Response response = await client.CreateAsync("your_large_face_list_name");
Remarks
Please refer to https://learn.microsoft.com/rest/api/face/face-list-operations/create-large-face-list for more details.
Applies to
Azure SDK for .NET