azure_cognitiveservices_face 0.18.0 → 0.19.0

Sign up to get free protection for your applications and to get access to all the features.
@@ -25,7 +25,7 @@ module Azure::CognitiveServices::Face::V1_0
25
25
  # Create a new large person group with user-specified largePersonGroupId, name,
26
26
  # an optional userData and recognitionModel.
27
27
  # <br /> A large person group is the container of the uploaded person data,
28
- # including face images and face recognition feature, and up to 1,000,000
28
+ # including face recognition feature, and up to 1,000,000
29
29
  # people.
30
30
  # <br /> After creation, use [LargePersonGroup Person -
31
31
  # Create](/docs/services/563879b61984550e40cbbe8d/operations/599adcba3a7b9412a4d53f40)
@@ -33,24 +33,30 @@ module Azure::CognitiveServices::Face::V1_0
33
33
  # Train](/docs/services/563879b61984550e40cbbe8d/operations/599ae2d16ac60f11b48b5aa4)
34
34
  # to get this group ready for [Face -
35
35
  # Identify](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395239).
36
- # <br /> The person face, image, and userData will be stored on server until
37
- # [LargePersonGroup Person -
36
+ # <br /> No image will be stored. Only the person's extracted face features and
37
+ # userData will be stored on server until [LargePersonGroup Person -
38
38
  # Delete](/docs/services/563879b61984550e40cbbe8d/operations/599ade5c6ac60f11b48b5aa2)
39
39
  # or [LargePersonGroup -
40
40
  # Delete](/docs/services/563879b61984550e40cbbe8d/operations/599adc216ac60f11b48b5a9f)
41
41
  # is called.
42
- # <br />
43
- # * Free-tier subscription quota: 1,000 large person groups.
44
- # * S0-tier subscription quota: 1,000,000 large person groups.
45
- # <br />
46
- # 'recognitionModel' should be specified to associate with this large person
47
- # group. The default value for 'recognitionModel' is 'recognition_01', if the
48
- # latest model needed, please explicitly specify the model you need in this
49
- # parameter. New faces that are added to an existing large person group will
50
- # use the recognition model that's already associated with the collection.
42
+ # <br/>'recognitionModel' should be specified to associate with this large
43
+ # person group. The default value for 'recognitionModel' is 'recognition_01',
44
+ # if the latest model needed, please explicitly specify the model you need in
45
+ # this parameter. New faces that are added to an existing large person group
46
+ # will use the recognition model that's already associated with the collection.
51
47
  # Existing face features in a large person group can't be updated to features
52
48
  # extracted by another version of recognition model.
53
- #
49
+ # * 'recognition_01': The default recognition model for [LargePersonGroup -
50
+ # Create](/docs/services/563879b61984550e40cbbe8d/operations/599acdee6ac60f11b48b5a9d).
51
+ # All those large person groups created before 2019 March are bonded with this
52
+ # recognition model.
53
+ # * 'recognition_02': Recognition model released in 2019 March.
54
+ # 'recognition_02' is recommended since its overall accuracy is improved
55
+ # compared with 'recognition_01'.
56
+ #
57
+ # Large person group quota:
58
+ # * Free-tier subscription quota: 1,000 large person groups.
59
+ # * S0-tier subscription quota: 1,000,000 large person groups.
54
60
  #
55
61
  # @param large_person_group_id [String] Id referencing a particular large
56
62
  # person group.
@@ -71,7 +77,7 @@ module Azure::CognitiveServices::Face::V1_0
71
77
  # Create a new large person group with user-specified largePersonGroupId, name,
72
78
  # an optional userData and recognitionModel.
73
79
  # <br /> A large person group is the container of the uploaded person data,
74
- # including face images and face recognition feature, and up to 1,000,000
80
+ # including face recognition feature, and up to 1,000,000
75
81
  # people.
76
82
  # <br /> After creation, use [LargePersonGroup Person -
77
83
  # Create](/docs/services/563879b61984550e40cbbe8d/operations/599adcba3a7b9412a4d53f40)
@@ -79,24 +85,30 @@ module Azure::CognitiveServices::Face::V1_0
79
85
  # Train](/docs/services/563879b61984550e40cbbe8d/operations/599ae2d16ac60f11b48b5aa4)
80
86
  # to get this group ready for [Face -
81
87
  # Identify](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395239).
82
- # <br /> The person face, image, and userData will be stored on server until
83
- # [LargePersonGroup Person -
88
+ # <br /> No image will be stored. Only the person's extracted face features and
89
+ # userData will be stored on server until [LargePersonGroup Person -
84
90
  # Delete](/docs/services/563879b61984550e40cbbe8d/operations/599ade5c6ac60f11b48b5aa2)
85
91
  # or [LargePersonGroup -
86
92
  # Delete](/docs/services/563879b61984550e40cbbe8d/operations/599adc216ac60f11b48b5a9f)
87
93
  # is called.
88
- # <br />
89
- # * Free-tier subscription quota: 1,000 large person groups.
90
- # * S0-tier subscription quota: 1,000,000 large person groups.
91
- # <br />
92
- # 'recognitionModel' should be specified to associate with this large person
93
- # group. The default value for 'recognitionModel' is 'recognition_01', if the
94
- # latest model needed, please explicitly specify the model you need in this
95
- # parameter. New faces that are added to an existing large person group will
96
- # use the recognition model that's already associated with the collection.
94
+ # <br/>'recognitionModel' should be specified to associate with this large
95
+ # person group. The default value for 'recognitionModel' is 'recognition_01',
96
+ # if the latest model needed, please explicitly specify the model you need in
97
+ # this parameter. New faces that are added to an existing large person group
98
+ # will use the recognition model that's already associated with the collection.
97
99
  # Existing face features in a large person group can't be updated to features
98
100
  # extracted by another version of recognition model.
