azure_cognitiveservices_face 0.18.0 → 0.19.0

This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
@@ -152,7 +152,7 @@ module Azure::CognitiveServices::Face::V1_0
152
152
  #
153
153
  def add_telemetry
154
154
  sdk_information = 'azure_cognitiveservices_face'
155
- sdk_information = "#{sdk_information}/0.18.0"
155
+ sdk_information = "#{sdk_information}/0.19.0"
156
156
  add_user_agent_information(sdk_information)
157
157
  end
158
158
  end
@@ -30,7 +30,8 @@ module Azure::CognitiveServices::Face::V1_0
30
30
  # Similar](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395237).
31
31
  # <br /> After creation, user should use [FaceList - Add
32
32
  # Face](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395250)
33
- # to import the faces. Faces are stored on server until [FaceList -
33
+ # to import the faces. No image will be stored. Only the extracted face
34
+ # features are stored on server until [FaceList -
34
35
  # Delete](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039524f)
35
36
  # is called.
36
37
  # <br /> Find Similar is used for scenario like finding celebrity-like faces,
@@ -44,14 +45,20 @@ module Azure::CognitiveServices::Face::V1_0
44
45
  # <br /> Please consider
45
46
  # [LargeFaceList](/docs/services/563879b61984550e40cbbe8d/operations/5a157b68d2de3616c086f2cc)
46
47
  # 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
48
+ # <br />'recognitionModel' should be specified to associate with this face
49
+ # list. The default value for 'recognitionModel' is 'recognition_01', if the
50
+ # latest model needed, please explicitly specify the model you need in this
51
+ # parameter. New faces that are added to an existing face list will use the
52
+ # recognition model that's already associated with the collection. Existing
53
+ # face features in a face list can't be updated to features extracted by
54
+ # another version of recognition model.
55
+ # * 'recognition_01': The default recognition model for [FaceList-
56
+ # Create](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039524b).
57
+ # All those face lists created before 2019 March are bonded with this
53
58
  # recognition model.
54
- #
59
+ # * 'recognition_02': Recognition model released in 2019 March.
60
+ # 'recognition_02' is recommended since its overall accuracy is improved
61
+ # compared with 'recognition_01'.
55
62
  #
56
63
  # @param face_list_id [String] Id referencing a particular face list.
57
64
  # @param name [String] User defined name, maximum length is 128.
@@ -76,7 +83,8 @@ module Azure::CognitiveServices::Face::V1_0
76
83
  # Similar](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395237).
77
84
  # <br /> After creation, user should use [FaceList - Add
78
85
  # Face](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395250)
79
- # to import the faces. Faces are stored on server until [FaceList -
86
+ # to import the faces. No image will be stored. Only the extracted face
87
+ # features are stored on server until [FaceList -
80
88
  # Delete](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039524f)
81
89
  # is called.
82
90
  # <br /> Find Similar is used for scenario like finding celebrity-like faces,
@@ -90,14 +98,20 @@ module Azure::CognitiveServices::Face::V1_0
90
98
  # <br /> Please consider
91
99
  # [LargeFaceList](/docs/services/563879b61984550e40cbbe8d/operations/5a157b68d2de3616c086f2cc)
92
100
  # 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
101
+ # <br />'recognitionModel' should be specified to associate with this face
102
+ # list. The default value for 'recognitionModel' is 'recognition_01', if the
103
+ # latest model needed, please explicitly specify the model you need in this
104
+ # parameter. New faces that are added to an existing face list will use the
105
+ # recognition model that's already associated with the collection. Existing
106
+ # face features in a face list can't be updated to features extracted by
107
+ # another version of recognition model.
108
+ # * 'recognition_01': The default recognition model for [FaceList-
109
+ # Create](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039524b).
110
+ # All those face lists created before 2019 March are bonded with this
99
111
  # recognition model.
100
- #
112
+ # * 'recognition_02': Recognition model released in 2019 March.
113
+ # 'recognition_02' is recommended since its overall accuracy is improved
114
+ # compared with 'recognition_01'.
101
115
  #
102
116
  # @param face_list_id [String] Id referencing a particular face list.
103
117
  # @param name [String] User defined name, maximum length is 128.
@@ -122,7 +136,8 @@ module Azure::CognitiveServices::Face::V1_0
122
136
  # Similar](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395237).
123
137
  # <br /> After creation, user should use [FaceList - Add
124
138
  # Face](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395250)
125
- # to import the faces. Faces are stored on server until [FaceList -
139
+ # to import the faces. No image will be stored. Only the extracted face
140
+ # features are stored on server until [FaceList -
126
141
  # Delete](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039524f)
127
142
  # is called.
