Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1123,6 +1123,14 @@ public FaceListOperations(FaceClient client)
/// targetFace is required to specify which face to add. No targetFace means
/// there is only one face detected in the entire image.
/// </param>
/// <param name='detectionModel'>
/// Name of detection model. Detection model is used to detect faces from
/// images. A detection model name can be provided when performing Face -
/// Detect or (Large)FaceList - AddFace or (Large)PersonGroupPerson - AddFace.
/// The default value is 'detection_01', if latest model needed, please
/// explicitly specify the model you need. Possible values include:
/// 'detection_01', 'detection_02'
/// </param>
/// <param name='customHeaders'>
/// Headers that will be added to request.
/// </param>
Expand All @@ -1144,7 +1152,7 @@ public FaceListOperations(FaceClient client)
/// <return>
/// A response object containing the response body and response headers.
/// </return>
public async Task<HttpOperationResponse<PersistedFace>> AddFaceFromUrlWithHttpMessagesAsync(string faceListId, string url, string userData = default(string), IList<int> targetFace = default(IList<int>), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
public async Task<HttpOperationResponse<PersistedFace>> AddFaceFromUrlWithHttpMessagesAsync(string faceListId, string url, string userData = default(string), IList<int> targetFace = default(IList<int>), string detectionModel = default(string), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.Endpoint == null)
{
Expand Down Expand Up @@ -1191,6 +1199,7 @@ public FaceListOperations(FaceClient client)
tracingParameters.Add("faceListId", faceListId);
tracingParameters.Add("userData", userData);
tracingParameters.Add("targetFace", targetFace);
tracingParameters.Add("detectionModel", detectionModel);
tracingParameters.Add("imageUrl", imageUrl);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "AddFaceFromUrl", tracingParameters);
Expand All @@ -1209,6 +1218,10 @@ public FaceListOperations(FaceClient client)
{
_queryParameters.Add(string.Format("targetFace={0}", System.Uri.EscapeDataString(string.Join(",", targetFace))));
}
if (detectionModel != null)
{
_queryParameters.Add(string.Format("detectionModel={0}", System.Uri.EscapeDataString(detectionModel)));
}
if (_queryParameters.Count > 0)
{
_url += "?" + string.Join("&", _queryParameters);
Expand Down Expand Up @@ -1341,6 +1354,14 @@ public FaceListOperations(FaceClient client)
/// targetFace is required to specify which face to add. No targetFace means
/// there is only one face detected in the entire image.
/// </param>
/// <param name='detectionModel'>
/// Name of detection model. Detection model is used to detect faces from
/// images. A detection model name can be provided when performing Face -
/// Detect or (Large)FaceList - AddFace or (Large)PersonGroupPerson - AddFace.
/// The default value is 'detection_01', if latest model needed, please
/// explicitly specify the model you need. Possible values include:
/// 'detection_01', 'detection_02'
/// </param>
/// <param name='customHeaders'>
/// Headers that will be added to request.
/// </param>
Expand All @@ -1362,7 +1383,7 @@ public FaceListOperations(FaceClient client)
/// <return>
/// A response object containing the response body and response headers.
/// </return>
public async Task<HttpOperationResponse<PersistedFace>> AddFaceFromStreamWithHttpMessagesAsync(string faceListId, Stream image, string userData = default(string), IList<int> targetFace = default(IList<int>), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
public async Task<HttpOperationResponse<PersistedFace>> AddFaceFromStreamWithHttpMessagesAsync(string faceListId, Stream image, string userData = default(string), IList<int> targetFace = default(IList<int>), string detectionModel = default(string), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.Endpoint == null)
{
Expand Down Expand Up @@ -1405,6 +1426,7 @@ public FaceListOperations(FaceClient client)
tracingParameters.Add("userData", userData);
tracingParameters.Add("targetFace", targetFace);
tracingParameters.Add("image", image);
tracingParameters.Add("detectionModel", detectionModel);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "AddFaceFromStream", tracingParameters);
}
Expand All @@ -1422,6 +1444,10 @@ public FaceListOperations(FaceClient client)
{
_queryParameters.Add(string.Format("targetFace={0}", System.Uri.EscapeDataString(string.Join(",", targetFace))));
}
if (detectionModel != null)
{
_queryParameters.Add(string.Format("detectionModel={0}", System.Uri.EscapeDataString(detectionModel)));
}
if (_queryParameters.Count > 0)
{
_url += "?" + string.Join("&", _queryParameters);
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -246,12 +246,20 @@ public static partial class FaceListOperationsExtensions
/// targetFace is required to specify which face to add. No targetFace means
/// there is only one face detected in the entire image.
/// </param>
/// <param name='detectionModel'>
/// Name of detection model. Detection model is used to detect faces from
/// images. A detection model name can be provided when performing Face -
/// Detect or (Large)FaceList - AddFace or (Large)PersonGroupPerson - AddFace.
/// The default value is 'detection_01', if latest model needed, please
/// explicitly specify the model you need. Possible values include:
/// 'detection_01', 'detection_02'
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task<PersistedFace> AddFaceFromUrlAsync(this IFaceListOperations operations, string faceListId, string url, string userData = default(string), IList<int> targetFace = default(IList<int>), CancellationToken cancellationToken = default(CancellationToken))
public static async Task<PersistedFace> AddFaceFromUrlAsync(this IFaceListOperations operations, string faceListId, string url, string userData = default(string), IList<int> targetFace = default(IList<int>), string detectionModel = default(string), CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.AddFaceFromUrlWithHttpMessagesAsync(faceListId, url, userData, targetFace, null, cancellationToken).ConfigureAwait(false))
using (var _result = await operations.AddFaceFromUrlWithHttpMessagesAsync(faceListId, url, userData, targetFace, detectionModel, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
Expand Down Expand Up @@ -282,12 +290,20 @@ public static partial class FaceListOperationsExtensions
/// targetFace is required to specify which face to add. No targetFace means
/// there is only one face detected in the entire image.
/// </param>
/// <param name='detectionModel'>
/// Name of detection model. Detection model is used to detect faces from
/// images. A detection model name can be provided when performing Face -
/// Detect or (Large)FaceList - AddFace or (Large)PersonGroupPerson - AddFace.
/// The default value is 'detection_01', if latest model needed, please
/// explicitly specify the model you need. Possible values include:
/// 'detection_01', 'detection_02'
/// </param>
/// <param name='cancellationToken'>
/// The cancellation token.
/// </param>
public static async Task<PersistedFace> AddFaceFromStreamAsync(this IFaceListOperations operations, string faceListId, Stream image, string userData = default(string), IList<int> targetFace = default(IList<int>), CancellationToken cancellationToken = default(CancellationToken))
public static async Task<PersistedFace> AddFaceFromStreamAsync(this IFaceListOperations operations, string faceListId, Stream image, string userData = default(string), IList<int> targetFace = default(IList<int>), string detectionModel = default(string), CancellationToken cancellationToken = default(CancellationToken))
{
using (var _result = await operations.AddFaceFromStreamWithHttpMessagesAsync(faceListId, image, userData, targetFace, null, cancellationToken).ConfigureAwait(false))
using (var _result = await operations.AddFaceFromStreamWithHttpMessagesAsync(faceListId, image, userData, targetFace, detectionModel, null, cancellationToken).ConfigureAwait(false))
{
return _result.Body;
}
Expand Down
30 changes: 28 additions & 2 deletions sdk/cognitiveservices/Vision.Face/src/Generated/FaceOperations.cs
Original file line number Diff line number Diff line change
Expand Up @@ -986,6 +986,14 @@ public FaceOperations(FaceClient client)
/// A value indicating whether the operation should return 'recognitionModel'
/// in response.
/// </param>
/// <param name='detectionModel'>
/// Name of detection model. Detection model is used to detect faces from
/// images. A detection model name can be provided when performing Face -
/// Detect or (Large)FaceList - AddFace or (Large)PersonGroupPerson - AddFace.
/// The default value is 'detection_01', if latest model needed, please
/// explicitly specify the model you need. Possible values include:
/// 'detection_01', 'detection_02'
/// </param>
/// <param name='customHeaders'>
/// Headers that will be added to request.
/// </param>
Expand All @@ -1007,7 +1015,7 @@ public FaceOperations(FaceClient client)
/// <return>
/// A response object containing the response body and response headers.
/// </return>
public async Task<HttpOperationResponse<IList<DetectedFace>>> DetectWithUrlWithHttpMessagesAsync(string url, bool? returnFaceId = true, bool? returnFaceLandmarks = false, IList<FaceAttributeType> returnFaceAttributes = default(IList<FaceAttributeType>), string recognitionModel = default(string), bool? returnRecognitionModel = false, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
public async Task<HttpOperationResponse<IList<DetectedFace>>> DetectWithUrlWithHttpMessagesAsync(string url, bool? returnFaceId = true, bool? returnFaceLandmarks = false, IList<FaceAttributeType> returnFaceAttributes = default(IList<FaceAttributeType>), string recognitionModel = default(string), bool? returnRecognitionModel = false, string detectionModel = default(string), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.Endpoint == null)
{
Expand All @@ -1034,6 +1042,7 @@ public FaceOperations(FaceClient client)
tracingParameters.Add("returnFaceAttributes", returnFaceAttributes);
tracingParameters.Add("recognitionModel", recognitionModel);
tracingParameters.Add("returnRecognitionModel", returnRecognitionModel);
tracingParameters.Add("detectionModel", detectionModel);
tracingParameters.Add("imageUrl", imageUrl);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "DetectWithUrl", tracingParameters);
Expand Down Expand Up @@ -1063,6 +1072,10 @@ public FaceOperations(FaceClient client)
{
_queryParameters.Add(string.Format("returnRecognitionModel={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(returnRecognitionModel, Client.SerializationSettings).Trim('"'))));
}
if (detectionModel != null)
{
_queryParameters.Add(string.Format("detectionModel={0}", System.Uri.EscapeDataString(detectionModel)));
}
if (_queryParameters.Count > 0)
{
_url += "?" + string.Join("&", _queryParameters);
Expand Down Expand Up @@ -1410,6 +1423,14 @@ public FaceOperations(FaceClient client)
/// A value indicating whether the operation should return 'recognitionModel'
/// in response.
/// </param>
/// <param name='detectionModel'>
/// Name of detection model. Detection model is used to detect faces from
/// images. A detection model name can be provided when performing Face -
/// Detect or (Large)FaceList - AddFace or (Large)PersonGroupPerson - AddFace.
/// The default value is 'detection_01', if latest model needed, please
/// explicitly specify the model you need. Possible values include:
/// 'detection_01', 'detection_02'
/// </param>
/// <param name='customHeaders'>
/// Headers that will be added to request.
/// </param>
Expand All @@ -1431,7 +1452,7 @@ public FaceOperations(FaceClient client)
/// <return>
/// A response object containing the response body and response headers.
/// </return>
public async Task<HttpOperationResponse<IList<DetectedFace>>> DetectWithStreamWithHttpMessagesAsync(Stream image, bool? returnFaceId = true, bool? returnFaceLandmarks = false, IList<FaceAttributeType> returnFaceAttributes = default(IList<FaceAttributeType>), string recognitionModel = default(string), bool? returnRecognitionModel = false, Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
public async Task<HttpOperationResponse<IList<DetectedFace>>> DetectWithStreamWithHttpMessagesAsync(Stream image, bool? returnFaceId = true, bool? returnFaceLandmarks = false, IList<FaceAttributeType> returnFaceAttributes = default(IList<FaceAttributeType>), string recognitionModel = default(string), bool? returnRecognitionModel = false, string detectionModel = default(string), Dictionary<string, List<string>> customHeaders = null, CancellationToken cancellationToken = default(CancellationToken))
{
if (Client.Endpoint == null)
{
Expand All @@ -1454,6 +1475,7 @@ public FaceOperations(FaceClient client)
tracingParameters.Add("image", image);
tracingParameters.Add("recognitionModel", recognitionModel);
tracingParameters.Add("returnRecognitionModel", returnRecognitionModel);
tracingParameters.Add("detectionModel", detectionModel);
tracingParameters.Add("cancellationToken", cancellationToken);
ServiceClientTracing.Enter(_invocationId, this, "DetectWithStream", tracingParameters);
}
Expand Down Expand Up @@ -1482,6 +1504,10 @@ public FaceOperations(FaceClient client)
{
_queryParameters.Add(string.Format("returnRecognitionModel={0}", System.Uri.EscapeDataString(Rest.Serialization.SafeJsonConvert.SerializeObject(returnRecognitionModel, Client.SerializationSettings).Trim('"'))));
}
if (detectionModel != null)
{
_queryParameters.Add(string.Format("detectionModel={0}", System.Uri.EscapeDataString(detectionModel)));
}
if (_queryParameters.Count > 0)
{
_url += "?" + string.Join("&", _queryParameters);
Expand Down
Loading