99
- #
101
+ # * 'recognition_01': The default recognition model for [LargePersonGroup -
102
+ # Create](/docs/services/563879b61984550e40cbbe8d/operations/599acdee6ac60f11b48b5a9d).
103
+ # All those large person groups created before 2019 March are bonded with this
104
+ # recognition model.
105
+ # * 'recognition_02': Recognition model released in 2019 March.
106
+ # 'recognition_02' is recommended since its overall accuracy is improved
107
+ # compared with 'recognition_01'.
108
+ #
109
+ # Large person group quota:
110
+ # * Free-tier subscription quota: 1,000 large person groups.
111
+ # * S0-tier subscription quota: 1,000,000 large person groups.
100
112
  #
101
113
  # @param large_person_group_id [String] Id referencing a particular large
102
114
  # person group.
@@ -117,7 +129,7 @@ module Azure::CognitiveServices::Face::V1_0
117
129
  # Create a new large person group with user-specified largePersonGroupId, name,
118
130
  # an optional userData and recognitionModel.
119
131
  # <br /> A large person group is the container of the uploaded person data,
120
- # including face images and face recognition feature, and up to 1,000,000
132
+ # including face recognition feature, and up to 1,000,000
121
133
  # people.
122
134
  # <br /> After creation, use [LargePersonGroup Person -
123
135
  # Create](/docs/services/563879b61984550e40cbbe8d/operations/599adcba3a7b9412a4d53f40)
@@ -125,24 +137,30 @@ module Azure::CognitiveServices::Face::V1_0
125
137
  # Train](/docs/services/563879b61984550e40cbbe8d/operations/599ae2d16ac60f11b48b5aa4)
126
138
  # to get this group ready for [Face -
127
139
  # Identify](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395239).
128
- # <br /> The person face, image, and userData will be stored on server until
129
- # [LargePersonGroup Person -
140
+ # <br /> No image will be stored. Only the person's extracted face features and
141
+ # userData will be stored on server until [LargePersonGroup Person -
130
142
  # Delete](/docs/services/563879b61984550e40cbbe8d/operations/599ade5c6ac60f11b48b5aa2)
131
143
  # or [LargePersonGroup -
132
144
  # Delete](/docs/services/563879b61984550e40cbbe8d/operations/599adc216ac60f11b48b5a9f)
133
145
  # is called.
134
- # <br />
135
- # * Free-tier subscription quota: 1,000 large person groups.
136
- # * S0-tier subscription quota: 1,000,000 large person groups.
137
- # <br />
138
- # 'recognitionModel' should be specified to associate with this large person
139
- # group. The default value for 'recognitionModel' is 'recognition_01', if the
140
- # latest model needed, please explicitly specify the model you need in this
141
- # parameter. New faces that are added to an existing large person group will
142
- # use the recognition model that's already associated with the collection.
146
+ # <br/>'recognitionModel' should be specified to associate with this large
147
+ # person group. The default value for 'recognitionModel' is 'recognition_01',
148
+ # if the latest model needed, please explicitly specify the model you need in
149
+ # this parameter. New faces that are added to an existing large person group
150
+ # will use the recognition model that's already associated with the collection.
143
151
  # Existing face features in a large person group can't be updated to features
144
152
  # extracted by another version of recognition model.
145
- #
153
+ # * 'recognition_01': The default recognition model for [LargePersonGroup -
154
+ # Create](/docs/services/563879b61984550e40cbbe8d/operations/599acdee6ac60f11b48b5a9d).
155
+ # All those large person groups created before 2019 March are bonded with this
156
+ # recognition model.
157
+ # * 'recognition_02': Recognition model released in 2019 March.
158
+ # 'recognition_02' is recommended since its overall accuracy is improved
159
+ # compared with 'recognition_01'.
160
+ #
161
+ # Large person group quota:
162
+ # * Free-tier subscription quota: 1,000 large person groups.
163
+ # * S0-tier subscription quota: 1,000,000 large person groups.
146
164
  #
147
165
  # @param large_person_group_id [String] Id referencing a particular large
148
166
  # person group.
@@ -206,6 +224,8 @@ module Azure::CognitiveServices::Face::V1_0
206
224
  end
207
225
 
208
226
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
227
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
228
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
209
229
 
210
230
  result
211
231
  end
@@ -290,6 +310,8 @@ module Azure::CognitiveServices::Face::V1_0
290
310
  end
291
311
 
292
312
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
313
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
314
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
293
315
 
294
316
  result
295
317
  end
@@ -394,6 +416,8 @@ module Azure::CognitiveServices::Face::V1_0
394
416
  end
395
417
 
396
418
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
419
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
420
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
397
421
  # Deserialize Response
398
422
  if status_code == 200
399
423
  begin
@@ -508,6 +532,8 @@ module Azure::CognitiveServices::Face::V1_0
508
532
  end
509
533
 
510
534
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
535
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
536
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
511
537
 
512
538
  result
513
539
  end
@@ -590,6 +616,8 @@ module Azure::CognitiveServices::Face::V1_0
590
616
  end
591
617
 
592
618
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
619
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
620
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
593
621
  # Deserialize Response
594
622
  if status_code == 200
595
623
  begin
@@ -733,6 +761,8 @@ module Azure::CognitiveServices::Face::V1_0
733
761
  end
734
762
 
735
763
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
764
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
765
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
736
766
  # Deserialize Response
737
767
  if status_code == 200
738
768
  begin
@@ -843,6 +873,8 @@ module Azure::CognitiveServices::Face::V1_0
843
873
  end
844
874
 
845
875
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
876
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
877
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
846
878
 
847
879
  result
848
880
  end
@@ -116,6 +116,8 @@ module Azure::CognitiveServices::Face::V1_0
116
116
  end
117
117
 
118
118
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
119
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
120
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
119
121
  # Deserialize Response
120
122
  if status_code == 200
121
123
  begin
@@ -229,6 +231,8 @@ module Azure::CognitiveServices::Face::V1_0
229
231
  end
230
232
 
231
233
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
234
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
235
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
232
236
  # Deserialize Response
233
237
  if status_code == 200
234
238
  begin
@@ -263,8 +267,9 @@ module Azure::CognitiveServices::Face::V1_0
263
267
  end
264
268
 
265
269
  #