128
143
  # <br /> Find Similar is used for scenario like finding celebrity-like faces,
@@ -136,14 +151,20 @@ module Azure::CognitiveServices::Face::V1_0
136
151
  # <br /> Please consider
137
152
  # [LargeFaceList](/docs/services/563879b61984550e40cbbe8d/operations/5a157b68d2de3616c086f2cc)
138
153
  # 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
154
+ # <br />'recognitionModel' should be specified to associate with this face
155
+ # list. The default value for 'recognitionModel' is 'recognition_01', if the
156
+ # latest model needed, please explicitly specify the model you need in this
157
+ # parameter. New faces that are added to an existing face list will use the
158
+ # recognition model that's already associated with the collection. Existing
159
+ # face features in a face list can't be updated to features extracted by
160
+ # another version of recognition model.
161
+ # * 'recognition_01': The default recognition model for [FaceList-
162
+ # Create](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039524b).
163
+ # All those face lists created before 2019 March are bonded with this
145
164
  # recognition model.
146
- #
165
+ # * 'recognition_02': Recognition model released in 2019 March.
166
+ # 'recognition_02' is recommended since its overall accuracy is improved
167
+ # compared with 'recognition_01'.
147
168
  #
148
169
  # @param face_list_id [String] Id referencing a particular face list.
149
170
  # @param name [String] User defined name, maximum length is 128.
@@ -206,6 +227,8 @@ module Azure::CognitiveServices::Face::V1_0
206
227
  end
207
228
 
208
229
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
230
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
231
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
209
232
 
210
233
  result
211
234
  end
@@ -298,6 +321,8 @@ module Azure::CognitiveServices::Face::V1_0
298
321
  end
299
322
 
300
323
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
324
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
325
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
301
326
  # Deserialize Response
302
327
  if status_code == 200
303
328
  begin
@@ -406,6 +431,8 @@ module Azure::CognitiveServices::Face::V1_0
406
431
  end
407
432
 
408
433
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
434
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
435
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
409
436
 
410
437
  result
411
438
  end
@@ -414,8 +441,7 @@ module Azure::CognitiveServices::Face::V1_0
414
441
  end
415
442
 
416
443
  #
417
- # Delete an existing face list according to faceListId. Persisted face images
418
- # in the face list will also be deleted.
444
+ # Delete a specified face list.
419
445
  #
420
446
  # @param face_list_id [String] Id referencing a particular face list.
421
447
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
@@ -428,8 +454,7 @@ module Azure::CognitiveServices::Face::V1_0
428
454
  end
429
455
 
430
456
  #
431
- # Delete an existing face list according to faceListId. Persisted face images
432
- # in the face list will also be deleted.
457
+ # Delete a specified face list.
433
458
  #
434
459
  # @param face_list_id [String] Id referencing a particular face list.
435
460
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
@@ -442,8 +467,7 @@ module Azure::CognitiveServices::Face::V1_0
442
467
  end
443
468
 
444
469
  #
445
- # Delete an existing face list according to faceListId. Persisted face images
446
- # in the face list will also be deleted.
470
+ # Delete a specified face list.
447
471
  #
448
472
  # @param face_list_id [String] Id referencing a particular face list.
449
473
  # @param [Hash{String => String}] A hash of custom headers that will be added
@@ -487,6 +511,8 @@ module Azure::CognitiveServices::Face::V1_0
487
511
  end
488
512
 
489
513
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
514
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
515
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
490
516
 
491
517
  result
492
518
  end
@@ -575,6 +601,8 @@ module Azure::CognitiveServices::Face::V1_0
575
601
  end
576
602
 
577
603
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
604
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
605
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
578
606
  # Deserialize Response
579
607
  if status_code == 200
580
608
  begin
@@ -609,8 +637,9 @@ module Azure::CognitiveServices::Face::V1_0
609
637
  end
610
638
 
611
639
  #
612
- # Delete an existing face from a face list (given by a persistedFaceId and a
613
- # faceListId). Persisted image related to the face will also be deleted.
640
+ # Delete a face from a face list by specified faceListId and persistedFaceId.
641
+ # <br /> Adding/deleting faces to/from a same face list are processed
642
+ # sequentially and to/from different face lists are in parallel.
614
643
  #
615
644
  # @param face_list_id [String] Id referencing a particular face list.
616
645
  # @param persisted_face_id Id referencing a particular persistedFaceId of an
@@ -625,8 +654,9 @@ module Azure::CognitiveServices::Face::V1_0
625
654
  end
626
655
 
627
656
  #
