| | 1 | | // <auto-generated> |
| | 2 | | // Copyright (c) Microsoft Corporation. All rights reserved. |
| | 3 | | // Licensed under the MIT License. See License.txt in the project root for |
| | 4 | | // license information. |
| | 5 | | // |
| | 6 | | // Code generated by Microsoft (R) AutoRest Code Generator. |
| | 7 | | // Changes may cause incorrect behavior and will be lost if the code is |
| | 8 | | // regenerated. |
| | 9 | | // </auto-generated> |
| | 10 | |
|
| | 11 | | namespace Microsoft.Azure.CognitiveServices.Vision.Face |
| | 12 | | { |
| | 13 | | using Models; |
| | 14 | | using System.Collections; |
| | 15 | | using System.Collections.Generic; |
| | 16 | | using System.Threading; |
| | 17 | | using System.Threading.Tasks; |
| | 18 | |
|
| | 19 | | /// <summary> |
| | 20 | | /// Extension methods for LargePersonGroupOperations. |
| | 21 | | /// </summary> |
| | 22 | | public static partial class LargePersonGroupOperationsExtensions |
| | 23 | | { |
| | 24 | | /// <summary> |
| | 25 | | /// Create a new large person group with user-specified largePersonGroupId, |
| | 26 | | /// name, an optional userData and recognitionModel. |
| | 27 | | /// <br /> A large person group is the container of the uploaded person |
| | 28 | | /// data, including face recognition feature, and up to 1,000,000 |
| | 29 | | /// people. |
| | 30 | | /// <br /> After creation, use [LargePersonGroup Person - |
| | 31 | | /// Create](/docs/services/563879b61984550e40cbbe8d/operations/599adcba3a7b9412a4d53f40) |
| | 32 | | /// to add person into the group, and call [LargePersonGroup - |
| | 33 | | /// Train](/docs/services/563879b61984550e40cbbe8d/operations/599ae2d16ac60f11b48b5aa4) |
| | 34 | | /// to get this group ready for [Face - |
| | 35 | | /// Identify](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395239). |
| | 36 | | /// <br /> No image will be stored. Only the person's extracted face |
| | 37 | | /// features and userData will be stored on server until [LargePersonGroup |
| | 38 | | /// Person - |
| | 39 | | /// Delete](/docs/services/563879b61984550e40cbbe8d/operations/599ade5c6ac60f11b48b5aa2) |
| | 40 | | /// or [LargePersonGroup - |
| | 41 | | /// Delete](/docs/services/563879b61984550e40cbbe8d/operations/599adc216ac60f11b48b5a9f) |
| | 42 | | /// is called. |
| | 43 | | /// <br/>'recognitionModel' should be specified to associate with this |
| | 44 | | /// large person group. The default value for 'recognitionModel' is |
| | 45 | | /// 'recognition_01', if the latest model needed, please explicitly specify the |
| | 46 | | /// model you need in this parameter. New faces that are added to an existing |
| | 47 | | /// large person group will use the recognition model that's already associated |
| | 48 | | /// with the collection. Existing face features in a large person group can't |
| | 49 | | /// be updated to features extracted by another version of recognition model. |
| | 50 | | /// * 'recognition_01': The default recognition model for [LargePersonGroup - |
| | 51 | | /// Create](/docs/services/563879b61984550e40cbbe8d/operations/599acdee6ac60f11b48b5a9d). |
| | 52 | | /// All those large person groups created before 2019 March are bonded with |
| | 53 | | /// this recognition model. |
| | 54 | | /// * 'recognition_02': Recognition model released in 2019 March. |
| | 55 | | /// 'recognition_02' is recommended since its overall accuracy is improved |
| | 56 | | /// compared with 'recognition_01'. |
| | 57 | | /// |
| | 58 | | /// Large person group quota: |
| | 59 | | /// * Free-tier subscription quota: 1,000 large person groups. |
| | 60 | | /// * S0-tier subscription quota: 1,000,000 large person groups. |
| | 61 | | /// </summary> |
| | 62 | | /// <param name='operations'> |
| | 63 | | /// The operations group for this extension method. |
| | 64 | | /// </param> |
| | 65 | | /// <param name='largePersonGroupId'> |
| | 66 | | /// Id referencing a particular large person group. |
| | 67 | | /// </param> |
| | 68 | | /// <param name='name'> |
| | 69 | | /// User defined name, maximum length is 128. |
| | 70 | | /// </param> |
| | 71 | | /// <param name='userData'> |
| | 72 | | /// User specified data. Length should not exceed 16KB. |
| | 73 | | /// </param> |
| | 74 | | /// <param name='recognitionModel'> |
| | 75 | | /// Possible values include: 'recognition_01', 'recognition_02' |
| | 76 | | /// </param> |
| | 77 | | /// <param name='cancellationToken'> |
| | 78 | | /// The cancellation token. |
| | 79 | | /// </param> |
| | 80 | | public static async Task CreateAsync(this ILargePersonGroupOperations operations, string largePersonGroupId, |
| | 81 | | { |
| 8 | 82 | | (await operations.CreateWithHttpMessagesAsync(largePersonGroupId, name, userData, recognitionModel, null |
| 8 | 83 | | } |
| | 84 | |
|
| | 85 | | /// <summary> |
| | 86 | | /// Delete an existing large person group. Persisted face features of all |
| | 87 | | /// people in the large person group will also be deleted. |
| | 88 | | /// </summary> |
| | 89 | | /// <param name='operations'> |
| | 90 | | /// The operations group for this extension method. |
| | 91 | | /// </param> |
| | 92 | | /// <param name='largePersonGroupId'> |
| | 93 | | /// Id referencing a particular large person group. |
| | 94 | | /// </param> |
| | 95 | | /// <param name='cancellationToken'> |
| | 96 | | /// The cancellation token. |
| | 97 | | /// </param> |
| | 98 | | public static async Task DeleteAsync(this ILargePersonGroupOperations operations, string largePersonGroupId, |
| | 99 | | { |
| 10 | 100 | | (await operations.DeleteWithHttpMessagesAsync(largePersonGroupId, null, cancellationToken).ConfigureAwai |
| 10 | 101 | | } |
| | 102 | |
|
| | 103 | | /// <summary> |
| | 104 | | /// Retrieve the information of a large person group, including its name, |
| | 105 | | /// userData and recognitionModel. This API returns large person group |
| | 106 | | /// information only, use [LargePersonGroup Person - |
| | 107 | | /// List](/docs/services/563879b61984550e40cbbe8d/operations/599adda06ac60f11b48b5aa1) |
| | 108 | | /// instead to retrieve person information under the large person group. |
| | 109 | | /// |
| | 110 | | /// </summary> |
| | 111 | | /// <param name='operations'> |
| | 112 | | /// The operations group for this extension method. |
| | 113 | | /// </param> |
| | 114 | | /// <param name='largePersonGroupId'> |
| | 115 | | /// Id referencing a particular large person group. |
| | 116 | | /// </param> |
| | 117 | | /// <param name='returnRecognitionModel'> |
| | 118 | | /// A value indicating whether the operation should return 'recognitionModel' |
| | 119 | | /// in response. |
| | 120 | | /// </param> |
| | 121 | | /// <param name='cancellationToken'> |
| | 122 | | /// The cancellation token. |
| | 123 | | /// </param> |
| | 124 | | public static async Task<LargePersonGroup> GetAsync(this ILargePersonGroupOperations operations, string larg |
| | 125 | | { |
| 2 | 126 | | using (var _result = await operations.GetWithHttpMessagesAsync(largePersonGroupId, returnRecognitionMode |
| | 127 | | { |
| 2 | 128 | | return _result.Body; |
| | 129 | | } |
| 2 | 130 | | } |
| | 131 | |
|
| | 132 | | /// <summary> |
| | 133 | | /// Update an existing large person group's display name and userData. The |
| | 134 | | /// properties which does not appear in request body will not be updated. |
| | 135 | | /// </summary> |
| | 136 | | /// <param name='operations'> |
| | 137 | | /// The operations group for this extension method. |
| | 138 | | /// </param> |
| | 139 | | /// <param name='largePersonGroupId'> |
| | 140 | | /// Id referencing a particular large person group. |
| | 141 | | /// </param> |
| | 142 | | /// <param name='name'> |
| | 143 | | /// User defined name, maximum length is 128. |
| | 144 | | /// </param> |
| | 145 | | /// <param name='userData'> |
| | 146 | | /// User specified data. Length should not exceed 16KB. |
| | 147 | | /// </param> |
| | 148 | | /// <param name='cancellationToken'> |
| | 149 | | /// The cancellation token. |
| | 150 | | /// </param> |
| | 151 | | public static async Task UpdateAsync(this ILargePersonGroupOperations operations, string largePersonGroupId, |
| | 152 | | { |
| 0 | 153 | | (await operations.UpdateWithHttpMessagesAsync(largePersonGroupId, name, userData, null, cancellationToke |
| 0 | 154 | | } |
| | 155 | |
|
| | 156 | | /// <summary> |
| | 157 | | /// Retrieve the training status of a large person group (completed or |
| | 158 | | /// ongoing). |
| | 159 | | /// </summary> |
| | 160 | | /// <param name='operations'> |
| | 161 | | /// The operations group for this extension method. |
| | 162 | | /// </param> |
| | 163 | | /// <param name='largePersonGroupId'> |
| | 164 | | /// Id referencing a particular large person group. |
| | 165 | | /// </param> |
| | 166 | | /// <param name='cancellationToken'> |
| | 167 | | /// The cancellation token. |
| | 168 | | /// </param> |
| | 169 | | public static async Task<TrainingStatus> GetTrainingStatusAsync(this ILargePersonGroupOperations operations, |
| | 170 | | { |
| 8 | 171 | | using (var _result = await operations.GetTrainingStatusWithHttpMessagesAsync(largePersonGroupId, null, c |
| | 172 | | { |
| 8 | 173 | | return _result.Body; |
| | 174 | | } |
| 8 | 175 | | } |
| | 176 | |
|
| | 177 | | /// <summary> |
| | 178 | | /// List all existing large person groups’ largePersonGroupId, name, userData |
| | 179 | | /// and recognitionModel.<br /> |
| | 180 | | /// * Large person groups are stored in alphabetical order of |
| | 181 | | /// largePersonGroupId. |
| | 182 | | /// * "start" parameter (string, optional) is a user-provided |
| | 183 | | /// largePersonGroupId value that returned entries have larger ids by string |
| | 184 | | /// comparison. "start" set to empty to indicate return from the first item. |
| | 185 | | /// * "top" parameter (int, optional) specifies the number of entries to |
| | 186 | | /// return. A maximal of 1000 entries can be returned in one call. To fetch |
| | 187 | | /// more, you can specify "start" with the last returned entry’s Id of the |
| | 188 | | /// current call. |
| | 189 | | /// <br /> |
| | 190 | | /// For example, total 5 large person groups: "group1", ..., "group5". |
| | 191 | | /// <br /> "start=&top=" will return all 5 groups. |
| | 192 | | /// <br /> "start=&top=2" will return "group1", "group2". |
| | 193 | | /// <br /> "start=group2&top=3" will return "group3", "group4", |
| | 194 | | /// "group5". |
| | 195 | | /// |
| | 196 | | /// </summary> |
| | 197 | | /// <param name='operations'> |
| | 198 | | /// The operations group for this extension method. |
| | 199 | | /// </param> |
| | 200 | | /// <param name='start'> |
| | 201 | | /// List large person groups from the least largePersonGroupId greater than the |
| | 202 | | /// "start". |
| | 203 | | /// </param> |
| | 204 | | /// <param name='top'> |
| | 205 | | /// The number of large person groups to list. |
| | 206 | | /// </param> |
| | 207 | | /// <param name='returnRecognitionModel'> |
| | 208 | | /// A value indicating whether the operation should return 'recognitionModel' |
| | 209 | | /// in response. |
| | 210 | | /// </param> |
| | 211 | | /// <param name='cancellationToken'> |
| | 212 | | /// The cancellation token. |
| | 213 | | /// </param> |
| | 214 | | public static async Task<IList<LargePersonGroup>> ListAsync(this ILargePersonGroupOperations operations, str |
| | 215 | | { |
| 0 | 216 | | using (var _result = await operations.ListWithHttpMessagesAsync(start, top, returnRecognitionModel, null |
| | 217 | | { |
| 0 | 218 | | return _result.Body; |
| | 219 | | } |
| 0 | 220 | | } |
| | 221 | |
|
| | 222 | | /// <summary> |
| | 223 | | /// Queue a large person group training task, the training task may not be |
| | 224 | | /// started immediately. |
| | 225 | | /// </summary> |
| | 226 | | /// <param name='operations'> |
| | 227 | | /// The operations group for this extension method. |
| | 228 | | /// </param> |
| | 229 | | /// <param name='largePersonGroupId'> |
| | 230 | | /// Id referencing a particular large person group. |
| | 231 | | /// </param> |
| | 232 | | /// <param name='cancellationToken'> |
| | 233 | | /// The cancellation token. |
| | 234 | | /// </param> |
| | 235 | | public static async Task TrainAsync(this ILargePersonGroupOperations operations, string largePersonGroupId, |
| | 236 | | { |
| 4 | 237 | | (await operations.TrainWithHttpMessagesAsync(largePersonGroupId, null, cancellationToken).ConfigureAwait |
| 4 | 238 | | } |
| | 239 | |
|
| | 240 | | } |
| | 241 | | } |