266
- # Delete an existing person from a large person group. All stored person data,
267
- # and face features in the person entry will be deleted.
270
+ # Delete an existing person from a large person group. The persistedFaceId,
271
+ # userData, person name and face feature in the person entry will all be
272
+ # deleted.
268
273
  #
269
274
  # @param large_person_group_id [String] Id referencing a particular large
270
275
  # person group.
@@ -279,8 +284,9 @@ module Azure::CognitiveServices::Face::V1_0
279
284
  end
280
285
 
281
286
  #
282
- # Delete an existing person from a large person group. All stored person data,
283
- # and face features in the person entry will be deleted.
287
+ # Delete an existing person from a large person group. The persistedFaceId,
288
+ # userData, person name and face feature in the person entry will all be
289
+ # deleted.
284
290
  #
285
291
  # @param large_person_group_id [String] Id referencing a particular large
286
292
  # person group.
@@ -295,8 +301,9 @@ module Azure::CognitiveServices::Face::V1_0
295
301
  end
296
302
 
297
303
  #
298
- # Delete an existing person from a large person group. All stored person data,
299
- # and face features in the person entry will be deleted.
304
+ # Delete an existing person from a large person group. The persistedFaceId,
305
+ # userData, person name and face feature in the person entry will all be
306
+ # deleted.
300
307
  #
301
308
  # @param large_person_group_id [String] Id referencing a particular large
302
309
  # person group.
@@ -343,6 +350,8 @@ module Azure::CognitiveServices::Face::V1_0
343
350
  end
344
351
 
345
352
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
353
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
354
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
346
355
 
347
356
  result
348
357
  end
@@ -351,8 +360,8 @@ module Azure::CognitiveServices::Face::V1_0
351
360
  end
352
361
 
353
362
  #
354
- # Retrieve a person's information, including registered persisted faces, name
355
- # and userData.
363
+ # Retrieve a person's name and userData, and the persisted faceIds representing
364
+ # the registered person face feature.
356
365
  #
357
366
  # @param large_person_group_id [String] Id referencing a particular large
358
367
  # person group.
@@ -368,8 +377,8 @@ module Azure::CognitiveServices::Face::V1_0
368
377
  end
369
378
 
370
379
  #
371
- # Retrieve a person's information, including registered persisted faces, name
372
- # and userData.
380
+ # Retrieve a person's name and userData, and the persisted faceIds representing
381
+ # the registered person face feature.
373
382
  #
374
383
  # @param large_person_group_id [String] Id referencing a particular large
375
384
  # person group.
@@ -384,8 +393,8 @@ module Azure::CognitiveServices::Face::V1_0
384
393
  end
385
394
 
386
395
  #
387
- # Retrieve a person's information, including registered persisted faces, name
388
- # and userData.
396
+ # Retrieve a person's name and userData, and the persisted faceIds representing
397
+ # the registered person face feature.
389
398
  #
390
399
  # @param large_person_group_id [String] Id referencing a particular large
391
400
  # person group.
@@ -432,6 +441,8 @@ module Azure::CognitiveServices::Face::V1_0
432
441
  end
433
442
 
434
443
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
444
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
445
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
435
446
  # Deserialize Response
436
447
  if status_code == 200
437
448
  begin
@@ -547,6 +558,8 @@ module Azure::CognitiveServices::Face::V1_0
547
558
  end
548
559
 
549
560
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
561
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
562
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
550
563
 
551
564
  result
552
565
  end
@@ -555,8 +568,11 @@ module Azure::CognitiveServices::Face::V1_0
555
568
  end
556
569
 
557
570
  #
558
- # Delete a face from a person. Relative feature for the persisted face will
559
- # also be deleted.
571
+ # Delete a face from a person in a large person group by specified
572
+ # largePersonGroupId, personId and persistedFaceId.
573
+ # <br /> Adding/deleting faces to/from a same person will be processed
574
+ # sequentially. Adding/deleting faces to/from different persons are processed
575
+ # in parallel.
560
576
  #
561
577
  # @param large_person_group_id [String] Id referencing a particular large
562
578
  # person group.
@@ -573,8 +589,11 @@ module Azure::CognitiveServices::Face::V1_0
573
589
  end
574
590
 
575
591
  #
576
- # Delete a face from a person. Relative feature for the persisted face will
577
- # also be deleted.
592
+ # Delete a face from a person in a large person group by specified
593
+ # largePersonGroupId, personId and persistedFaceId.
594
+ # <br /> Adding/deleting faces to/from a same person will be processed
595
+ # sequentially. Adding/deleting faces to/from different persons are processed
596
+ # in parallel.
578
597
  #
579
598
  # @param large_person_group_id [String] Id referencing a particular large
580
599
  # person group.
@@ -591,8 +610,11 @@ module Azure::CognitiveServices::Face::V1_0
591
610
  end
592
611
 
593
612
  #
594
- # Delete a face from a person. Relative feature for the persisted face will
595
- # also be deleted.
613
+ # Delete a face from a person in a large person group by specified
614
+ # largePersonGroupId, personId and persistedFaceId.
615
+ # <br /> Adding/deleting faces to/from a same person will be processed
616
+ # sequentially. Adding/deleting faces to/from different persons are processed
617
+ # in parallel.
596
618
  #
597
619
  # @param large_person_group_id [String] Id referencing a particular large
598
620
  # person group.
@@ -642,6 +664,8 @@ module Azure::CognitiveServices::Face::V1_0
642
664
  end
643
665
 
644
666
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
667
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
668
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
645
669
 
646
670
  result
647
671
  end
@@ -738,6 +762,8 @@ module Azure::CognitiveServices::Face::V1_0
738
762
  end
739
763
 
740
764
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
765
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
766
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
741
767
  # Deserialize Response
742
768
  if status_code == 200
743
769
  begin
@@ -858,6 +884,8 @@ module Azure::CognitiveServices::Face::V1_0
858
884
  end
859
885
 
860
886
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
887
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
888
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
861
889
 
862
890
  result
863
891
  end
@@ -866,8 +894,51 @@ module Azure::CognitiveServices::Face::V1_0
866
894
  end