628
- # Delete an existing face from a face list (given by a persistedFaceId and a
629
- # faceListId). Persisted image related to the face will also be deleted.
657
+ # Delete a face from a face list by specified faceListId and persistedFaceId.
658
+ # <br /> Adding/deleting faces to/from a same face list are processed
659
+ # sequentially and to/from different face lists are in parallel.
630
660
  #
631
661
  # @param face_list_id [String] Id referencing a particular face list.
632
662
  # @param persisted_face_id Id referencing a particular persistedFaceId of an
@@ -641,8 +671,9 @@ module Azure::CognitiveServices::Face::V1_0
641
671
  end
642
672
 
643
673
  #
644
- # Delete an existing face from a face list (given by a persistedFaceId and a
645
- # faceListId). Persisted image related to the face will also be deleted.
674
+ # Delete a face from a face list by specified faceListId and persistedFaceId.
675
+ # <br /> Adding/deleting faces to/from a same face list are processed
676
+ # sequentially and to/from different face lists are in parallel.
646
677
  #
647
678
  # @param face_list_id [String] Id referencing a particular face list.
648
679
  # @param persisted_face_id Id referencing a particular persistedFaceId of an
@@ -689,6 +720,8 @@ module Azure::CognitiveServices::Face::V1_0
689
720
  end
690
721
 
691
722
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
723
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
724
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
692
725
 
693
726
  result
694
727
  end
@@ -697,9 +730,46 @@ module Azure::CognitiveServices::Face::V1_0
697
730
  end
698
731
 
699
732
  #
700
- # Add a face to a face list. The input face is specified as an image with a
701
- # targetFace rectangle. It returns a persistedFaceId representing the added
702
- # face, and persistedFaceId will not expire.
733
+ # Add a face to a specified face list, up to 1,000 faces.
734
+ # <br /> To deal with an image contains multiple faces, input face can be
735
+ # specified as an image with a targetFace rectangle. It returns a
736
+ # persistedFaceId representing the added face. No image will be stored. Only
737
+ # the extracted face feature will be stored on server until [FaceList - Delete
738
+ # Face](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395251)
739
+ # or [FaceList -
740
+ # Delete](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039524f)
741
+ # is called.
742
+ # <br /> Note persistedFaceId is different from faceId generated by [Face -
743
+ # Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236).
744
+ # * Higher face image quality means better detection and recognition precision.
745
+ # Please consider high-quality faces: frontal, clear, and face size is 200x200
746
+ # pixels (100 pixels between eyes) or bigger.
747
+ # * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed
748
+ # image file size is from 1KB to 6MB.
749
+ # * "targetFace" rectangle should contain one face. Zero or multiple faces will
750
+ # be regarded as an error. If the provided "targetFace" rectangle is not
751
+ # returned from [Face -
752
+ # Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236),
753
+ # there’s no guarantee to detect and add the face successfully.
754
+ # * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or
755
+ # large occlusions will cause failures.
756
+ # * Adding/deleting faces to/from a same face list are processed sequentially
757
+ # and to/from different face lists are in parallel.
758
+ # * The minimum detectable face size is 36x36 pixels in an image no larger than
759
+ # 1920x1080 pixels. Images with dimensions higher than 1920x1080 pixels will
760
+ # need a proportionally larger minimum face size.
761
+ # * Different 'detectionModel' values can be provided. To use and compare
762
+ # different detection models, please refer to [How to specify a detection
763
+ # model](https://docs.microsoft.com/en-us/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model)
764
+ # | Model | Recommended use-case(s) |
765
+ # | ---------- | -------- |
766
+ # | 'detection_01': | The default detection model for [FaceList - Add
767
+ # Face](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395250).
768
+ # Recommend for near frontal face detection. For scenarios with exceptionally
769
+ # large angle (head-pose) faces, occluded faces or wrong image orientation, the
770
+ # faces in such cases may not be detected. |
771
+ # | 'detection_02': | Detection model released in 2019 May with improved
772
+ # accuracy especially on small, side and blurry faces. |
703
773
  #
704
774
  # @param face_list_id [String] Id referencing a particular face list.
705
775
  # @param url [String] Publicly reachable URL of an image
@@ -711,20 +781,63 @@ module Azure::CognitiveServices::Face::V1_0
711
781
  # is more than one face in the image, targetFace is required to specify which
712
782
  # face to add. No targetFace means there is only one face detected in the
713
783
  # entire image.
784
+ # @param detection_model [DetectionModel] Name of detection model. Detection
785
+ # model is used to detect faces in the submitted image. A detection model name
786
+ # can be provided when performing Face - Detect or (Large)FaceList - Add Face
787
+ # or (Large)PersonGroup - Add Face. The default value is 'detection_01', if
788
+ # another model is needed, please explicitly specify it. Possible values
789
+ # include: 'detection_01', 'detection_02'
714
790
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
715
791
  # will be added to the HTTP request.
