azure_cognitiveservices_face 0.17.1 → 0.18.0
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +4 -4
- data/lib/1.0/generated/azure_cognitiveservices_face.rb +38 -22
- data/lib/1.0/generated/azure_cognitiveservices_face/face.rb +554 -77
- data/lib/1.0/generated/azure_cognitiveservices_face/face_client.rb +24 -5
- data/lib/1.0/generated/azure_cognitiveservices_face/face_list_operations.rb +169 -36
- data/lib/1.0/generated/azure_cognitiveservices_face/large_face_list_operations.rb +1559 -0
- data/lib/1.0/generated/azure_cognitiveservices_face/large_person_group_operations.rb +854 -0
- data/lib/1.0/generated/azure_cognitiveservices_face/large_person_group_person.rb +1151 -0
- data/lib/1.0/generated/azure_cognitiveservices_face/models/apply_snapshot_request.rb +69 -0
- data/lib/1.0/generated/azure_cognitiveservices_face/models/detected_face.rb +13 -0
- data/lib/1.0/generated/azure_cognitiveservices_face/models/face_attributes.rb +1 -1
- data/lib/1.0/generated/azure_cognitiveservices_face/models/face_list.rb +10 -1
- data/lib/1.0/generated/azure_cognitiveservices_face/models/find_similar_request.rb +23 -1
- data/lib/1.0/generated/azure_cognitiveservices_face/models/gender.rb +0 -1
- data/lib/1.0/generated/azure_cognitiveservices_face/models/identify_request.rb +34 -16
- data/lib/1.0/generated/azure_cognitiveservices_face/models/large_face_list.rb +81 -0
- data/lib/1.0/generated/azure_cognitiveservices_face/models/large_person_group.rb +81 -0
- data/lib/1.0/generated/azure_cognitiveservices_face/models/meta_data_contract.rb +72 -0
- data/lib/1.0/generated/azure_cognitiveservices_face/models/name_and_user_data_contract.rb +1 -1
- data/lib/1.0/generated/azure_cognitiveservices_face/models/operation_status.rb +112 -0
- data/lib/1.0/generated/azure_cognitiveservices_face/models/operation_status_type.rb +18 -0
- data/lib/1.0/generated/azure_cognitiveservices_face/models/person_group.rb +11 -2
- data/lib/1.0/generated/azure_cognitiveservices_face/models/recognition_model.rb +16 -0
- data/lib/1.0/generated/azure_cognitiveservices_face/models/snapshot.rb +136 -0
- data/lib/1.0/generated/azure_cognitiveservices_face/models/snapshot_apply_mode.rb +15 -0
- data/lib/1.0/generated/azure_cognitiveservices_face/models/snapshot_object_type.rb +18 -0
- data/lib/1.0/generated/azure_cognitiveservices_face/models/take_snapshot_request.rb +101 -0
- data/lib/1.0/generated/azure_cognitiveservices_face/models/training_status.rb +25 -7
- data/lib/1.0/generated/azure_cognitiveservices_face/models/{update_person_face_request.rb → update_face_request.rb} +5 -5
- data/lib/1.0/generated/azure_cognitiveservices_face/models/update_snapshot_request.rb +73 -0
- data/lib/1.0/generated/azure_cognitiveservices_face/models/verify_face_to_face_request.rb +1 -1
- data/lib/1.0/generated/azure_cognitiveservices_face/models/verify_face_to_person_request.rb +27 -7
- data/lib/1.0/generated/azure_cognitiveservices_face/person_group_operations.rb +203 -34
- data/lib/1.0/generated/azure_cognitiveservices_face/person_group_person.rb +49 -29
- data/lib/1.0/generated/azure_cognitiveservices_face/snapshot_operations.rb +969 -0
- data/lib/profiles/latest/modules/face_profile_module.rb +125 -69
- data/lib/version.rb +1 -1
- metadata +19 -3
@@ -12,11 +12,15 @@ module Azure::CognitiveServices::Face::V1_0
|
|
12
12
|
include MsRestAzure::Serialization
|
13
13
|
|
14
14
|
# @return [String] the base URI of the service.
|
15
|
-
|
15
|
+
attr_reader :base_url
|
16
16
|
|
17
17
|
# @return Credentials needed for the client to connect to Azure.
|
18
18
|
attr_reader :credentials1
|
19
19
|
|
20
|
+
# @return [String] Supported Cognitive Services endpoints (protocol and
|
21
|
+
# hostname, for example: https://westus.api.cognitive.microsoft.com).
|
22
|
+
attr_accessor :endpoint
|
23
|
+
|
20
24
|
# @return Subscription credentials which uniquely identify client
|
21
25
|
# subscription.
|
22
26
|
attr_accessor :credentials
|
@@ -45,15 +49,26 @@ module Azure::CognitiveServices::Face::V1_0
|
|
45
49
|
# @return [FaceListOperations] face_list_operations
|
46
50
|
attr_reader :face_list_operations
|
47
51
|
|
52
|
+
# @return [LargePersonGroupPerson] large_person_group_person
|
53
|
+
attr_reader :large_person_group_person
|
54
|
+
|
55
|
+
# @return [LargePersonGroupOperations] large_person_group_operations
|
56
|
+
attr_reader :large_person_group_operations
|
57
|
+
|
58
|
+
# @return [LargeFaceListOperations] large_face_list_operations
|
59
|
+
attr_reader :large_face_list_operations
|
60
|
+
|
61
|
+
# @return [SnapshotOperations] snapshot_operations
|
62
|
+
attr_reader :snapshot_operations
|
63
|
+
|
48
64
|
#
|
49
65
|
# Creates initializes a new instance of the FaceClient class.
|
50
66
|
# @param credentials [MsRest::ServiceClientCredentials] credentials to authorize HTTP requests made by the service client.
|
51
|
-
# @param base_url [String] the base URI of the service.
|
52
67
|
# @param options [Array] filters to be applied to the HTTP requests.
|
53
68
|
#
|
54
|
-
def initialize(credentials = nil,
|
69
|
+
def initialize(credentials = nil, options = nil)
|
55
70
|
super(credentials, options)
|
56
|
-
@base_url =
|
71
|
+
@base_url = '{Endpoint}/face/v1.0'
|
57
72
|
|
58
73
|
fail ArgumentError, 'invalid type of credentials input parameter' unless credentials.is_a?(MsRest::ServiceClientCredentials) unless credentials.nil?
|
59
74
|
@credentials = credentials
|
@@ -62,6 +77,10 @@ module Azure::CognitiveServices::Face::V1_0
|
|
62
77
|
@person_group_person = PersonGroupPerson.new(self)
|
63
78
|
@person_group_operations = PersonGroupOperations.new(self)
|
64
79
|
@face_list_operations = FaceListOperations.new(self)
|
80
|
+
@large_person_group_person = LargePersonGroupPerson.new(self)
|
81
|
+
@large_person_group_operations = LargePersonGroupOperations.new(self)
|
82
|
+
@large_face_list_operations = LargeFaceListOperations.new(self)
|
83
|
+
@snapshot_operations = SnapshotOperations.new(self)
|
65
84
|
@accept_language = 'en-US'
|
66
85
|
@long_running_operation_retry_timeout = 30
|
67
86
|
@generate_client_request_id = true
|
@@ -133,7 +152,7 @@ module Azure::CognitiveServices::Face::V1_0
|
|
133
152
|
#
|
134
153
|
def add_telemetry
|
135
154
|
sdk_information = 'azure_cognitiveservices_face'
|
136
|
-
sdk_information = "#{sdk_information}/0.
|
155
|
+
sdk_information = "#{sdk_information}/0.18.0"
|
137
156
|
add_user_agent_information(sdk_information)
|
138
157
|
end
|
139
158
|
end
|
@@ -22,60 +22,152 @@ module Azure::CognitiveServices::Face::V1_0
|
|
22
22
|
attr_reader :client
|
23
23
|
|
24
24
|
#
|
25
|
-
# Create an empty face list
|
25
|
+
# Create an empty face list with user-specified faceListId, name, an optional
|
26
|
+
# userData and recognitionModel. Up to 64 face lists are allowed in one
|
26
27
|
# subscription.
|
28
|
+
# <br /> Face list is a list of faces, up to 1,000 faces, and used by [Face -
|
29
|
+
# Find
|
30
|
+
# Similar](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395237).
|
31
|
+
# <br /> After creation, user should use [FaceList - Add
|
32
|
+
# Face](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395250)
|
33
|
+
# to import the faces. Faces are stored on server until [FaceList -
|
34
|
+
# Delete](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039524f)
|
35
|
+
# is called.
|
36
|
+
# <br /> Find Similar is used for scenario like finding celebrity-like faces,
|
37
|
+
# similar face filtering, or as a light way face identification. But if the
|
38
|
+
# actual use is to identify person, please use
|
39
|
+
# [PersonGroup](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395244)
|
40
|
+
# /
|
41
|
+
# [LargePersonGroup](/docs/services/563879b61984550e40cbbe8d/operations/599acdee6ac60f11b48b5a9d)
|
42
|
+
# and [Face -
|
43
|
+
# Identify](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395239).
|
44
|
+
# <br /> Please consider
|
45
|
+
# [LargeFaceList](/docs/services/563879b61984550e40cbbe8d/operations/5a157b68d2de3616c086f2cc)
|
46
|
+
# when the face number is large. It can support up to 1,000,000 faces.
|
47
|
+
# 'recognitionModel' should be specified to associate with this face list. The
|
48
|
+
# default value for 'recognitionModel' is 'recognition_01', if the latest model
|
49
|
+
# needed, please explicitly specify the model you need in this parameter. New
|
50
|
+
# faces that are added to an existing face list will use the recognition model
|
51
|
+
# that's already associated with the collection. Existing face features in a
|
52
|
+
# face list can't be updated to features extracted by another version of
|
53
|
+
# recognition model.
|
54
|
+
#
|
27
55
|
#
|
28
56
|
# @param face_list_id [String] Id referencing a particular face list.
|
29
57
|
# @param name [String] User defined name, maximum length is 128.
|
30
58
|
# @param user_data [String] User specified data. Length should not exceed 16KB.
|
59
|
+
# @param recognition_model [RecognitionModel] Possible values include:
|
60
|
+
# 'recognition_01', 'recognition_02'
|
31
61
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
32
62
|
# will be added to the HTTP request.
|
33
63
|
#
|
34
64
|
#
|
35
|
-
def create(face_list_id, name:nil, user_data:nil, custom_headers:nil)
|
36
|
-
response = create_async(face_list_id, name:name, user_data:user_data, custom_headers:custom_headers).value!
|
65
|
+
def create(face_list_id, name:nil, user_data:nil, recognition_model:nil, custom_headers:nil)
|
66
|
+
response = create_async(face_list_id, name:name, user_data:user_data, recognition_model:recognition_model, custom_headers:custom_headers).value!
|
37
67
|
nil
|
38
68
|
end
|
39
69
|
|
40
70
|
#
|
41
|
-
# Create an empty face list
|
71
|
+
# Create an empty face list with user-specified faceListId, name, an optional
|
72
|
+
# userData and recognitionModel. Up to 64 face lists are allowed in one
|
42
73
|
# subscription.
|
74
|
+
# <br /> Face list is a list of faces, up to 1,000 faces, and used by [Face -
|
75
|
+
# Find
|
76
|
+
# Similar](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395237).
|
77
|
+
# <br /> After creation, user should use [FaceList - Add
|
78
|
+
# Face](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395250)
|
79
|
+
# to import the faces. Faces are stored on server until [FaceList -
|
80
|
+
# Delete](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039524f)
|
81
|
+
# is called.
|
82
|
+
# <br /> Find Similar is used for scenario like finding celebrity-like faces,
|
83
|
+
# similar face filtering, or as a light way face identification. But if the
|
84
|
+
# actual use is to identify person, please use
|
85
|
+
# [PersonGroup](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395244)
|
86
|
+
# /
|
87
|
+
# [LargePersonGroup](/docs/services/563879b61984550e40cbbe8d/operations/599acdee6ac60f11b48b5a9d)
|
88
|
+
# and [Face -
|
89
|
+
# Identify](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395239).
|
90
|
+
# <br /> Please consider
|
91
|
+
# [LargeFaceList](/docs/services/563879b61984550e40cbbe8d/operations/5a157b68d2de3616c086f2cc)
|
92
|
+
# when the face number is large. It can support up to 1,000,000 faces.
|
93
|
+
# 'recognitionModel' should be specified to associate with this face list. The
|
94
|
+
# default value for 'recognitionModel' is 'recognition_01', if the latest model
|
95
|
+
# needed, please explicitly specify the model you need in this parameter. New
|
96
|
+
# faces that are added to an existing face list will use the recognition model
|
97
|
+
# that's already associated with the collection. Existing face features in a
|
98
|
+
# face list can't be updated to features extracted by another version of
|
99
|
+
# recognition model.
|
100
|
+
#
|
43
101
|
#
|
44
102
|
# @param face_list_id [String] Id referencing a particular face list.
|
45
103
|
# @param name [String] User defined name, maximum length is 128.
|
46
104
|
# @param user_data [String] User specified data. Length should not exceed 16KB.
|
105
|
+
# @param recognition_model [RecognitionModel] Possible values include:
|
106
|
+
# 'recognition_01', 'recognition_02'
|
47
107
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
48
108
|
# will be added to the HTTP request.
|
49
109
|
#
|
50
110
|
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
51
111
|
#
|
52
|
-
def create_with_http_info(face_list_id, name:nil, user_data:nil, custom_headers:nil)
|
53
|
-
create_async(face_list_id, name:name, user_data:user_data, custom_headers:custom_headers).value!
|
112
|
+
def create_with_http_info(face_list_id, name:nil, user_data:nil, recognition_model:nil, custom_headers:nil)
|
113
|
+
create_async(face_list_id, name:name, user_data:user_data, recognition_model:recognition_model, custom_headers:custom_headers).value!
|
54
114
|
end
|
55
115
|
|
56
116
|
#
|
57
|
-
# Create an empty face list
|
117
|
+
# Create an empty face list with user-specified faceListId, name, an optional
|
118
|
+
# userData and recognitionModel. Up to 64 face lists are allowed in one
|
58
119
|
# subscription.
|
120
|
+
# <br /> Face list is a list of faces, up to 1,000 faces, and used by [Face -
|
121
|
+
# Find
|
122
|
+
# Similar](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395237).
|
123
|
+
# <br /> After creation, user should use [FaceList - Add
|
124
|
+
# Face](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395250)
|
125
|
+
# to import the faces. Faces are stored on server until [FaceList -
|
126
|
+
# Delete](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039524f)
|
127
|
+
# is called.
|
128
|
+
# <br /> Find Similar is used for scenario like finding celebrity-like faces,
|
129
|
+
# similar face filtering, or as a light way face identification. But if the
|
130
|
+
# actual use is to identify person, please use
|
131
|
+
# [PersonGroup](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395244)
|
132
|
+
# /
|
133
|
+
# [LargePersonGroup](/docs/services/563879b61984550e40cbbe8d/operations/599acdee6ac60f11b48b5a9d)
|
134
|
+
# and [Face -
|
135
|
+
# Identify](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395239).
|
136
|
+
# <br /> Please consider
|
137
|
+
# [LargeFaceList](/docs/services/563879b61984550e40cbbe8d/operations/5a157b68d2de3616c086f2cc)
|
138
|
+
# when the face number is large. It can support up to 1,000,000 faces.
|
139
|
+
# 'recognitionModel' should be specified to associate with this face list. The
|
140
|
+
# default value for 'recognitionModel' is 'recognition_01', if the latest model
|
141
|
+
# needed, please explicitly specify the model you need in this parameter. New
|
142
|
+
# faces that are added to an existing face list will use the recognition model
|
143
|
+
# that's already associated with the collection. Existing face features in a
|
144
|
+
# face list can't be updated to features extracted by another version of
|
145
|
+
# recognition model.
|
146
|
+
#
|
59
147
|
#
|
60
148
|
# @param face_list_id [String] Id referencing a particular face list.
|
61
149
|
# @param name [String] User defined name, maximum length is 128.
|
62
150
|
# @param user_data [String] User specified data. Length should not exceed 16KB.
|
151
|
+
# @param recognition_model [RecognitionModel] Possible values include:
|
152
|
+
# 'recognition_01', 'recognition_02'
|
63
153
|
# @param [Hash{String => String}] A hash of custom headers that will be added
|
64
154
|
# to the HTTP request.
|
65
155
|
#
|
66
156
|
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
67
157
|
#
|
68
|
-
def create_async(face_list_id, name:nil, user_data:nil, custom_headers:nil)
|
158
|
+
def create_async(face_list_id, name:nil, user_data:nil, recognition_model:nil, custom_headers:nil)
|
159
|
+
fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
|
69
160
|
fail ArgumentError, 'face_list_id is nil' if face_list_id.nil?
|
70
161
|
fail ArgumentError, "'face_list_id' should satisfy the constraint - 'MaxLength': '64'" if !face_list_id.nil? && face_list_id.length > 64
|
71
162
|
fail ArgumentError, "'face_list_id' should satisfy the constraint - 'Pattern': '^[a-z0-9-_]+$'" if !face_list_id.nil? && face_list_id.match(Regexp.new('^^[a-z0-9-_]+$$')).nil?
|
72
163
|
fail ArgumentError, "'name' should satisfy the constraint - 'MaxLength': '128'" if !name.nil? && name.length > 128
|
73
164
|
fail ArgumentError, "'user_data' should satisfy the constraint - 'MaxLength': '16384'" if !user_data.nil? && user_data.length > 16384
|
74
165
|
|
75
|
-
body =
|
76
|
-
unless name.nil? && user_data.nil?
|
166
|
+
body = MetaDataContract.new
|
167
|
+
unless name.nil? && user_data.nil? && recognition_model.nil?
|
77
168
|
body.name = name
|
78
169
|
body.user_data = user_data
|
170
|
+
body.recognition_model = recognition_model
|
79
171
|
end
|
80
172
|
|
81
173
|
request_headers = {}
|
@@ -86,13 +178,14 @@ module Azure::CognitiveServices::Face::V1_0
|
|
86
178
|
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
87
179
|
|
88
180
|
# Serialize Request
|
89
|
-
request_mapper = Azure::CognitiveServices::Face::V1_0::Models::
|
181
|
+
request_mapper = Azure::CognitiveServices::Face::V1_0::Models::MetaDataContract.mapper()
|
90
182
|
request_content = @client.serialize(request_mapper, body)
|
91
183
|
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
92
184
|
|
93
185
|
path_template = 'facelists/{faceListId}'
|
94
186
|
|
95
187
|
request_url = @base_url || @client.base_url
|
188
|
+
request_url = request_url.gsub('{Endpoint}', @client.endpoint)
|
96
189
|
|
97
190
|
options = {
|
98
191
|
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
@@ -121,42 +214,55 @@ module Azure::CognitiveServices::Face::V1_0
|
|
121
214
|
end
|
122
215
|
|
123
216
|
#
|
124
|
-
# Retrieve a face list
|
217
|
+
# Retrieve a face list’s faceListId, name, userData, recognitionModel and faces
|
218
|
+
# in the face list.
|
219
|
+
#
|
125
220
|
#
|
126
221
|
# @param face_list_id [String] Id referencing a particular face list.
|
222
|
+
# @param return_recognition_model [Boolean] A value indicating whether the
|
223
|
+
# operation should return 'recognitionModel' in response.
|
127
224
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
128
225
|
# will be added to the HTTP request.
|
129
226
|
#
|
130
227
|
# @return [FaceList] operation results.
|
131
228
|
#
|
132
|
-
def get(face_list_id, custom_headers:nil)
|
133
|
-
response = get_async(face_list_id, custom_headers:custom_headers).value!
|
229
|
+
def get(face_list_id, return_recognition_model:false, custom_headers:nil)
|
230
|
+
response = get_async(face_list_id, return_recognition_model:return_recognition_model, custom_headers:custom_headers).value!
|
134
231
|
response.body unless response.nil?
|
135
232
|
end
|
136
233
|
|
137
234
|
#
|
138
|
-
# Retrieve a face list
|
235
|
+
# Retrieve a face list’s faceListId, name, userData, recognitionModel and faces
|
236
|
+
# in the face list.
|
237
|
+
#
|
139
238
|
#
|
140
239
|
# @param face_list_id [String] Id referencing a particular face list.
|
240
|
+
# @param return_recognition_model [Boolean] A value indicating whether the
|
241
|
+
# operation should return 'recognitionModel' in response.
|
141
242
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
142
243
|
# will be added to the HTTP request.
|
143
244
|
#
|
144
245
|
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
145
246
|
#
|
146
|
-
def get_with_http_info(face_list_id, custom_headers:nil)
|
147
|
-
get_async(face_list_id, custom_headers:custom_headers).value!
|
247
|
+
def get_with_http_info(face_list_id, return_recognition_model:false, custom_headers:nil)
|
248
|
+
get_async(face_list_id, return_recognition_model:return_recognition_model, custom_headers:custom_headers).value!
|
148
249
|
end
|
149
250
|
|
150
251
|
#
|
151
|
-
# Retrieve a face list
|
252
|
+
# Retrieve a face list’s faceListId, name, userData, recognitionModel and faces
|
253
|
+
# in the face list.
|
254
|
+
#
|
152
255
|
#
|
153
256
|
# @param face_list_id [String] Id referencing a particular face list.
|
257
|
+
# @param return_recognition_model [Boolean] A value indicating whether the
|
258
|
+
# operation should return 'recognitionModel' in response.
|
154
259
|
# @param [Hash{String => String}] A hash of custom headers that will be added
|
155
260
|
# to the HTTP request.
|
156
261
|
#
|
157
262
|
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
158
263
|
#
|
159
|
-
def get_async(face_list_id, custom_headers:nil)
|
264
|
+
def get_async(face_list_id, return_recognition_model:false, custom_headers:nil)
|
265
|
+
fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
|
160
266
|
fail ArgumentError, 'face_list_id is nil' if face_list_id.nil?
|
161
267
|
fail ArgumentError, "'face_list_id' should satisfy the constraint - 'MaxLength': '64'" if !face_list_id.nil? && face_list_id.length > 64
|
162
268
|
fail ArgumentError, "'face_list_id' should satisfy the constraint - 'Pattern': '^[a-z0-9-_]+$'" if !face_list_id.nil? && face_list_id.match(Regexp.new('^^[a-z0-9-_]+$$')).nil?
|
@@ -171,10 +277,12 @@ module Azure::CognitiveServices::Face::V1_0
|
|
171
277
|
path_template = 'facelists/{faceListId}'
|
172
278
|
|
173
279
|
request_url = @base_url || @client.base_url
|
280
|
+
request_url = request_url.gsub('{Endpoint}', @client.endpoint)
|
174
281
|
|
175
282
|
options = {
|
176
283
|
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
177
284
|
path_params: {'faceListId' => face_list_id},
|
285
|
+
query_params: {'returnRecognitionModel' => return_recognition_model},
|
178
286
|
headers: request_headers.merge(custom_headers || {}),
|
179
287
|
base_url: request_url
|
180
288
|
}
|
@@ -249,6 +357,7 @@ module Azure::CognitiveServices::Face::V1_0
|
|
249
357
|
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
250
358
|
#
|
251
359
|
def update_async(face_list_id, name:nil, user_data:nil, custom_headers:nil)
|
360
|
+
fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
|
252
361
|
fail ArgumentError, 'face_list_id is nil' if face_list_id.nil?
|
253
362
|
fail ArgumentError, "'face_list_id' should satisfy the constraint - 'MaxLength': '64'" if !face_list_id.nil? && face_list_id.length > 64
|
254
363
|
fail ArgumentError, "'face_list_id' should satisfy the constraint - 'Pattern': '^[a-z0-9-_]+$'" if !face_list_id.nil? && face_list_id.match(Regexp.new('^^[a-z0-9-_]+$$')).nil?
|
@@ -276,6 +385,7 @@ module Azure::CognitiveServices::Face::V1_0
|
|
276
385
|
path_template = 'facelists/{faceListId}'
|
277
386
|
|
278
387
|
request_url = @base_url || @client.base_url
|
388
|
+
request_url = request_url.gsub('{Endpoint}', @client.endpoint)
|
279
389
|
|
280
390
|
options = {
|
281
391
|
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
@@ -342,6 +452,7 @@ module Azure::CognitiveServices::Face::V1_0
|
|
342
452
|
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
343
453
|
#
|
344
454
|
def delete_async(face_list_id, custom_headers:nil)
|
455
|
+
fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
|
345
456
|
fail ArgumentError, 'face_list_id is nil' if face_list_id.nil?
|
346
457
|
fail ArgumentError, "'face_list_id' should satisfy the constraint - 'MaxLength': '64'" if !face_list_id.nil? && face_list_id.length > 64
|
347
458
|
fail ArgumentError, "'face_list_id' should satisfy the constraint - 'Pattern': '^[a-z0-9-_]+$'" if !face_list_id.nil? && face_list_id.match(Regexp.new('^^[a-z0-9-_]+$$')).nil?
|
@@ -356,6 +467,7 @@ module Azure::CognitiveServices::Face::V1_0
|
|
356
467
|
path_template = 'facelists/{faceListId}'
|
357
468
|
|
358
469
|
request_url = @base_url || @client.base_url
|
470
|
+
request_url = request_url.gsub('{Endpoint}', @client.endpoint)
|
359
471
|
|
360
472
|
options = {
|
361
473
|
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
@@ -383,42 +495,55 @@ module Azure::CognitiveServices::Face::V1_0
|
|
383
495
|
end
|
384
496
|
|
385
497
|
#
|
386
|
-
#
|
387
|
-
#
|
498
|
+
# List face lists’ faceListId, name, userData and recognitionModel. <br />
|
499
|
+
# To get face information inside faceList use [FaceList -
|
500
|
+
# Get](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039524c)
|
388
501
|
#
|
502
|
+
#
|
503
|
+
# @param return_recognition_model [Boolean] A value indicating whether the
|
504
|
+
# operation should return 'recognitionModel' in response.
|
389
505
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
390
506
|
# will be added to the HTTP request.
|
391
507
|
#
|
392
508
|
# @return [Array] operation results.
|
393
509
|
#
|
394
|
-
def list(custom_headers:nil)
|
395
|
-
response = list_async(custom_headers:custom_headers).value!
|
510
|
+
def list(return_recognition_model:false, custom_headers:nil)
|
511
|
+
response = list_async(return_recognition_model:return_recognition_model, custom_headers:custom_headers).value!
|
396
512
|
response.body unless response.nil?
|
397
513
|
end
|
398
514
|
|
399
515
|
#
|
400
|
-
#
|
401
|
-
#
|
516
|
+
# List face lists’ faceListId, name, userData and recognitionModel. <br />
|
517
|
+
# To get face information inside faceList use [FaceList -
|
518
|
+
# Get](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039524c)
|
519
|
+
#
|
402
520
|
#
|
521
|
+
# @param return_recognition_model [Boolean] A value indicating whether the
|
522
|
+
# operation should return 'recognitionModel' in response.
|
403
523
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
404
524
|
# will be added to the HTTP request.
|
405
525
|
#
|
406
526
|
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
407
527
|
#
|
408
|
-
def list_with_http_info(custom_headers:nil)
|
409
|
-
list_async(custom_headers:custom_headers).value!
|
528
|
+
def list_with_http_info(return_recognition_model:false, custom_headers:nil)
|
529
|
+
list_async(return_recognition_model:return_recognition_model, custom_headers:custom_headers).value!
|
410
530
|
end
|
411
531
|
|
412
532
|
#
|
413
|
-
#
|
414
|
-
#
|
533
|
+
# List face lists’ faceListId, name, userData and recognitionModel. <br />
|
534
|
+
# To get face information inside faceList use [FaceList -
|
535
|
+
# Get](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039524c)
|
536
|
+
#
|
415
537
|
#
|
538
|
+
# @param return_recognition_model [Boolean] A value indicating whether the
|
539
|
+
# operation should return 'recognitionModel' in response.
|
416
540
|
# @param [Hash{String => String}] A hash of custom headers that will be added
|
417
541
|
# to the HTTP request.
|
418
542
|
#
|
419
543
|
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
420
544
|
#
|
421
|
-
def list_async(custom_headers:nil)
|
545
|
+
def list_async(return_recognition_model:false, custom_headers:nil)
|
546
|
+
fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
|
422
547
|
|
423
548
|
|
424
549
|
request_headers = {}
|
@@ -430,9 +555,11 @@ module Azure::CognitiveServices::Face::V1_0
|
|
430
555
|
path_template = 'facelists'
|
431
556
|
|
432
557
|
request_url = @base_url || @client.base_url
|
558
|
+
request_url = request_url.gsub('{Endpoint}', @client.endpoint)
|
433
559
|
|
434
560
|
options = {
|
435
561
|
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
562
|
+
query_params: {'returnRecognitionModel' => return_recognition_model},
|
436
563
|
headers: request_headers.merge(custom_headers || {}),
|
437
564
|
base_url: request_url
|
438
565
|
}
|
@@ -482,7 +609,7 @@ module Azure::CognitiveServices::Face::V1_0
|
|
482
609
|
end
|
483
610
|
|
484
611
|
#
|
485
|
-
# Delete an existing face from a face list (given by a
|
612
|
+
# Delete an existing face from a face list (given by a persistedFaceId and a
|
486
613
|
# faceListId). Persisted image related to the face will also be deleted.
|
487
614
|
#
|
488
615
|
# @param face_list_id [String] Id referencing a particular face list.
|
@@ -498,7 +625,7 @@ module Azure::CognitiveServices::Face::V1_0
|
|
498
625
|
end
|
499
626
|
|
500
627
|
#
|
501
|
-
# Delete an existing face from a face list (given by a
|
628
|
+
# Delete an existing face from a face list (given by a persistedFaceId and a
|
502
629
|
# faceListId). Persisted image related to the face will also be deleted.
|
503
630
|
#
|
504
631
|
# @param face_list_id [String] Id referencing a particular face list.
|
@@ -514,7 +641,7 @@ module Azure::CognitiveServices::Face::V1_0
|
|
514
641
|
end
|
515
642
|
|
516
643
|
#
|
517
|
-
# Delete an existing face from a face list (given by a
|
644
|
+
# Delete an existing face from a face list (given by a persistedFaceId and a
|
518
645
|
# faceListId). Persisted image related to the face will also be deleted.
|
519
646
|
#
|
520
647
|
# @param face_list_id [String] Id referencing a particular face list.
|
@@ -526,6 +653,7 @@ module Azure::CognitiveServices::Face::V1_0
|
|
526
653
|
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
527
654
|
#
|
528
655
|
def delete_face_async(face_list_id, persisted_face_id, custom_headers:nil)
|
656
|
+
fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
|
529
657
|
fail ArgumentError, 'face_list_id is nil' if face_list_id.nil?
|
530
658
|
fail ArgumentError, "'face_list_id' should satisfy the constraint - 'MaxLength': '64'" if !face_list_id.nil? && face_list_id.length > 64
|
531
659
|
fail ArgumentError, "'face_list_id' should satisfy the constraint - 'Pattern': '^[a-z0-9-_]+$'" if !face_list_id.nil? && face_list_id.match(Regexp.new('^^[a-z0-9-_]+$$')).nil?
|
@@ -538,9 +666,10 @@ module Azure::CognitiveServices::Face::V1_0
|
|
538
666
|
# Set Headers
|
539
667
|
request_headers['x-ms-client-request-id'] = SecureRandom.uuid
|
540
668
|
request_headers['accept-language'] = @client.accept_language unless @client.accept_language.nil?
|
541
|
-
path_template = 'facelists/{faceListId}/
|
669
|
+
path_template = 'facelists/{faceListId}/persistedfaces/{persistedFaceId}'
|
542
670
|
|
543
671
|
request_url = @base_url || @client.base_url
|
672
|
+
request_url = request_url.gsub('{Endpoint}', @client.endpoint)
|
544
673
|
|
545
674
|
options = {
|
546
675
|
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
@@ -637,6 +766,7 @@ module Azure::CognitiveServices::Face::V1_0
|
|
637
766
|
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
638
767
|
#
|
639
768
|
def add_face_from_url_async(face_list_id, url, user_data:nil, target_face:nil, custom_headers:nil)
|
769
|
+
fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
|
640
770
|
fail ArgumentError, 'face_list_id is nil' if face_list_id.nil?
|
641
771
|
fail ArgumentError, "'face_list_id' should satisfy the constraint - 'MaxLength': '64'" if !face_list_id.nil? && face_list_id.length > 64
|
642
772
|
fail ArgumentError, "'face_list_id' should satisfy the constraint - 'Pattern': '^[a-z0-9-_]+$'" if !face_list_id.nil? && face_list_id.match(Regexp.new('^^[a-z0-9-_]+$$')).nil?
|
@@ -660,9 +790,10 @@ module Azure::CognitiveServices::Face::V1_0
|
|
660
790
|
request_content = @client.serialize(request_mapper, image_url)
|
661
791
|
request_content = request_content != nil ? JSON.generate(request_content, quirks_mode: true) : nil
|
662
792
|
|
663
|
-
path_template = 'facelists/{faceListId}/
|
793
|
+
path_template = 'facelists/{faceListId}/persistedfaces'
|
664
794
|
|
665
795
|
request_url = @base_url || @client.base_url
|
796
|
+
request_url = request_url.gsub('{Endpoint}', @client.endpoint)
|
666
797
|
|
667
798
|
options = {
|
668
799
|
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
@@ -771,6 +902,7 @@ module Azure::CognitiveServices::Face::V1_0
|
|
771
902
|
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
772
903
|
#
|
773
904
|
def add_face_from_stream_async(face_list_id, image, user_data:nil, target_face:nil, custom_headers:nil)
|
905
|
+
fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
|
774
906
|
fail ArgumentError, 'face_list_id is nil' if face_list_id.nil?
|
775
907
|
fail ArgumentError, "'face_list_id' should satisfy the constraint - 'MaxLength': '64'" if !face_list_id.nil? && face_list_id.length > 64
|
776
908
|
fail ArgumentError, "'face_list_id' should satisfy the constraint - 'Pattern': '^[a-z0-9-_]+$'" if !face_list_id.nil? && face_list_id.match(Regexp.new('^^[a-z0-9-_]+$$')).nil?
|
@@ -796,9 +928,10 @@ module Azure::CognitiveServices::Face::V1_0
|
|
796
928
|
}
|
797
929
|
request_content = @client.serialize(request_mapper, image)
|
798
930
|
|
799
|
-
path_template = 'facelists/{faceListId}/
|
931
|
+
path_template = 'facelists/{faceListId}/persistedfaces'
|
800
932
|
|
801
933
|
request_url = @base_url || @client.base_url
|
934
|
+
request_url = request_url.gsub('{Endpoint}', @client.endpoint)
|
802
935
|
|
803
936
|
options = {
|
804
937
|
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|