867
895
 
868
896
  #
869
- # Add a representative face to a person for identification. The input face is
870
- # specified as an image with a targetFace rectangle.
897
+ # Add a face to a person into a large person group for face identification or
898
+ # verification. To deal with an image contains multiple faces, input face can
899
+ # be specified as an image with a targetFace rectangle. It returns a
900
+ # persistedFaceId representing the added face. No image will be stored. Only
901
+ # the extracted face feature will be stored on server until [LargePersonGroup
902
+ # PersonFace -
903
+ # Delete](/docs/services/563879b61984550e40cbbe8d/operations/599ae2966ac60f11b48b5aa3),
904
+ # [LargePersonGroup Person -
905
+ # Delete](/docs/services/563879b61984550e40cbbe8d/operations/599ade5c6ac60f11b48b5aa2)
906
+ # or [LargePersonGroup -
907
+ # Delete](/docs/services/563879b61984550e40cbbe8d/operations/599adc216ac60f11b48b5a9f)
908
+ # is called.
909
+ # <br /> Note persistedFaceId is different from faceId generated by [Face -
910
+ # Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236).
911
+ # * Higher face image quality means better recognition precision. Please
912
+ # consider high-quality faces: frontal, clear, and face size is 200x200 pixels
913
+ # (100 pixels between eyes) or bigger.
914
+ # * Each person entry can hold up to 248 faces.
915
+ # * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed
916
+ # image file size is from 1KB to 6MB.
917
+ # * "targetFace" rectangle should contain one face. Zero or multiple faces will
918
+ # be regarded as an error. If the provided "targetFace" rectangle is not
919
+ # returned from [Face -
920
+ # Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236),
921
+ # there’s no guarantee to detect and add the face successfully.
922
+ # * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or
923
+ # large occlusions will cause failures.
924
+ # * Adding/deleting faces to/from a same person will be processed sequentially.
925
+ # Adding/deleting faces to/from different persons are processed in parallel.
926
+ # * The minimum detectable face size is 36x36 pixels in an image no larger than
927
+ # 1920x1080 pixels. Images with dimensions higher than 1920x1080 pixels will
928
+ # need a proportionally larger minimum face size.
929
+ # * Different 'detectionModel' values can be provided. To use and compare
930
+ # different detection models, please refer to [How to specify a detection
931
+ # model](https://docs.microsoft.com/en-us/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model)
932
+ # | Model | Recommended use-case(s) |
933
+ # | ---------- | -------- |
934
+ # | 'detection_01': | The default detection model for [LargePersonGroup Person
935
+ # - Add
936
+ # Face](/docs/services/563879b61984550e40cbbe8d/operations/599adf2a3a7b9412a4d53f42).
937
+ # Recommend for near frontal face detection. For scenarios with exceptionally
938
+ # large angle (head-pose) faces, occluded faces or wrong image orientation, the
939
+ # faces in such cases may not be detected. |
940
+ # | 'detection_02': | Detection model released in 2019 May with improved
941
+ # accuracy especially on small, side and blurry faces. |
871
942
  #
872
943
  # @param large_person_group_id [String] Id referencing a particular large
873
944
  # person group.
@@ -881,19 +952,68 @@ module Azure::CognitiveServices::Face::V1_0
881
952
  # is more than one face in the image, targetFace is required to specify which
882
953
  # face to add. No targetFace means there is only one face detected in the
883
954
  # entire image.
955
+ # @param detection_model [DetectionModel] Name of detection model. Detection
956
+ # model is used to detect faces in the submitted image. A detection model name
957
+ # can be provided when performing Face - Detect or (Large)FaceList - Add Face
958
+ # or (Large)PersonGroup - Add Face. The default value is 'detection_01', if
959
+ # another model is needed, please explicitly specify it. Possible values
960
+ # include: 'detection_01', 'detection_02'
884
961
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
885
962
  # will be added to the HTTP request.
886
963
  #
887
964
  # @return [PersistedFace] operation results.
888
965
  #
889
- def add_face_from_url(large_person_group_id, person_id, url, user_data:nil, target_face:nil, custom_headers:nil)
890
- response = add_face_from_url_async(large_person_group_id, person_id, url, user_data:user_data, target_face:target_face, custom_headers:custom_headers).value!
966
+ def add_face_from_url(large_person_group_id, person_id, url, user_data:nil, target_face:nil, detection_model:nil, custom_headers:nil)
967
+ response = add_face_from_url_async(large_person_group_id, person_id, url, user_data:user_data, target_face:target_face, detection_model:detection_model, custom_headers:custom_headers).value!
891
968
  response.body unless response.nil?
892
969
  end
893
970
 
894
971
  #