716
792
  #
717
793
  # @return [PersistedFace] operation results.
718
794
  #
719
- def add_face_from_url(face_list_id, url, user_data:nil, target_face:nil, custom_headers:nil)
720
- response = add_face_from_url_async(face_list_id, url, user_data:user_data, target_face:target_face, custom_headers:custom_headers).value!
795
+ def add_face_from_url(face_list_id, url, user_data:nil, target_face:nil, detection_model:nil, custom_headers:nil)
796
+ response = add_face_from_url_async(face_list_id, url, user_data:user_data, target_face:target_face, detection_model:detection_model, custom_headers:custom_headers).value!
721
797
  response.body unless response.nil?
722
798
  end
723
799
 
724
800
  #
725
- # Add a face to a face list. The input face is specified as an image with a
726
- # targetFace rectangle. It returns a persistedFaceId representing the added
727
- # face, and persistedFaceId will not expire.
801
+ # Add a face to a specified face list, up to 1,000 faces.
802
+ # <br /> To deal with an image contains multiple faces, input face can be
803
+ # specified as an image with a targetFace rectangle. It returns a
804
+ # persistedFaceId representing the added face. No image will be stored. Only
805
+ # the extracted face feature will be stored on server until [FaceList - Delete
806
+ # Face](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395251)
807
+ # or [FaceList -
808
+ # Delete](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039524f)
809
+ # is called.
810
+ # <br /> Note persistedFaceId is different from faceId generated by [Face -
811
+ # Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236).
812
+ # * Higher face image quality means better detection and recognition precision.
813
+ # Please consider high-quality faces: frontal, clear, and face size is 200x200
814
+ # pixels (100 pixels between eyes) or bigger.
815
+ # * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed
816
+ # image file size is from 1KB to 6MB.
817
+ # * "targetFace" rectangle should contain one face. Zero or multiple faces will
818
+ # be regarded as an error. If the provided "targetFace" rectangle is not
819
+ # returned from [Face -
820
+ # Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236),
821
+ # there’s no guarantee to detect and add the face successfully.
822
+ # * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or
823
+ # large occlusions will cause failures.
824
+ # * Adding/deleting faces to/from a same face list are processed sequentially
825
+ # and to/from different face lists are in parallel.
826
+ # * The minimum detectable face size is 36x36 pixels in an image no larger than
827
+ # 1920x1080 pixels. Images with dimensions higher than 1920x1080 pixels will
828
+ # need a proportionally larger minimum face size.
829
+ # * Different 'detectionModel' values can be provided. To use and compare
830
+ # different detection models, please refer to [How to specify a detection
831
+ # model](https://docs.microsoft.com/en-us/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model)
832
+ # | Model | Recommended use-case(s) |
833
+ # | ---------- | -------- |
834
+ # | 'detection_01': | The default detection model for [FaceList - Add
835
+ # Face](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395250).
836
+ # Recommend for near frontal face detection. For scenarios with exceptionally
837
+ # large angle (head-pose) faces, occluded faces or wrong image orientation, the
838
+ # faces in such cases may not be detected. |
839
+ # | 'detection_02': | Detection model released in 2019 May with improved
840
+ # accuracy especially on small, side and blurry faces. |
728
841
  #
729
842
  # @param face_list_id [String] Id referencing a particular face list.
730
843
  # @param url [String] Publicly reachable URL of an image
@@ -736,19 +849,62 @@ module Azure::CognitiveServices::Face::V1_0
736
849
  # is more than one face in the image, targetFace is required to specify which
737
850
  # face to add. No targetFace means there is only one face detected in the
738
851
  # entire image.
852
+ # @param detection_model [DetectionModel] Name of detection model. Detection
853
+ # model is used to detect faces in the submitted image. A detection model name
854
+ # can be provided when performing Face - Detect or (Large)FaceList - Add Face
855
+ # or (Large)PersonGroup - Add Face. The default value is 'detection_01', if
856
+ # another model is needed, please explicitly specify it. Possible values
857
+ # include: 'detection_01', 'detection_02'
739
858
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
740
859
  # will be added to the HTTP request.
741
860
  #
742
861
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
743
862
  #
744
- def add_face_from_url_with_http_info(face_list_id, url, user_data:nil, target_face:nil, custom_headers:nil)
745
- add_face_from_url_async(face_list_id, url, user_data:user_data, target_face:target_face, custom_headers:custom_headers).value!
863
+ def add_face_from_url_with_http_info(face_list_id, url, user_data:nil, target_face:nil, detection_model:nil, custom_headers:nil)
864
+ add_face_from_url_async(face_list_id, url, user_data:user_data, target_face:target_face, detection_model:detection_model, custom_headers:custom_headers).value!
746
865
  end