895
- # Add a representative face to a person for identification. The input face is
896
- # specified as an image with a targetFace rectangle.
972
+ # Add a face to a person into a large person group for face identification or
973
+ # verification. To deal with an image contains multiple faces, input face can
974
+ # be specified as an image with a targetFace rectangle. It returns a
975
+ # persistedFaceId representing the added face. No image will be stored. Only
976
+ # the extracted face feature will be stored on server until [LargePersonGroup
977
+ # PersonFace -
978
+ # Delete](/docs/services/563879b61984550e40cbbe8d/operations/599ae2966ac60f11b48b5aa3),
979
+ # [LargePersonGroup Person -
980
+ # Delete](/docs/services/563879b61984550e40cbbe8d/operations/599ade5c6ac60f11b48b5aa2)
981
+ # or [LargePersonGroup -
982
+ # Delete](/docs/services/563879b61984550e40cbbe8d/operations/599adc216ac60f11b48b5a9f)
983
+ # is called.
984
+ # <br /> Note persistedFaceId is different from faceId generated by [Face -
985
+ # Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236).
986
+ # * Higher face image quality means better recognition precision. Please
987
+ # consider high-quality faces: frontal, clear, and face size is 200x200 pixels
988
+ # (100 pixels between eyes) or bigger.
989
+ # * Each person entry can hold up to 248 faces.
990
+ # * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed
991
+ # image file size is from 1KB to 6MB.
992
+ # * "targetFace" rectangle should contain one face. Zero or multiple faces will
993
+ # be regarded as an error. If the provided "targetFace" rectangle is not
994
+ # returned from [Face -
995
+ # Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236),
996
+ # there’s no guarantee to detect and add the face successfully.
997
+ # * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or
998
+ # large occlusions will cause failures.
999
+ # * Adding/deleting faces to/from a same person will be processed sequentially.
1000
+ # Adding/deleting faces to/from different persons are processed in parallel.
1001
+ # * The minimum detectable face size is 36x36 pixels in an image no larger than
1002
+ # 1920x1080 pixels. Images with dimensions higher than 1920x1080 pixels will
1003
+ # need a proportionally larger minimum face size.
1004
+ # * Different 'detectionModel' values can be provided. To use and compare
1005
+ # different detection models, please refer to [How to specify a detection
1006
+ # model](https://docs.microsoft.com/en-us/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model)
1007
+ # | Model | Recommended use-case(s) |
1008
+ # | ---------- | -------- |
1009
+ # | 'detection_01': | The default detection model for [LargePersonGroup Person
1010
+ # - Add
1011
+ # Face](/docs/services/563879b61984550e40cbbe8d/operations/599adf2a3a7b9412a4d53f42).
1012
+ # Recommend for near frontal face detection. For scenarios with exceptionally
1013
+ # large angle (head-pose) faces, occluded faces or wrong image orientation, the
1014
+ # faces in such cases may not be detected. |
1015
+ # | 'detection_02': | Detection model released in 2019 May with improved
1016
+ # accuracy especially on small, side and blurry faces. |
897
1017
  #
898
1018
  # @param large_person_group_id [String] Id referencing a particular large
899
1019
  # person group.
@@ -907,18 +1027,67 @@ module Azure::CognitiveServices::Face::V1_0
907
1027
  # is more than one face in the image, targetFace is required to specify which
908
1028
  # face to add. No targetFace means there is only one face detected in the
909
1029
  # entire image.
1030
+ # @param detection_model [DetectionModel] Name of detection model. Detection
1031
+ # model is used to detect faces in the submitted image. A detection model name
1032
+ # can be provided when performing Face - Detect or (Large)FaceList - Add Face
1033
+ # or (Large)PersonGroup - Add Face. The default value is 'detection_01', if
1034
+ # another model is needed, please explicitly specify it. Possible values
1035
+ # include: 'detection_01', 'detection_02'
910
1036
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
911
1037
  # will be added to the HTTP request.
912
1038
  #
913
1039
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
914
1040
  #
915
- def add_face_from_url_with_http_info(large_person_group_id, person_id, url, user_data:nil, target_face:nil, custom_headers:nil)
916
- add_face_from_url_async(large_person_group_id, person_id, url, user_data:user_data, target_face:target_face, custom_headers:custom_headers).value!
1041
+ def add_face_from_url_with_http_info(large_person_group_id, person_id, url, user_data:nil, target_face:nil, detection_model:nil, custom_headers:nil)
1042
+ add_face_from_url_async(large_person_group_id, person_id, url, user_data:user_data, target_face:target_face, detection_model:detection_model, custom_headers:custom_headers).value!
917
1043
  end
918
1044
 
919
1045
  #
920
- # Add a representative face to a person for identification. The input face is
921
- # specified as an image with a targetFace rectangle.
1046
+ # Add a face to a person into a large person group for face identification or
1047
+ # verification. To deal with an image contains multiple faces, input face can
1048
+ # be specified as an image with a targetFace rectangle. It returns a
1049
+ # persistedFaceId representing the added face. No image will be stored. Only
1050
+ # the extracted face feature will be stored on server until [LargePersonGroup
1051
+ # PersonFace -
1052
+ # Delete](/docs/services/563879b61984550e40cbbe8d/operations/599ae2966ac60f11b48b5aa3),
1053
+ # [LargePersonGroup Person -
1054
+ # Delete](/docs/services/563879b61984550e40cbbe8d/operations/599ade5c6ac60f11b48b5aa2)
1055
+ # or [LargePersonGroup -
1056
+ # Delete](/docs/services/563879b61984550e40cbbe8d/operations/599adc216ac60f11b48b5a9f)
1057
+ # is called.
1058
+ # <br /> Note persistedFaceId is different from faceId generated by [Face -
1059
+ # Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236).
1060
+ # * Higher face image quality means better recognition precision. Please
1061
+ # consider high-quality faces: frontal, clear, and face size is 200x200 pixels
1062
+ # (100 pixels between eyes) or bigger.
1063
+ # * Each person entry can hold up to 248 faces.
1064
+ # * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed
1065
+ # image file size is from 1KB to 6MB.
1066
+ # * "targetFace" rectangle should contain one face. Zero or multiple faces will
1067
+ # be regarded as an error. If the provided "targetFace" rectangle is not
1068
+ # returned from [Face -
1069
+ # Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236),
1070
+ # there’s no guarantee to detect and add the face successfully.
1071
+ # * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or
1072
+ # large occlusions will cause failures.
1073
+ # * Adding/deleting faces to/from a same person will be processed sequentially.
1074
+ # Adding/deleting faces to/from different persons are processed in parallel.
1075
+ # * The minimum detectable face size is 36x36 pixels in an image no larger than
1076
+ # 1920x1080 pixels. Images with dimensions higher than 1920x1080 pixels will
1077
+ # need a proportionally larger minimum face size.
1078
+ # * Different 'detectionModel' values can be provided. To use and compare
1079
+ # different detection models, please refer to [How to specify a detection
1080
+ # model](https://docs.microsoft.com/en-us/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model)
1081
+ # | Model | Recommended use-case(s) |
1082
+ # | ---------- | -------- |
1083
+ # | 'detection_01': | The default detection model for [LargePersonGroup Person
1084
+ # - Add
1085
+ # Face](/docs/services/563879b61984550e40cbbe8d/operations/599adf2a3a7b9412a4d53f42).
1086
+ # Recommend for near frontal face detection. For scenarios with exceptionally
1087
+ # large angle (head-pose) faces, occluded faces or wrong image orientation, the
1088
+ # faces in such cases may not be detected. |
1089
+ # | 'detection_02': | Detection model released in 2019 May with improved
1090
+ # accuracy especially on small, side and blurry faces. |
922
1091
  #
923
1092
  # @param large_person_group_id [String] Id referencing a particular large
924
1093
  # person group.
@@ -932,12 +1101,18 @@ module Azure::CognitiveServices::Face::V1_0
932
1101
  # is more than one face in the image, targetFace is required to specify which
933
1102
  # face to add. No targetFace means there is only one face detected in the
934
1103
  # entire image.
1104
+ # @param detection_model [DetectionModel] Name of detection model. Detection
1105
+ # model is used to detect faces in the submitted image. A detection model name
1106
+ # can be provided when performing Face - Detect or (Large)FaceList - Add Face
1107
+ # or (Large)PersonGroup - Add Face. The default value is 'detection_01', if
1108
+ # another model is needed, please explicitly specify it. Possible values
1109
+ # include: 'detection_01', 'detection_02'
935
1110
  # @param [Hash{String => String}] A hash of custom headers that will be added
936
1111
  # to the HTTP request.
937
1112
  #
938
1113
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
939
1114
  #
940
- def add_face_from_url_async(large_person_group_id, person_id, url, user_data:nil, target_face:nil, custom_headers:nil)
1115
+ def add_face_from_url_async(large_person_group_id, person_id, url, user_data:nil, target_face:nil, detection_model:nil, custom_headers:nil)
941
1116
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
942
1117
  fail ArgumentError, 'large_person_group_id is nil' if large_person_group_id.nil?
943
1118
  fail ArgumentError, "'large_person_group_id' should satisfy the constraint - 'MaxLength': '64'" if !large_person_group_id.nil? && large_person_group_id.length > 64