747
866
 
748
867
  #
749
- # Add a face to a face list. The input face is specified as an image with a
750
- # targetFace rectangle. It returns a persistedFaceId representing the added
751
- # face, and persistedFaceId will not expire.
868
+ # Add a face to a specified face list, up to 1,000 faces.
869
+ # <br /> To deal with an image contains multiple faces, input face can be
870
+ # specified as an image with a targetFace rectangle. It returns a
871
+ # persistedFaceId representing the added face. No image will be stored. Only
872
+ # the extracted face feature will be stored on server until [FaceList - Delete
873
+ # Face](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395251)
874
+ # or [FaceList -
875
+ # Delete](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039524f)
876
+ # is called.
877
+ # <br /> Note persistedFaceId is different from faceId generated by [Face -
878
+ # Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236).
879
+ # * Higher face image quality means better detection and recognition precision.
880
+ # Please consider high-quality faces: frontal, clear, and face size is 200x200
881
+ # pixels (100 pixels between eyes) or bigger.
882
+ # * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed
883
+ # image file size is from 1KB to 6MB.
884
+ # * "targetFace" rectangle should contain one face. Zero or multiple faces will
885
+ # be regarded as an error. If the provided "targetFace" rectangle is not
886
+ # returned from [Face -
887
+ # Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236),
888
+ # there’s no guarantee to detect and add the face successfully.
889
+ # * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or
890
+ # large occlusions will cause failures.
891
+ # * Adding/deleting faces to/from a same face list are processed sequentially
892
+ # and to/from different face lists are in parallel.
893
+ # * The minimum detectable face size is 36x36 pixels in an image no larger than
894
+ # 1920x1080 pixels. Images with dimensions higher than 1920x1080 pixels will
895
+ # need a proportionally larger minimum face size.
896
+ # * Different 'detectionModel' values can be provided. To use and compare
897
+ # different detection models, please refer to [How to specify a detection
898
+ # model](https://docs.microsoft.com/en-us/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model)
899
+ # | Model | Recommended use-case(s) |
900
+ # | ---------- | -------- |
901
+ # | 'detection_01': | The default detection model for [FaceList - Add
902
+ # Face](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395250).
903
+ # Recommend for near frontal face detection. For scenarios with exceptionally
904
+ # large angle (head-pose) faces, occluded faces or wrong image orientation, the
905
+ # faces in such cases may not be detected. |
906
+ # | 'detection_02': | Detection model released in 2019 May with improved
907
+ # accuracy especially on small, side and blurry faces. |
752
908
  #
753
909
  # @param face_list_id [String] Id referencing a particular face list.
754
910
  # @param url [String] Publicly reachable URL of an image
@@ -760,12 +916,18 @@ module Azure::CognitiveServices::Face::V1_0
760
916
  # is more than one face in the image, targetFace is required to specify which
761
917
  # face to add. No targetFace means there is only one face detected in the
762
918
  # entire image.
919
+ # @param detection_model [DetectionModel] Name of detection model. Detection
920
+ # model is used to detect faces in the submitted image. A detection model name
921
+ # can be provided when performing Face - Detect or (Large)FaceList - Add Face
922
+ # or (Large)PersonGroup - Add Face. The default value is 'detection_01', if
923
+ # another model is needed, please explicitly specify it. Possible values
924
+ # include: 'detection_01', 'detection_02'
763
925
  # @param [Hash{String => String}] A hash of custom headers that will be added
764
926
  # to the HTTP request.
765
927
  #
766
928
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
767
929
  #
768
- def add_face_from_url_async(face_list_id, url, user_data:nil, target_face:nil, custom_headers:nil)
930
+ def add_face_from_url_async(face_list_id, url, user_data:nil, target_face:nil, detection_model:nil, custom_headers:nil)
769
931
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
770
932
  fail ArgumentError, 'face_list_id is nil' if face_list_id.nil?
771
933
  fail ArgumentError, "'face_list_id' should satisfy the constraint - 'MaxLength': '64'" if !face_list_id.nil? && face_list_id.length > 64