@@ -971,7 +1146,7 @@ module Azure::CognitiveServices::Face::V1_0
971
1146
  options = {
972
1147
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
973
1148
  path_params: {'largePersonGroupId' => large_person_group_id,'personId' => person_id},
974
- query_params: {'userData' => user_data,'targetFace' => target_face.nil? ? nil : target_face.join(',')},
1149
+ query_params: {'userData' => user_data,'targetFace' => target_face.nil? ? nil : target_face.join(','),'detectionModel' => detection_model},
975
1150
  body: request_content,
976
1151
  headers: request_headers.merge(custom_headers || {}),
977
1152
  base_url: request_url
@@ -988,6 +1163,8 @@ module Azure::CognitiveServices::Face::V1_0
988
1163
  end
989
1164
 
990
1165
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1166
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1167
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
991
1168
  # Deserialize Response
992
1169
  if status_code == 200
993
1170
  begin
@@ -1006,8 +1183,51 @@ module Azure::CognitiveServices::Face::V1_0
1006
1183
  end
1007
1184
 
1008
1185
  #
1009
- # Add a representative face to a person for identification. The input face is
1010
- # specified as an image with a targetFace rectangle.
1186
+ # Add a face to a person into a large person group for face identification or
1187
+ # verification. To deal with an image contains multiple faces, input face can
1188
+ # be specified as an image with a targetFace rectangle. It returns a
1189
+ # persistedFaceId representing the added face. No image will be stored. Only
1190
+ # the extracted face feature will be stored on server until [LargePersonGroup
1191
+ # PersonFace -
1192
+ # Delete](/docs/services/563879b61984550e40cbbe8d/operations/599ae2966ac60f11b48b5aa3),
1193
+ # [LargePersonGroup Person -
1194
+ # Delete](/docs/services/563879b61984550e40cbbe8d/operations/599ade5c6ac60f11b48b5aa2)
1195
+ # or [LargePersonGroup -
1196
+ # Delete](/docs/services/563879b61984550e40cbbe8d/operations/599adc216ac60f11b48b5a9f)
1197
+ # is called.
1198
+ # <br /> Note persistedFaceId is different from faceId generated by [Face -
1199
+ # Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236).
1200
+ # * Higher face image quality means better recognition precision. Please
1201
+ # consider high-quality faces: frontal, clear, and face size is 200x200 pixels
1202
+ # (100 pixels between eyes) or bigger.
1203
+ # * Each person entry can hold up to 248 faces.
1204
+ # * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed
1205
+ # image file size is from 1KB to 6MB.
1206
+ # * "targetFace" rectangle should contain one face. Zero or multiple faces will
1207
+ # be regarded as an error. If the provided "targetFace" rectangle is not
1208
+ # returned from [Face -
1209
+ # Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236),
1210
+ # there’s no guarantee to detect and add the face successfully.
1211
+ # * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or
1212
+ # large occlusions will cause failures.
1213
+ # * Adding/deleting faces to/from a same person will be processed sequentially.
1214
+ # Adding/deleting faces to/from different persons are processed in parallel.
1215
+ # * The minimum detectable face size is 36x36 pixels in an image no larger than
1216
+ # 1920x1080 pixels. Images with dimensions higher than 1920x1080 pixels will
1217
+ # need a proportionally larger minimum face size.
1218
+ # * Different 'detectionModel' values can be provided. To use and compare
1219
+ # different detection models, please refer to [How to specify a detection
1220
+ # model](https://docs.microsoft.com/en-us/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model)
1221
+ # | Model | Recommended use-case(s) |
1222
+ # | ---------- | -------- |
1223
+ # | 'detection_01': | The default detection model for [LargePersonGroup Person
1224
+ # - Add
1225
+ # Face](/docs/services/563879b61984550e40cbbe8d/operations/599adf2a3a7b9412a4d53f42).
1226
+ # Recommend for near frontal face detection. For scenarios with exceptionally
1227
+ # large angle (head-pose) faces, occluded faces or wrong image orientation, the
1228
+ # faces in such cases may not be detected. |
1229
+ # | 'detection_02': | Detection model released in 2019 May with improved
1230
+ # accuracy especially on small, side and blurry faces. |
1011
1231
  #
1012
1232
  # @param large_person_group_id [String] Id referencing a particular large
1013
1233
  # person group.
@@ -1021,19 +1241,68 @@ module Azure::CognitiveServices::Face::V1_0
1021
1241
  # is more than one face in the image, targetFace is required to specify which
1022
1242
  # face to add. No targetFace means there is only one face detected in the
1023
1243
  # entire image.
1244
+ # @param detection_model [DetectionModel] Name of detection model. Detection
1245
+ # model is used to detect faces in the submitted image. A detection model name
1246
+ # can be provided when performing Face - Detect or (Large)FaceList - Add Face
1247
+ # or (Large)PersonGroup - Add Face. The default value is 'detection_01', if
1248
+ # another model is needed, please explicitly specify it. Possible values
1249
+ # include: 'detection_01', 'detection_02'
1024
1250
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
1025
1251
  # will be added to the HTTP request.
1026
1252
  #
1027
1253
  # @return [PersistedFace] operation results.
1028
1254
  #
1029
- def add_face_from_stream(large_person_group_id, person_id, image, user_data:nil, target_face:nil, custom_headers:nil)
1030
- response = add_face_from_stream_async(large_person_group_id, person_id, image, user_data:user_data, target_face:target_face, custom_headers:custom_headers).value!
1255
+ def add_face_from_stream(large_person_group_id, person_id, image, user_data:nil, target_face:nil, detection_model:nil, custom_headers:nil)
1256
+ response = add_face_from_stream_async(large_person_group_id, person_id, image, user_data:user_data, target_face:target_face, detection_model:detection_model, custom_headers:custom_headers).value!
1031
1257
  response.body unless response.nil?
1032
1258
  end
1033
1259
 
1034
1260
  #
1035
- # Add a representative face to a person for identification. The input face is
1036
- # specified as an image with a targetFace rectangle.
1261
+ # Add a face to a person into a large person group for face identification or
1262
+ # verification. To deal with an image contains multiple faces, input face can
1263
+ # be specified as an image with a targetFace rectangle. It returns a
1264
+ # persistedFaceId representing the added face. No image will be stored. Only
1265
+ # the extracted face feature will be stored on server until [LargePersonGroup
1266
+ # PersonFace -
1267
+ # Delete](/docs/services/563879b61984550e40cbbe8d/operations/599ae2966ac60f11b48b5aa3),
1268
+ # [LargePersonGroup Person -
1269
+ # Delete](/docs/services/563879b61984550e40cbbe8d/operations/599ade5c6ac60f11b48b5aa2)
1270
+ # or [LargePersonGroup -
1271
+ # Delete](/docs/services/563879b61984550e40cbbe8d/operations/599adc216ac60f11b48b5a9f)
1272
+ # is called.
1273
+ # <br /> Note persistedFaceId is different from faceId generated by [Face -
1274
+ # Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236).
1275
+ # * Higher face image quality means better recognition precision. Please
1276
+ # consider high-quality faces: frontal, clear, and face size is 200x200 pixels
1277
+ # (100 pixels between eyes) or bigger.
1278
+ # * Each person entry can hold up to 248 faces.
1279
+ # * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed
1280
+ # image file size is from 1KB to 6MB.
1281
+ # * "targetFace" rectangle should contain one face. Zero or multiple faces will
1282
+ # be regarded as an error. If the provided "targetFace" rectangle is not
1283
+ # returned from [Face -
1284
+ # Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236),
1285
+ # there’s no guarantee to detect and add the face successfully.
1286
+ # * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or
1287
+ # large occlusions will cause failures.
1288
+ # * Adding/deleting faces to/from a same person will be processed sequentially.
1289
+ # Adding/deleting faces to/from different persons are processed in parallel.
1290
+ # * The minimum detectable face size is 36x36 pixels in an image no larger than
1291
+ # 1920x1080 pixels. Images with dimensions higher than 1920x1080 pixels will
1292
+ # need a proportionally larger minimum face size.
1293
+ # * Different 'detectionModel' values can be provided. To use and compare
1294
+ # different detection models, please refer to [How to specify a detection
1295
+ # model](https://docs.microsoft.com/en-us/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model)
1296
+ # | Model | Recommended use-case(s) |
1297
+ # | ---------- | -------- |
1298
+ # | 'detection_01': | The default detection model for [LargePersonGroup Person
1299
+ # - Add
1300
+ # Face](/docs/services/563879b61984550e40cbbe8d/operations/599adf2a3a7b9412a4d53f42).
1301
+ # Recommend for near frontal face detection. For scenarios with exceptionally
1302
+ # large angle (head-pose) faces, occluded faces or wrong image orientation, the
1303
+ # faces in such cases may not be detected. |
1304
+ # | 'detection_02': | Detection model released in 2019 May with improved
1305
+ # accuracy especially on small, side and blurry faces. |
1037
1306
  #
1038
1307
  # @param large_person_group_id [String] Id referencing a particular large
1039
1308
  # person group.
@@ -1047,18 +1316,67 @@ module Azure::CognitiveServices::Face::V1_0
1047
1316
  # is more than one face in the image, targetFace is required to specify which
1048
1317
  # face to add. No targetFace means there is only one face detected in the
1049
1318
  # entire image.
1319
+ # @param detection_model [DetectionModel] Name of detection model. Detection
1320
+ # model is used to detect faces in the submitted image. A detection model name
1321
+ # can be provided when performing Face - Detect or (Large)FaceList - Add Face
1322
+ # or (Large)PersonGroup - Add Face. The default value is 'detection_01', if
1323
+ # another model is needed, please explicitly specify it. Possible values
1324
+ # include: 'detection_01', 'detection_02'
1050
1325
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
1051
1326
  # will be added to the HTTP request.
1052
1327
  #
1053
1328
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
1054
1329
  #
1055
- def add_face_from_stream_with_http_info(large_person_group_id, person_id, image, user_data:nil, target_face:nil, custom_headers:nil)
1056
- add_face_from_stream_async(large_person_group_id, person_id, image, user_data:user_data, target_face:target_face, custom_headers:custom_headers).value!
1330
+ def add_face_from_stream_with_http_info(large_person_group_id, person_id, image, user_data:nil, target_face:nil, detection_model:nil, custom_headers:nil)
1331
+ add_face_from_stream_async(large_person_group_id, person_id, image, user_data:user_data, target_face:target_face, detection_model:detection_model, custom_headers:custom_headers).value!
1057
1332
  end
1058
1333
 
1059
1334
  #
1060
- # Add a representative face to a person for identification. The input face is
1061
- # specified as an image with a targetFace rectangle.
1335
+ # Add a face to a person into a large person group for face identification or
1336
+ # verification. To deal with an image contains multiple faces, input face can
1337
+ # be specified as an image with a targetFace rectangle. It returns a
1338
+ # persistedFaceId representing the added face. No image will be stored. Only
1339
+ # the extracted face feature will be stored on server until [LargePersonGroup
1340
+ # PersonFace -
1341
+ # Delete](/docs/services/563879b61984550e40cbbe8d/operations/599ae2966ac60f11b48b5aa3),
1342
+ # [LargePersonGroup Person -
1343
+ # Delete](/docs/services/563879b61984550e40cbbe8d/operations/599ade5c6ac60f11b48b5aa2)
1344
+ # or [LargePersonGroup -
1345
+ # Delete](/docs/services/563879b61984550e40cbbe8d/operations/599adc216ac60f11b48b5a9f)
1346
+ # is called.
1347
+ # <br /> Note persistedFaceId is different from faceId generated by [Face -
1348
+ # Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236).
1349
+ # * Higher face image quality means better recognition precision. Please
1350
+ # consider high-quality faces: frontal, clear, and face size is 200x200 pixels
1351
+ # (100 pixels between eyes) or bigger.
1352
+ # * Each person entry can hold up to 248 faces.
1353
+ # * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed
1354
+ # image file size is from 1KB to 6MB.
1355
+ # * "targetFace" rectangle should contain one face. Zero or multiple faces will
1356
+ # be regarded as an error. If the provided "targetFace" rectangle is not
1357
+ # returned from [Face -
1358
+ # Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236),
1359
+ # there’s no guarantee to detect and add the face successfully.
1360
+ # * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or
1361
+ # large occlusions will cause failures.
1362
+ # * Adding/deleting faces to/from a same person will be processed sequentially.
1363
+ # Adding/deleting faces to/from different persons are processed in parallel.
1364
+ # * The minimum detectable face size is 36x36 pixels in an image no larger than
1365
+ # 1920x1080 pixels. Images with dimensions higher than 1920x1080 pixels will
1366
+ # need a proportionally larger minimum face size.
1367
+ # * Different 'detectionModel' values can be provided. To use and compare
1368
+ # different detection models, please refer to [How to specify a detection
1369
+ # model](https://docs.microsoft.com/en-us/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model)
1370
+ # | Model | Recommended use-case(s) |
1371
+ # | ---------- | -------- |
1372
+ # | 'detection_01': | The default detection model for [LargePersonGroup Person
1373
+ # - Add
1374
+ # Face](/docs/services/563879b61984550e40cbbe8d/operations/599adf2a3a7b9412a4d53f42).
1375
+ # Recommend for near frontal face detection. For scenarios with exceptionally
1376
+ # large angle (head-pose) faces, occluded faces or wrong image orientation, the
1377
+ # faces in such cases may not be detected. |
1378
+ # | 'detection_02': | Detection model released in 2019 May with improved
1379
+ # accuracy especially on small, side and blurry faces. |
1062
1380
  #
1063
1381
  # @param large_person_group_id [String] Id referencing a particular large
1064
1382
  # person group.
@@ -1072,12 +1390,18 @@ module Azure::CognitiveServices::Face::V1_0
1072
1390
  # is more than one face in the image, targetFace is required to specify which
1073
1391
  # face to add. No targetFace means there is only one face detected in the
1074
1392
  # entire image.
1393
+ # @param detection_model [DetectionModel] Name of detection model. Detection
1394
+ # model is used to detect faces in the submitted image. A detection model name
1395
+ # can be provided when performing Face - Detect or (Large)FaceList - Add Face
1396
+ # or (Large)PersonGroup - Add Face. The default value is 'detection_01', if
1397
+ # another model is needed, please explicitly specify it. Possible values
1398
+ # include: 'detection_01', 'detection_02'
1075
1399
  # @param [Hash{String => String}] A hash of custom headers that will be added
1076
1400
  # to the HTTP request.
1077
1401
  #
1078
1402
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
1079
1403
  #
1080
- def add_face_from_stream_async(large_person_group_id, person_id, image, user_data:nil, target_face:nil, custom_headers:nil)
1404
+ def add_face_from_stream_async(large_person_group_id, person_id, image, user_data:nil, target_face:nil, detection_model:nil, custom_headers:nil)
1081
1405
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
1082
1406
  fail ArgumentError, 'large_person_group_id is nil' if large_person_group_id.nil?
1083
1407
  fail ArgumentError, "'large_person_group_id' should satisfy the constraint - 'MaxLength': '64'" if !large_person_group_id.nil? && large_person_group_id.length > 64
@@ -1113,7 +1437,7 @@ module Azure::CognitiveServices::Face::V1_0
1113
1437
  options = {
1114
1438
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
1115
1439
  path_params: {'largePersonGroupId' => large_person_group_id,'personId' => person_id},
1116
- query_params: {'userData' => user_data,'targetFace' => target_face.nil? ? nil : target_face.join(',')},
1440
+ query_params: {'userData' => user_data,'targetFace' => target_face.nil? ? nil : target_face.join(','),'detectionModel' => detection_model},
1117
1441
  body: request_content,
1118
1442
  headers: request_headers.merge(custom_headers || {}),
1119
1443
  base_url: request_url
@@ -1130,6 +1454,8 @@ module Azure::CognitiveServices::Face::V1_0
1130
1454
  end
1131
1455
 
1132
1456
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1457
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1458
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
1133
1459
  # Deserialize Response
1134
1460
  if status_code == 200
1135
1461
  begin