@@ -798,7 +960,7 @@ module Azure::CognitiveServices::Face::V1_0
798
960
  options = {
799
961
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
800
962
  path_params: {'faceListId' => face_list_id},
801
- query_params: {'userData' => user_data,'targetFace' => target_face.nil? ? nil : target_face.join(',')},
963
+ query_params: {'userData' => user_data,'targetFace' => target_face.nil? ? nil : target_face.join(','),'detectionModel' => detection_model},
802
964
  body: request_content,
803
965
  headers: request_headers.merge(custom_headers || {}),
804
966
  base_url: request_url
@@ -815,6 +977,8 @@ module Azure::CognitiveServices::Face::V1_0
815
977
  end
816
978
 
817
979
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
980
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
981
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
818
982
  # Deserialize Response
819
983
  if status_code == 200
820
984
  begin
@@ -833,9 +997,46 @@ module Azure::CognitiveServices::Face::V1_0
833
997
  end
834
998
 
835
999
  #
836
- # Add a face to a face list. The input face is specified as an image with a
837
- # targetFace rectangle. It returns a persistedFaceId representing the added
838
- # face, and persistedFaceId will not expire.
1000
+ # Add a face to a specified face list, up to 1,000 faces.
1001
+ # <br /> To deal with an image contains multiple faces, input face can be
1002
+ # specified as an image with a targetFace rectangle. It returns a
1003
+ # persistedFaceId representing the added face. No image will be stored. Only
1004
+ # the extracted face feature will be stored on server until [FaceList - Delete
1005
+ # Face](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395251)
1006
+ # or [FaceList -
1007
+ # Delete](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039524f)
1008
+ # is called.
1009
+ # <br /> Note persistedFaceId is different from faceId generated by [Face -
1010
+ # Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236).
1011
+ # * Higher face image quality means better detection and recognition precision.
1012
+ # Please consider high-quality faces: frontal, clear, and face size is 200x200
1013
+ # pixels (100 pixels between eyes) or bigger.
1014
+ # * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed
1015
+ # image file size is from 1KB to 6MB.
1016
+ # * "targetFace" rectangle should contain one face. Zero or multiple faces will
1017
+ # be regarded as an error. If the provided "targetFace" rectangle is not
1018
+ # returned from [Face -
1019
+ # Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236),
1020
+ # there’s no guarantee to detect and add the face successfully.
1021
+ # * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or
1022
+ # large occlusions will cause failures.
1023
+ # * Adding/deleting faces to/from a same face list are processed sequentially
1024
+ # and to/from different face lists are in parallel.
1025
+ # * The minimum detectable face size is 36x36 pixels in an image no larger than
1026
+ # 1920x1080 pixels. Images with dimensions higher than 1920x1080 pixels will
1027
+ # need a proportionally larger minimum face size.
1028
+ # * Different 'detectionModel' values can be provided. To use and compare
1029
+ # different detection models, please refer to [How to specify a detection
1030
+ # model](https://docs.microsoft.com/en-us/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model)
1031
+ # | Model | Recommended use-case(s) |
1032
+ # | ---------- | -------- |
1033
+ # | 'detection_01': | The default detection model for [FaceList - Add
1034
+ # Face](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395250).
1035
+ # Recommend for near frontal face detection. For scenarios with exceptionally
1036
+ # large angle (head-pose) faces, occluded faces or wrong image orientation, the
1037
+ # faces in such cases may not be detected. |
1038
+ # | 'detection_02': | Detection model released in 2019 May with improved
1039
+ # accuracy especially on small, side and blurry faces. |
839
1040
  #
840
1041
  # @param face_list_id [String] Id referencing a particular face list.
841
1042
  # @param image An image stream.
@@ -847,20 +1048,63 @@ module Azure::CognitiveServices::Face::V1_0
847
1048
  # is more than one face in the image, targetFace is required to specify which
848
1049
  # face to add. No targetFace means there is only one face detected in the
849
1050
  # entire image.
1051
+ # @param detection_model [DetectionModel] Name of detection model. Detection
1052
+ # model is used to detect faces in the submitted image. A detection model name
1053
+ # can be provided when performing Face - Detect or (Large)FaceList - Add Face
1054
+ # or (Large)PersonGroup - Add Face. The default value is 'detection_01', if
1055
+ # another model is needed, please explicitly specify it. Possible values
1056
+ # include: 'detection_01', 'detection_02'
850
1057
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
851
1058
  # will be added to the HTTP request.
852
1059
  #
853
1060
  # @return [PersistedFace] operation results.
854
1061
  #
855
- def add_face_from_stream(face_list_id, image, user_data:nil, target_face:nil, custom_headers:nil)
856
- response = add_face_from_stream_async(face_list_id, image, user_data:user_data, target_face:target_face, custom_headers:custom_headers).value!
1062
+ def add_face_from_stream(face_list_id, image, user_data:nil, target_face:nil, detection_model:nil, custom_headers:nil)
1063
+ response = add_face_from_stream_async(face_list_id, image, user_data:user_data, target_face:target_face, detection_model:detection_model, custom_headers:custom_headers).value!
857
1064
  response.body unless response.nil?
858
1065
  end
859
1066
 
860
1067
  #
861
- # Add a face to a face list. The input face is specified as an image with a
862
- # targetFace rectangle. It returns a persistedFaceId representing the added
863
- # face, and persistedFaceId will not expire.
1068
+ # Add a face to a specified face list, up to 1,000 faces.
1069
+ # <br /> To deal with an image contains multiple faces, input face can be
1070
+ # specified as an image with a targetFace rectangle. It returns a
1071
+ # persistedFaceId representing the added face. No image will be stored. Only
1072
+ # the extracted face feature will be stored on server until [FaceList - Delete
1073
+ # Face](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395251)
1074
+ # or [FaceList -
1075
+ # Delete](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039524f)
1076
+ # is called.
1077
+ # <br /> Note persistedFaceId is different from faceId generated by [Face -
1078
+ # Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236).
1079
+ # * Higher face image quality means better detection and recognition precision.
1080
+ # Please consider high-quality faces: frontal, clear, and face size is 200x200
1081
+ # pixels (100 pixels between eyes) or bigger.
1082
+ # * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed
1083
+ # image file size is from 1KB to 6MB.
1084
+ # * "targetFace" rectangle should contain one face. Zero or multiple faces will
1085
+ # be regarded as an error. If the provided "targetFace" rectangle is not
1086
+ # returned from [Face -
1087
+ # Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236),
1088
+ # there’s no guarantee to detect and add the face successfully.
1089
+ # * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or
1090
+ # large occlusions will cause failures.
1091
+ # * Adding/deleting faces to/from a same face list are processed sequentially
1092
+ # and to/from different face lists are in parallel.
1093
+ # * The minimum detectable face size is 36x36 pixels in an image no larger than
1094
+ # 1920x1080 pixels. Images with dimensions higher than 1920x1080 pixels will
1095
+ # need a proportionally larger minimum face size.
1096
+ # * Different 'detectionModel' values can be provided. To use and compare
1097
+ # different detection models, please refer to [How to specify a detection
1098
+ # model](https://docs.microsoft.com/en-us/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model)
1099
+ # | Model | Recommended use-case(s) |
1100
+ # | ---------- | -------- |
1101
+ # | 'detection_01': | The default detection model for [FaceList - Add
1102
+ # Face](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395250).
1103
+ # Recommend for near frontal face detection. For scenarios with exceptionally
1104
+ # large angle (head-pose) faces, occluded faces or wrong image orientation, the
1105
+ # faces in such cases may not be detected. |
1106
+ # | 'detection_02': | Detection model released in 2019 May with improved
1107
+ # accuracy especially on small, side and blurry faces. |
864
1108
  #
865
1109
  # @param face_list_id [String] Id referencing a particular face list.
866
1110
  # @param image An image stream.
@@ -872,19 +1116,62 @@ module Azure::CognitiveServices::Face::V1_0
872
1116
  # is more than one face in the image, targetFace is required to specify which
873
1117
  # face to add. No targetFace means there is only one face detected in the
874
1118
  # entire image.
1119
+ # @param detection_model [DetectionModel] Name of detection model. Detection
1120
+ # model is used to detect faces in the submitted image. A detection model name
1121
+ # can be provided when performing Face - Detect or (Large)FaceList - Add Face
1122
+ # or (Large)PersonGroup - Add Face. The default value is 'detection_01', if
1123
+ # another model is needed, please explicitly specify it. Possible values
1124
+ # include: 'detection_01', 'detection_02'
875
1125
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
876
1126
  # will be added to the HTTP request.
877
1127
  #
878
1128
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
879
1129
  #
880
- def add_face_from_stream_with_http_info(face_list_id, image, user_data:nil, target_face:nil, custom_headers:nil)
881
- add_face_from_stream_async(face_list_id, image, user_data:user_data, target_face:target_face, custom_headers:custom_headers).value!
1130
+ def add_face_from_stream_with_http_info(face_list_id, image, user_data:nil, target_face:nil, detection_model:nil, custom_headers:nil)
1131
+ add_face_from_stream_async(face_list_id, image, user_data:user_data, target_face:target_face, detection_model:detection_model, custom_headers:custom_headers).value!
882
1132
  end
883
1133
 
884
1134
  #
885
- # Add a face to a face list. The input face is specified as an image with a
886
- # targetFace rectangle. It returns a persistedFaceId representing the added
887
- # face, and persistedFaceId will not expire.
1135
+ # Add a face to a specified face list, up to 1,000 faces.
1136
+ # <br /> To deal with an image contains multiple faces, input face can be
1137
+ # specified as an image with a targetFace rectangle. It returns a
1138
+ # persistedFaceId representing the added face. No image will be stored. Only
1139
+ # the extracted face feature will be stored on server until [FaceList - Delete
1140
+ # Face](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395251)
1141
+ # or [FaceList -
1142
+ # Delete](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039524f)
1143
+ # is called.
1144
+ # <br /> Note persistedFaceId is different from faceId generated by [Face -
1145
+ # Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236).
1146
+ # * Higher face image quality means better detection and recognition precision.
1147
+ # Please consider high-quality faces: frontal, clear, and face size is 200x200
1148
+ # pixels (100 pixels between eyes) or bigger.
1149
+ # * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed
1150
+ # image file size is from 1KB to 6MB.
1151
+ # * "targetFace" rectangle should contain one face. Zero or multiple faces will
1152
+ # be regarded as an error. If the provided "targetFace" rectangle is not
1153
+ # returned from [Face -
1154
+ # Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236),
1155
+ # there’s no guarantee to detect and add the face successfully.
1156
+ # * Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or
1157
+ # large occlusions will cause failures.
1158
+ # * Adding/deleting faces to/from a same face list are processed sequentially
1159
+ # and to/from different face lists are in parallel.
1160
+ # * The minimum detectable face size is 36x36 pixels in an image no larger than
1161
+ # 1920x1080 pixels. Images with dimensions higher than 1920x1080 pixels will
1162
+ # need a proportionally larger minimum face size.
1163
+ # * Different 'detectionModel' values can be provided. To use and compare
1164
+ # different detection models, please refer to [How to specify a detection
1165
+ # model](https://docs.microsoft.com/en-us/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model)
1166
+ # | Model | Recommended use-case(s) |
1167
+ # | ---------- | -------- |
1168
+ # | 'detection_01': | The default detection model for [FaceList - Add
1169
+ # Face](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395250).
1170
+ # Recommend for near frontal face detection. For scenarios with exceptionally
1171
+ # large angle (head-pose) faces, occluded faces or wrong image orientation, the
1172
+ # faces in such cases may not be detected. |
1173
+ # | 'detection_02': | Detection model released in 2019 May with improved
1174
+ # accuracy especially on small, side and blurry faces. |
888
1175
  #
889
1176
  # @param face_list_id [String] Id referencing a particular face list.
890
1177
  # @param image An image stream.
@@ -896,12 +1183,18 @@ module Azure::CognitiveServices::Face::V1_0
896
1183
  # is more than one face in the image, targetFace is required to specify which
897
1184
  # face to add. No targetFace means there is only one face detected in the
898
1185
  # entire image.
1186
+ # @param detection_model [DetectionModel] Name of detection model. Detection
1187
+ # model is used to detect faces in the submitted image. A detection model name
1188
+ # can be provided when performing Face - Detect or (Large)FaceList - Add Face
1189
+ # or (Large)PersonGroup - Add Face. The default value is 'detection_01', if
1190
+ # another model is needed, please explicitly specify it. Possible values
1191
+ # include: 'detection_01', 'detection_02'
899
1192
  # @param [Hash{String => String}] A hash of custom headers that will be added
900
1193
  # to the HTTP request.
901
1194
  #
902
1195
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
903
1196
  #
904
- def add_face_from_stream_async(face_list_id, image, user_data:nil, target_face:nil, custom_headers:nil)
1197
+ def add_face_from_stream_async(face_list_id, image, user_data:nil, target_face:nil, detection_model:nil, custom_headers:nil)
905
1198
  fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
906
1199
  fail ArgumentError, 'face_list_id is nil' if face_list_id.nil?
907
1200
  fail ArgumentError, "'face_list_id' should satisfy the constraint - 'MaxLength': '64'" if !face_list_id.nil? && face_list_id.length > 64
@@ -936,7 +1229,7 @@ module Azure::CognitiveServices::Face::V1_0
936
1229
  options = {
937
1230
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
938
1231
  path_params: {'faceListId' => face_list_id},
939
- query_params: {'userData' => user_data,'targetFace' => target_face.nil? ? nil : target_face.join(',')},
1232
+ query_params: {'userData' => user_data,'targetFace' => target_face.nil? ? nil : target_face.join(','),'detectionModel' => detection_model},
940
1233
  body: request_content,
941
1234
  headers: request_headers.merge(custom_headers || {}),
942
1235
  base_url: request_url
@@ -953,6 +1246,8 @@ module Azure::CognitiveServices::Face::V1_0
953
1246
  end
954
1247
 
955
1248
  result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
1249
+ result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
1250
+ result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
956
1251
  # Deserialize Response
957
1252
  if status_code == 200
958
1253
  begin