azure_cognitiveservices_face 0.17.1 → 0.18.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.
Files changed (38) hide show
  1. checksums.yaml +4 -4
  2. data/lib/1.0/generated/azure_cognitiveservices_face.rb +38 -22
  3. data/lib/1.0/generated/azure_cognitiveservices_face/face.rb +554 -77
  4. data/lib/1.0/generated/azure_cognitiveservices_face/face_client.rb +24 -5
  5. data/lib/1.0/generated/azure_cognitiveservices_face/face_list_operations.rb +169 -36
  6. data/lib/1.0/generated/azure_cognitiveservices_face/large_face_list_operations.rb +1559 -0
  7. data/lib/1.0/generated/azure_cognitiveservices_face/large_person_group_operations.rb +854 -0
  8. data/lib/1.0/generated/azure_cognitiveservices_face/large_person_group_person.rb +1151 -0
  9. data/lib/1.0/generated/azure_cognitiveservices_face/models/apply_snapshot_request.rb +69 -0
  10. data/lib/1.0/generated/azure_cognitiveservices_face/models/detected_face.rb +13 -0
  11. data/lib/1.0/generated/azure_cognitiveservices_face/models/face_attributes.rb +1 -1
  12. data/lib/1.0/generated/azure_cognitiveservices_face/models/face_list.rb +10 -1
  13. data/lib/1.0/generated/azure_cognitiveservices_face/models/find_similar_request.rb +23 -1
  14. data/lib/1.0/generated/azure_cognitiveservices_face/models/gender.rb +0 -1
  15. data/lib/1.0/generated/azure_cognitiveservices_face/models/identify_request.rb +34 -16
  16. data/lib/1.0/generated/azure_cognitiveservices_face/models/large_face_list.rb +81 -0
  17. data/lib/1.0/generated/azure_cognitiveservices_face/models/large_person_group.rb +81 -0
  18. data/lib/1.0/generated/azure_cognitiveservices_face/models/meta_data_contract.rb +72 -0
  19. data/lib/1.0/generated/azure_cognitiveservices_face/models/name_and_user_data_contract.rb +1 -1
  20. data/lib/1.0/generated/azure_cognitiveservices_face/models/operation_status.rb +112 -0
  21. data/lib/1.0/generated/azure_cognitiveservices_face/models/operation_status_type.rb +18 -0
  22. data/lib/1.0/generated/azure_cognitiveservices_face/models/person_group.rb +11 -2
  23. data/lib/1.0/generated/azure_cognitiveservices_face/models/recognition_model.rb +16 -0
  24. data/lib/1.0/generated/azure_cognitiveservices_face/models/snapshot.rb +136 -0
  25. data/lib/1.0/generated/azure_cognitiveservices_face/models/snapshot_apply_mode.rb +15 -0
  26. data/lib/1.0/generated/azure_cognitiveservices_face/models/snapshot_object_type.rb +18 -0
  27. data/lib/1.0/generated/azure_cognitiveservices_face/models/take_snapshot_request.rb +101 -0
  28. data/lib/1.0/generated/azure_cognitiveservices_face/models/training_status.rb +25 -7
  29. data/lib/1.0/generated/azure_cognitiveservices_face/models/{update_person_face_request.rb → update_face_request.rb} +5 -5
  30. data/lib/1.0/generated/azure_cognitiveservices_face/models/update_snapshot_request.rb +73 -0
  31. data/lib/1.0/generated/azure_cognitiveservices_face/models/verify_face_to_face_request.rb +1 -1
  32. data/lib/1.0/generated/azure_cognitiveservices_face/models/verify_face_to_person_request.rb +27 -7
  33. data/lib/1.0/generated/azure_cognitiveservices_face/person_group_operations.rb +203 -34
  34. data/lib/1.0/generated/azure_cognitiveservices_face/person_group_person.rb +49 -29
  35. data/lib/1.0/generated/azure_cognitiveservices_face/snapshot_operations.rb +969 -0
  36. data/lib/profiles/latest/modules/face_profile_module.rb +125 -69
  37. data/lib/version.rb +1 -1
  38. metadata +19 -3
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA256:
3
- metadata.gz: 60d4c17bdc9e4fa0f0aad579a29c2dec36d78748f456b6095d8b1a1a451b965d
4
- data.tar.gz: 19afdafb88c569c8a0f9f71dec58b9d76e68a916e877405252ee9acc93ccaffe
3
+ metadata.gz: 71a274153c545d2eae6ffe5c0b5e79ad43cd1c7665468d26a6c63049b7617e80
4
+ data.tar.gz: d35f06788ba980f34e47ee8ded48464dadd2f1745ae0398c74ec75508415f80b
5
5
  SHA512:
6
- metadata.gz: b834c6a6e9224db1148887fb7006227492d7f020f055faaeb73db4eb3cb4601e16ee0c240a306e5b82bf036a7c1586457e052342d384cd4af7e37a7ccb912d22
7
- data.tar.gz: 01233859cc3812d2b3b7bab45935db52d8d7a560758a140ed5607e4815df5fd3dd66c50605a0c946462b87ae80522d412636ec45e9fc008c5bad08e53fa471fb
6
+ metadata.gz: 482dbc4d7630a580a635e54726493c68c122e5228b406a251d2e87b77558d17ded8a19df77412d915c54ba276e1de40119000826a441a243bee188cea668b80c
7
+ data.tar.gz: 4fac96b8fd3f64db9274237255226d5c9e075fe1a980e2933109aecad173e879eb7acc31a0f042889627c348012381bc503a2e15ad77431bd4560fd8c8d06899
@@ -24,45 +24,58 @@ module Azure::CognitiveServices::Face::V1_0
24
24
  autoload :PersonGroupPerson, '1.0/generated/azure_cognitiveservices_face/person_group_person.rb'
25
25
  autoload :PersonGroupOperations, '1.0/generated/azure_cognitiveservices_face/person_group_operations.rb'
26
26
  autoload :FaceListOperations, '1.0/generated/azure_cognitiveservices_face/face_list_operations.rb'
27
+ autoload :LargePersonGroupPerson, '1.0/generated/azure_cognitiveservices_face/large_person_group_person.rb'
28
+ autoload :LargePersonGroupOperations, '1.0/generated/azure_cognitiveservices_face/large_person_group_operations.rb'
29
+ autoload :LargeFaceListOperations, '1.0/generated/azure_cognitiveservices_face/large_face_list_operations.rb'
30
+ autoload :SnapshotOperations, '1.0/generated/azure_cognitiveservices_face/snapshot_operations.rb'
27
31
  autoload :FaceClient, '1.0/generated/azure_cognitiveservices_face/face_client.rb'
28
32
 
29
33
  module Models
30
- autoload :FindSimilarRequest, '1.0/generated/azure_cognitiveservices_face/models/find_similar_request.rb'
31
- autoload :Error, '1.0/generated/azure_cognitiveservices_face/models/error.rb'
32
- autoload :SimilarFace, '1.0/generated/azure_cognitiveservices_face/models/similar_face.rb'
33
- autoload :FaceRectangle, '1.0/generated/azure_cognitiveservices_face/models/face_rectangle.rb'
34
- autoload :GroupRequest, '1.0/generated/azure_cognitiveservices_face/models/group_request.rb'
35
- autoload :FaceLandmarks, '1.0/generated/azure_cognitiveservices_face/models/face_landmarks.rb'
36
- autoload :GroupResult, '1.0/generated/azure_cognitiveservices_face/models/group_result.rb'
37
- autoload :HeadPose, '1.0/generated/azure_cognitiveservices_face/models/head_pose.rb'
38
34
  autoload :IdentifyRequest, '1.0/generated/azure_cognitiveservices_face/models/identify_request.rb'
39
- autoload :HairColor, '1.0/generated/azure_cognitiveservices_face/models/hair_color.rb'
35
+ autoload :Error, '1.0/generated/azure_cognitiveservices_face/models/error.rb'
40
36
  autoload :IdentifyCandidate, '1.0/generated/azure_cognitiveservices_face/models/identify_candidate.rb'
41
- autoload :Makeup, '1.0/generated/azure_cognitiveservices_face/models/makeup.rb'
37
+ autoload :FaceRectangle, '1.0/generated/azure_cognitiveservices_face/models/face_rectangle.rb'
42
38
  autoload :IdentifyResult, '1.0/generated/azure_cognitiveservices_face/models/identify_result.rb'
43
- autoload :Accessory, '1.0/generated/azure_cognitiveservices_face/models/accessory.rb'
39
+ autoload :FaceLandmarks, '1.0/generated/azure_cognitiveservices_face/models/face_landmarks.rb'
44
40
  autoload :VerifyFaceToPersonRequest, '1.0/generated/azure_cognitiveservices_face/models/verify_face_to_person_request.rb'
45
- autoload :Exposure, '1.0/generated/azure_cognitiveservices_face/models/exposure.rb'
41
+ autoload :HeadPose, '1.0/generated/azure_cognitiveservices_face/models/head_pose.rb'
46
42
  autoload :VerifyFaceToFaceRequest, '1.0/generated/azure_cognitiveservices_face/models/verify_face_to_face_request.rb'
47
- autoload :FaceAttributes, '1.0/generated/azure_cognitiveservices_face/models/face_attributes.rb'
43
+ autoload :HairColor, '1.0/generated/azure_cognitiveservices_face/models/hair_color.rb'
48
44
  autoload :VerifyResult, '1.0/generated/azure_cognitiveservices_face/models/verify_result.rb'
49
- autoload :APIError, '1.0/generated/azure_cognitiveservices_face/models/apierror.rb'
45
+ autoload :Makeup, '1.0/generated/azure_cognitiveservices_face/models/makeup.rb'
50
46
  autoload :PersistedFace, '1.0/generated/azure_cognitiveservices_face/models/persisted_face.rb'
51
- autoload :FacialHair, '1.0/generated/azure_cognitiveservices_face/models/facial_hair.rb'
52
- autoload :Coordinate, '1.0/generated/azure_cognitiveservices_face/models/coordinate.rb'
53
- autoload :Emotion, '1.0/generated/azure_cognitiveservices_face/models/emotion.rb'
47
+ autoload :Accessory, '1.0/generated/azure_cognitiveservices_face/models/accessory.rb'
48
+ autoload :Hair, '1.0/generated/azure_cognitiveservices_face/models/hair.rb'
54
49
  autoload :Occlusion, '1.0/generated/azure_cognitiveservices_face/models/occlusion.rb'
55
50
  autoload :Noise, '1.0/generated/azure_cognitiveservices_face/models/noise.rb'
56
- autoload :ImageUrl, '1.0/generated/azure_cognitiveservices_face/models/image_url.rb'
57
- autoload :Hair, '1.0/generated/azure_cognitiveservices_face/models/hair.rb'
58
- autoload :NameAndUserDataContract, '1.0/generated/azure_cognitiveservices_face/models/name_and_user_data_contract.rb'
59
- autoload :DetectedFace, '1.0/generated/azure_cognitiveservices_face/models/detected_face.rb'
60
- autoload :UpdatePersonFaceRequest, '1.0/generated/azure_cognitiveservices_face/models/update_person_face_request.rb'
61
51
  autoload :Blur, '1.0/generated/azure_cognitiveservices_face/models/blur.rb'
52
+ autoload :DetectedFace, '1.0/generated/azure_cognitiveservices_face/models/detected_face.rb'
53
+ autoload :SimilarFace, '1.0/generated/azure_cognitiveservices_face/models/similar_face.rb'
54
+ autoload :ImageUrl, '1.0/generated/azure_cognitiveservices_face/models/image_url.rb'
55
+ autoload :GroupResult, '1.0/generated/azure_cognitiveservices_face/models/group_result.rb'
56
+ autoload :OperationStatus, '1.0/generated/azure_cognitiveservices_face/models/operation_status.rb'
57
+ autoload :Coordinate, '1.0/generated/azure_cognitiveservices_face/models/coordinate.rb'
58
+ autoload :UpdateSnapshotRequest, '1.0/generated/azure_cognitiveservices_face/models/update_snapshot_request.rb'
59
+ autoload :Emotion, '1.0/generated/azure_cognitiveservices_face/models/emotion.rb'
60
+ autoload :TakeSnapshotRequest, '1.0/generated/azure_cognitiveservices_face/models/take_snapshot_request.rb'
61
+ autoload :FaceAttributes, '1.0/generated/azure_cognitiveservices_face/models/face_attributes.rb'
62
+ autoload :UpdateFaceRequest, '1.0/generated/azure_cognitiveservices_face/models/update_face_request.rb'
63
+ autoload :GroupRequest, '1.0/generated/azure_cognitiveservices_face/models/group_request.rb'
62
64
  autoload :TrainingStatus, '1.0/generated/azure_cognitiveservices_face/models/training_status.rb'
65
+ autoload :FacialHair, '1.0/generated/azure_cognitiveservices_face/models/facial_hair.rb'
66
+ autoload :NameAndUserDataContract, '1.0/generated/azure_cognitiveservices_face/models/name_and_user_data_contract.rb'
67
+ autoload :FindSimilarRequest, '1.0/generated/azure_cognitiveservices_face/models/find_similar_request.rb'
68
+ autoload :APIError, '1.0/generated/azure_cognitiveservices_face/models/apierror.rb'
69
+ autoload :Snapshot, '1.0/generated/azure_cognitiveservices_face/models/snapshot.rb'
70
+ autoload :Exposure, '1.0/generated/azure_cognitiveservices_face/models/exposure.rb'
71
+ autoload :ApplySnapshotRequest, '1.0/generated/azure_cognitiveservices_face/models/apply_snapshot_request.rb'
72
+ autoload :MetaDataContract, '1.0/generated/azure_cognitiveservices_face/models/meta_data_contract.rb'
63
73
  autoload :FaceList, '1.0/generated/azure_cognitiveservices_face/models/face_list.rb'
64
74
  autoload :PersonGroup, '1.0/generated/azure_cognitiveservices_face/models/person_group.rb'
65
75
  autoload :Person, '1.0/generated/azure_cognitiveservices_face/models/person.rb'
76
+ autoload :LargeFaceList, '1.0/generated/azure_cognitiveservices_face/models/large_face_list.rb'
77
+ autoload :LargePersonGroup, '1.0/generated/azure_cognitiveservices_face/models/large_person_group.rb'
78
+ autoload :RecognitionModel, '1.0/generated/azure_cognitiveservices_face/models/recognition_model.rb'
66
79
  autoload :Gender, '1.0/generated/azure_cognitiveservices_face/models/gender.rb'
67
80
  autoload :GlassesType, '1.0/generated/azure_cognitiveservices_face/models/glasses_type.rb'
68
81
  autoload :HairColorType, '1.0/generated/azure_cognitiveservices_face/models/hair_color_type.rb'
@@ -72,6 +85,9 @@ module Azure::CognitiveServices::Face::V1_0
72
85
  autoload :NoiseLevel, '1.0/generated/azure_cognitiveservices_face/models/noise_level.rb'
73
86
  autoload :FindSimilarMatchMode, '1.0/generated/azure_cognitiveservices_face/models/find_similar_match_mode.rb'
74
87
  autoload :TrainingStatusType, '1.0/generated/azure_cognitiveservices_face/models/training_status_type.rb'
88
+ autoload :SnapshotApplyMode, '1.0/generated/azure_cognitiveservices_face/models/snapshot_apply_mode.rb'
89
+ autoload :SnapshotObjectType, '1.0/generated/azure_cognitiveservices_face/models/snapshot_object_type.rb'
90
+ autoload :OperationStatusType, '1.0/generated/azure_cognitiveservices_face/models/operation_status_type.rb'
75
91
  autoload :FaceAttributeType, '1.0/generated/azure_cognitiveservices_face/models/face_attribute_type.rb'
76
92
  end
77
93
  end
@@ -22,8 +22,31 @@ module Azure::CognitiveServices::Face::V1_0
22
22
  attr_reader :client
23
23
 
24
24
  #
25
- # Given query face's faceId, find the similar-looking faces from a faceId array
26
- # or a faceListId.
25
+ # Given query face's faceId, to search the similar-looking faces from a faceId
26
+ # array, a face list or a large face list. faceId array contains the faces
27
+ # created by [Face -
28
+ # Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236),
29
+ # which will expire 24 hours after creation. A "faceListId" is created by
30
+ # [FaceList -
31
+ # Create](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039524b)
32
+ # containing persistedFaceIds that will not expire. And a "largeFaceListId" is
33
+ # created by [LargeFaceList -
34
+ # Create](/docs/services/563879b61984550e40cbbe8d/operations/5a157b68d2de3616c086f2cc)
35
+ # containing persistedFaceIds that will also not expire. Depending on the input
36
+ # the returned similar faces list contains faceIds or persistedFaceIds ranked
37
+ # by similarity.
38
+ # <br/>Find similar has two working modes, "matchPerson" and "matchFace".
39
+ # "matchPerson" is the default mode that it tries to find faces of the same
40
+ # person as possible by using internal same-person thresholds. It is useful to
41
+ # find a known person's other photos. Note that an empty list will be returned
42
+ # if no faces pass the internal thresholds. "matchFace" mode ignores
43
+ # same-person thresholds and returns ranked similar faces anyway, even the
44
+ # similarity is low. It can be used in the cases like searching
45
+ # celebrity-looking faces.
46
+ # <br/>The 'recognitionModel' associated with the query face's faceId should be
47
+ # the same as the 'recognitionModel' used by the target faceId array, face list
48
+ # or large face list.
49
+ #
27
50
  #
28
51
  # @param face_id FaceId of the query face. User needs to call Face - Detect
29
52
  # first to get a valid faceId. Note that this faceId is not persisted and will
@@ -31,9 +54,17 @@ module Azure::CognitiveServices::Face::V1_0
31
54
  # @param face_list_id [String] An existing user-specified unique candidate face
32
55
  # list, created in Face List - Create a Face List. Face list contains a set of
33
56
  # persistedFaceIds which are persisted and will never expire. Parameter
34
- # faceListId and faceIds should not be provided at the same time
57
+ # faceListId, largeFaceListId and faceIds should not be provided at the same
58
+ # time.
59
+ # @param large_face_list_id [String] An existing user-specified unique
60
+ # candidate large face list, created in LargeFaceList - Create. Large face list
61
+ # contains a set of persistedFaceIds which are persisted and will never expire.
62
+ # Parameter faceListId, largeFaceListId and faceIds should not be provided at
63
+ # the same time.
35
64
  # @param face_ids An array of candidate faceIds. All of them are created by
36
65
  # Face - Detect and the faceIds will expire 24 hours after the detection call.
66
+ # The number of faceIds is limited to 1000. Parameter faceListId,
67
+ # largeFaceListId and faceIds should not be provided at the same time.
37
68
  # @param max_num_of_candidates_returned [Integer] The number of top similar
38
69
  # faces returned. The valid range is [1, 1000].
39
70
  # @param mode [FindSimilarMatchMode] Similar face searching mode. It can be
@@ -44,14 +75,37 @@ module Azure::CognitiveServices::Face::V1_0
44
75
  #
45
76
  # @return [Array] operation results.
46
77
  #
47
- def find_similar(face_id, face_list_id:nil, face_ids:nil, max_num_of_candidates_returned:20, mode:nil, custom_headers:nil)
48
- response = find_similar_async(face_id, face_list_id:face_list_id, face_ids:face_ids, max_num_of_candidates_returned:max_num_of_candidates_returned, mode:mode, custom_headers:custom_headers).value!
78
+ def find_similar(face_id, face_list_id:nil, large_face_list_id:nil, face_ids:nil, max_num_of_candidates_returned:20, mode:nil, custom_headers:nil)
79
+ response = find_similar_async(face_id, face_list_id:face_list_id, large_face_list_id:large_face_list_id, face_ids:face_ids, max_num_of_candidates_returned:max_num_of_candidates_returned, mode:mode, custom_headers:custom_headers).value!
49
80
  response.body unless response.nil?
50
81
  end
51
82
 
52
83
  #
53
- # Given query face's faceId, find the similar-looking faces from a faceId array
54
- # or a faceListId.
84
+ # Given query face's faceId, to search the similar-looking faces from a faceId
85
+ # array, a face list or a large face list. faceId array contains the faces
86
+ # created by [Face -
87
+ # Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236),
88
+ # which will expire 24 hours after creation. A "faceListId" is created by
89
+ # [FaceList -
90
+ # Create](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039524b)
91
+ # containing persistedFaceIds that will not expire. And a "largeFaceListId" is
92
+ # created by [LargeFaceList -
93
+ # Create](/docs/services/563879b61984550e40cbbe8d/operations/5a157b68d2de3616c086f2cc)
94
+ # containing persistedFaceIds that will also not expire. Depending on the input
95
+ # the returned similar faces list contains faceIds or persistedFaceIds ranked
96
+ # by similarity.
97
+ # <br/>Find similar has two working modes, "matchPerson" and "matchFace".
98
+ # "matchPerson" is the default mode that it tries to find faces of the same
99
+ # person as possible by using internal same-person thresholds. It is useful to
100
+ # find a known person's other photos. Note that an empty list will be returned
101
+ # if no faces pass the internal thresholds. "matchFace" mode ignores
102
+ # same-person thresholds and returns ranked similar faces anyway, even the
103
+ # similarity is low. It can be used in the cases like searching
104
+ # celebrity-looking faces.
105
+ # <br/>The 'recognitionModel' associated with the query face's faceId should be
106
+ # the same as the 'recognitionModel' used by the target faceId array, face list
107
+ # or large face list.
108
+ #
55
109
  #
56
110
  # @param face_id FaceId of the query face. User needs to call Face - Detect
57
111
  # first to get a valid faceId. Note that this faceId is not persisted and will
@@ -59,9 +113,17 @@ module Azure::CognitiveServices::Face::V1_0
59
113
  # @param face_list_id [String] An existing user-specified unique candidate face
60
114
  # list, created in Face List - Create a Face List. Face list contains a set of
61
115
  # persistedFaceIds which are persisted and will never expire. Parameter
62
- # faceListId and faceIds should not be provided at the same time
116
+ # faceListId, largeFaceListId and faceIds should not be provided at the same
117
+ # time.
118
+ # @param large_face_list_id [String] An existing user-specified unique
119
+ # candidate large face list, created in LargeFaceList - Create. Large face list
120
+ # contains a set of persistedFaceIds which are persisted and will never expire.
121
+ # Parameter faceListId, largeFaceListId and faceIds should not be provided at
122
+ # the same time.
63
123
  # @param face_ids An array of candidate faceIds. All of them are created by
64
124
  # Face - Detect and the faceIds will expire 24 hours after the detection call.
125
+ # The number of faceIds is limited to 1000. Parameter faceListId,
126
+ # largeFaceListId and faceIds should not be provided at the same time.
65
127
  # @param max_num_of_candidates_returned [Integer] The number of top similar
66
128
  # faces returned. The valid range is [1, 1000].
67
129
  # @param mode [FindSimilarMatchMode] Similar face searching mode. It can be
@@ -72,13 +134,36 @@ module Azure::CognitiveServices::Face::V1_0
72
134
  #
73
135
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
74
136
  #
75
- def find_similar_with_http_info(face_id, face_list_id:nil, face_ids:nil, max_num_of_candidates_returned:20, mode:nil, custom_headers:nil)
76
- find_similar_async(face_id, face_list_id:face_list_id, face_ids:face_ids, max_num_of_candidates_returned:max_num_of_candidates_returned, mode:mode, custom_headers:custom_headers).value!
137
+ def find_similar_with_http_info(face_id, face_list_id:nil, large_face_list_id:nil, face_ids:nil, max_num_of_candidates_returned:20, mode:nil, custom_headers:nil)
138
+ find_similar_async(face_id, face_list_id:face_list_id, large_face_list_id:large_face_list_id, face_ids:face_ids, max_num_of_candidates_returned:max_num_of_candidates_returned, mode:mode, custom_headers:custom_headers).value!
77
139
  end
78
140
 
79
141
  #
80
- # Given query face's faceId, find the similar-looking faces from a faceId array
81
- # or a faceListId.
142
+ # Given query face's faceId, to search the similar-looking faces from a faceId
143
+ # array, a face list or a large face list. faceId array contains the faces
144
+ # created by [Face -
145
+ # Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236),
146
+ # which will expire 24 hours after creation. A "faceListId" is created by
147
+ # [FaceList -
148
+ # Create](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039524b)
149
+ # containing persistedFaceIds that will not expire. And a "largeFaceListId" is
150
+ # created by [LargeFaceList -
151
+ # Create](/docs/services/563879b61984550e40cbbe8d/operations/5a157b68d2de3616c086f2cc)
152
+ # containing persistedFaceIds that will also not expire. Depending on the input
153
+ # the returned similar faces list contains faceIds or persistedFaceIds ranked
154
+ # by similarity.
155
+ # <br/>Find similar has two working modes, "matchPerson" and "matchFace".
156
+ # "matchPerson" is the default mode that it tries to find faces of the same
157
+ # person as possible by using internal same-person thresholds. It is useful to
158
+ # find a known person's other photos. Note that an empty list will be returned
159
+ # if no faces pass the internal thresholds. "matchFace" mode ignores
160
+ # same-person thresholds and returns ranked similar faces anyway, even the
161
+ # similarity is low. It can be used in the cases like searching
162
+ # celebrity-looking faces.
163
+ # <br/>The 'recognitionModel' associated with the query face's faceId should be
164
+ # the same as the 'recognitionModel' used by the target faceId array, face list
165
+ # or large face list.
166
+ #
82
167
  #
83
168
  # @param face_id FaceId of the query face. User needs to call Face - Detect
84
169
  # first to get a valid faceId. Note that this faceId is not persisted and will
@@ -86,9 +171,17 @@ module Azure::CognitiveServices::Face::V1_0
86
171
  # @param face_list_id [String] An existing user-specified unique candidate face
87
172
  # list, created in Face List - Create a Face List. Face list contains a set of
88
173
  # persistedFaceIds which are persisted and will never expire. Parameter
89
- # faceListId and faceIds should not be provided at the same time
174
+ # faceListId, largeFaceListId and faceIds should not be provided at the same
175
+ # time.
176
+ # @param large_face_list_id [String] An existing user-specified unique
177
+ # candidate large face list, created in LargeFaceList - Create. Large face list
178
+ # contains a set of persistedFaceIds which are persisted and will never expire.
179
+ # Parameter faceListId, largeFaceListId and faceIds should not be provided at
180
+ # the same time.
90
181
  # @param face_ids An array of candidate faceIds. All of them are created by
91
182
  # Face - Detect and the faceIds will expire 24 hours after the detection call.
183
+ # The number of faceIds is limited to 1000. Parameter faceListId,
184
+ # largeFaceListId and faceIds should not be provided at the same time.
92
185
  # @param max_num_of_candidates_returned [Integer] The number of top similar
93
186
  # faces returned. The valid range is [1, 1000].
94
187
  # @param mode [FindSimilarMatchMode] Similar face searching mode. It can be
@@ -99,18 +192,22 @@ module Azure::CognitiveServices::Face::V1_0
99
192
  #
100
193
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
101
194
  #
102
- def find_similar_async(face_id, face_list_id:nil, face_ids:nil, max_num_of_candidates_returned:20, mode:nil, custom_headers:nil)
195
+ def find_similar_async(face_id, face_list_id:nil, large_face_list_id:nil, face_ids:nil, max_num_of_candidates_returned:20, mode:nil, custom_headers:nil)
196
+ fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
103
197
  fail ArgumentError, 'face_id is nil' if face_id.nil?
104
198
  fail ArgumentError, "'face_list_id' should satisfy the constraint - 'MaxLength': '64'" if !face_list_id.nil? && face_list_id.length > 64
105
199
  fail ArgumentError, "'face_list_id' should satisfy the constraint - 'Pattern': '^[a-z0-9-_]+$'" if !face_list_id.nil? && face_list_id.match(Regexp.new('^^[a-z0-9-_]+$$')).nil?
200
+ fail ArgumentError, "'large_face_list_id' should satisfy the constraint - 'MaxLength': '64'" if !large_face_list_id.nil? && large_face_list_id.length > 64
201
+ fail ArgumentError, "'large_face_list_id' should satisfy the constraint - 'Pattern': '^[a-z0-9-_]+$'" if !large_face_list_id.nil? && large_face_list_id.match(Regexp.new('^^[a-z0-9-_]+$$')).nil?
106
202
  fail ArgumentError, "'face_ids' should satisfy the constraint - 'MaxItems': '1000'" if !face_ids.nil? && face_ids.length > 1000
107
203
  fail ArgumentError, "'max_num_of_candidates_returned' should satisfy the constraint - 'InclusiveMaximum': '1000'" if !max_num_of_candidates_returned.nil? && max_num_of_candidates_returned > 1000
108
204
  fail ArgumentError, "'max_num_of_candidates_returned' should satisfy the constraint - 'InclusiveMinimum': '1'" if !max_num_of_candidates_returned.nil? && max_num_of_candidates_returned < 1
109
205
 
110
206
  body = FindSimilarRequest.new
111
- unless face_id.nil? && face_list_id.nil? && face_ids.nil? && max_num_of_candidates_returned.nil? && mode.nil?
207
+ unless face_id.nil? && face_list_id.nil? && large_face_list_id.nil? && face_ids.nil? && max_num_of_candidates_returned.nil? && mode.nil?
112
208
  body.face_id = face_id
113
209
  body.face_list_id = face_list_id
210
+ body.large_face_list_id = large_face_list_id
114
211
  body.face_ids = face_ids
115
212
  body.max_num_of_candidates_returned = max_num_of_candidates_returned
116
213
  body.mode = mode
@@ -131,6 +228,7 @@ module Azure::CognitiveServices::Face::V1_0
131
228
  path_template = 'findsimilars'
132
229
 
133
230
  request_url = @base_url || @client.base_url
231
+ request_url = request_url.gsub('{Endpoint}', @client.endpoint)
134
232
 
135
233
  options = {
136
234
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
@@ -184,7 +282,21 @@ module Azure::CognitiveServices::Face::V1_0
184
282
  end
185
283
 
186
284
  #
187
- # Divide candidate faces into groups based on face similarity.
285
+ # Divide candidate faces into groups based on face similarity.<br />
286
+ # * The output is one or more disjointed face groups and a messyGroup. A face
287
+ # group contains faces that have similar looking, often of the same person.
288
+ # Face groups are ranked by group size, i.e. number of faces. Notice that faces
289
+ # belonging to a same person might be split into several groups in the result.
290
+ # * MessyGroup is a special face group containing faces that cannot find any
291
+ # similar counterpart face from original faces. The messyGroup will not appear
292
+ # in the result if all faces found their counterparts.
293
+ # * Group API needs at least 2 candidate faces and 1000 at most. We suggest to
294
+ # try [Face -
295
+ # Verify](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039523a)
296
+ # when you only have 2 candidate faces.
297
+ # * The 'recognitionModel' associated with the query faces' faceIds should be
298
+ # the same.
299
+ #
188
300
  #
189
301
  # @param face_ids Array of candidate faceId created by Face - Detect. The
190
302
  # maximum is 1000 faces
@@ -199,7 +311,21 @@ module Azure::CognitiveServices::Face::V1_0
199
311
  end
200
312
 
201
313
  #
202
- # Divide candidate faces into groups based on face similarity.
314
+ # Divide candidate faces into groups based on face similarity.<br />
315
+ # * The output is one or more disjointed face groups and a messyGroup. A face
316
+ # group contains faces that have similar looking, often of the same person.
317
+ # Face groups are ranked by group size, i.e. number of faces. Notice that faces
318
+ # belonging to a same person might be split into several groups in the result.
319
+ # * MessyGroup is a special face group containing faces that cannot find any
320
+ # similar counterpart face from original faces. The messyGroup will not appear
321
+ # in the result if all faces found their counterparts.
322
+ # * Group API needs at least 2 candidate faces and 1000 at most. We suggest to
323
+ # try [Face -
324
+ # Verify](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039523a)
325
+ # when you only have 2 candidate faces.
326
+ # * The 'recognitionModel' associated with the query faces' faceIds should be
327
+ # the same.
328
+ #
203
329
  #
204
330
  # @param face_ids Array of candidate faceId created by Face - Detect. The
205
331
  # maximum is 1000 faces
@@ -213,7 +339,21 @@ module Azure::CognitiveServices::Face::V1_0
213
339
  end
214
340
 
215
341
  #
216
- # Divide candidate faces into groups based on face similarity.
342
+ # Divide candidate faces into groups based on face similarity.<br />
343
+ # * The output is one or more disjointed face groups and a messyGroup. A face
344
+ # group contains faces that have similar looking, often of the same person.
345
+ # Face groups are ranked by group size, i.e. number of faces. Notice that faces
346
+ # belonging to a same person might be split into several groups in the result.
347
+ # * MessyGroup is a special face group containing faces that cannot find any
348
+ # similar counterpart face from original faces. The messyGroup will not appear
349
+ # in the result if all faces found their counterparts.
350
+ # * Group API needs at least 2 candidate faces and 1000 at most. We suggest to
351
+ # try [Face -
352
+ # Verify](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039523a)
353
+ # when you only have 2 candidate faces.
354
+ # * The 'recognitionModel' associated with the query faces' faceIds should be
355
+ # the same.
356
+ #
217
357
  #
218
358
  # @param face_ids Array of candidate faceId created by Face - Detect. The
219
359
  # maximum is 1000 faces
@@ -223,6 +363,7 @@ module Azure::CognitiveServices::Face::V1_0
223
363
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
224
364
  #
225
365
  def group_async(face_ids, custom_headers:nil)
366
+ fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
226
367
  fail ArgumentError, 'face_ids is nil' if face_ids.nil?
227
368
  fail ArgumentError, "'face_ids' should satisfy the constraint - 'MaxItems': '1000'" if !face_ids.nil? && face_ids.length > 1000
228
369
 
@@ -246,6 +387,7 @@ module Azure::CognitiveServices::Face::V1_0
246
387
  path_template = 'group'
247
388
 
248
389
  request_url = @base_url || @client.base_url
390
+ request_url = request_url.gsub('{Endpoint}', @client.endpoint)
249
391
 
250
392
  options = {
251
393
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
@@ -283,13 +425,48 @@ module Azure::CognitiveServices::Face::V1_0
283
425
  end
284
426
 
285
427
  #
286
- # Identify unknown faces from a person group.
428
+ # 1-to-many identification to find the closest matches of the specific query
429
+ # person face from a person group or large person group.
430
+ # <br/> For each face in the faceIds array, Face Identify will compute
431
+ # similarities between the query face and all the faces in the person group
432
+ # (given by personGroupId) or large person group (given by largePersonGroupId),
433
+ # and return candidate person(s) for that face ranked by similarity confidence.
434
+ # The person group/large person group should be trained to make it ready for
435
+ # identification. See more in [PersonGroup -
436
+ # Train](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395249)
437
+ # and [LargePersonGroup -
438
+ # Train](/docs/services/563879b61984550e40cbbe8d/operations/599ae2d16ac60f11b48b5aa4).
439
+ # <br/>
440
+ #
441
+ # Remarks:<br />
442
+ # * The algorithm allows more than one face to be identified independently at
443
+ # the same request, but no more than 10 faces.
444
+ # * Each person in the person group/large person group could have more than one
445
+ # face, but no more than 248 faces.
446
+ # * Higher face image quality means better identification precision. Please
447
+ # consider high-quality faces: frontal, clear, and face size is 200x200 pixels
448
+ # (100 pixels between eyes) or bigger.
449
+ # * Number of candidates returned is restricted by maxNumOfCandidatesReturned
450
+ # and confidenceThreshold. If no person is identified, the returned candidates
451
+ # will be an empty array.
452
+ # * Try [Face - Find
453
+ # Similar](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395237)
454
+ # when you need to find similar faces from a face list/large face list instead
455
+ # of a person group/large person group.
456
+ # * The 'recognitionModel' associated with the query faces' faceIds should be
457
+ # the same as the 'recognitionModel' used by the target person group or large
458
+ # person group.
459
+ #
287
460
  #
288
- # @param person_group_id [String] PersonGroupId of the target person group,
289
- # created by PersonGroups.Create
290
461
  # @param face_ids Array of query faces faceIds, created by the Face - Detect.
291
462
  # Each of the faces are identified independently. The valid number of faceIds
292
463
  # is between [1, 10].
464
+ # @param person_group_id [String] PersonGroupId of the target person group,
465
+ # created by PersonGroup - Create. Parameter personGroupId and
466
+ # largePersonGroupId should not be provided at the same time.
467
+ # @param large_person_group_id [String] LargePersonGroupId of the target large
468
+ # person group, created by LargePersonGroup - Create. Parameter personGroupId
469
+ # and largePersonGroupId should not be provided at the same time.
293
470
  # @param max_num_of_candidates_returned [Integer] The range of
294
471
  # maxNumOfCandidatesReturned is between 1 and 5 (default is 1).
295
472
  # @param confidence_threshold [Float] Confidence threshold of identification,
@@ -300,19 +477,54 @@ module Azure::CognitiveServices::Face::V1_0
300
477
  #
301
478
  # @return [Array] operation results.
302
479
  #
303
- def identify(person_group_id, face_ids, max_num_of_candidates_returned:1, confidence_threshold:nil, custom_headers:nil)
304
- response = identify_async(person_group_id, face_ids, max_num_of_candidates_returned:max_num_of_candidates_returned, confidence_threshold:confidence_threshold, custom_headers:custom_headers).value!
480
+ def identify(face_ids, person_group_id:nil, large_person_group_id:nil, max_num_of_candidates_returned:1, confidence_threshold:nil, custom_headers:nil)
481
+ response = identify_async(face_ids, person_group_id:person_group_id, large_person_group_id:large_person_group_id, max_num_of_candidates_returned:max_num_of_candidates_returned, confidence_threshold:confidence_threshold, custom_headers:custom_headers).value!
305
482
  response.body unless response.nil?
306
483
  end
307
484
 
308
485
  #
309
- # Identify unknown faces from a person group.
486
+ # 1-to-many identification to find the closest matches of the specific query
487
+ # person face from a person group or large person group.
488
+ # <br/> For each face in the faceIds array, Face Identify will compute
489
+ # similarities between the query face and all the faces in the person group
490
+ # (given by personGroupId) or large person group (given by largePersonGroupId),
491
+ # and return candidate person(s) for that face ranked by similarity confidence.
492
+ # The person group/large person group should be trained to make it ready for
493
+ # identification. See more in [PersonGroup -
494
+ # Train](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395249)
495
+ # and [LargePersonGroup -
496
+ # Train](/docs/services/563879b61984550e40cbbe8d/operations/599ae2d16ac60f11b48b5aa4).
497
+ # <br/>
498
+ #
499
+ # Remarks:<br />
500
+ # * The algorithm allows more than one face to be identified independently at
501
+ # the same request, but no more than 10 faces.
502
+ # * Each person in the person group/large person group could have more than one
503
+ # face, but no more than 248 faces.
504
+ # * Higher face image quality means better identification precision. Please
505
+ # consider high-quality faces: frontal, clear, and face size is 200x200 pixels
506
+ # (100 pixels between eyes) or bigger.
507
+ # * Number of candidates returned is restricted by maxNumOfCandidatesReturned
508
+ # and confidenceThreshold. If no person is identified, the returned candidates
509
+ # will be an empty array.
510
+ # * Try [Face - Find
511
+ # Similar](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395237)
512
+ # when you need to find similar faces from a face list/large face list instead
513
+ # of a person group/large person group.
514
+ # * The 'recognitionModel' associated with the query faces' faceIds should be
515
+ # the same as the 'recognitionModel' used by the target person group or large
516
+ # person group.
517
+ #
310
518
  #
311
- # @param person_group_id [String] PersonGroupId of the target person group,
312
- # created by PersonGroups.Create
313
519
  # @param face_ids Array of query faces faceIds, created by the Face - Detect.
314
520
  # Each of the faces are identified independently. The valid number of faceIds
315
521
  # is between [1, 10].
522
+ # @param person_group_id [String] PersonGroupId of the target person group,
523
+ # created by PersonGroup - Create. Parameter personGroupId and
524
+ # largePersonGroupId should not be provided at the same time.
525
+ # @param large_person_group_id [String] LargePersonGroupId of the target large
526
+ # person group, created by LargePersonGroup - Create. Parameter personGroupId
527
+ # and largePersonGroupId should not be provided at the same time.
316
528
  # @param max_num_of_candidates_returned [Integer] The range of
317
529
  # maxNumOfCandidatesReturned is between 1 and 5 (default is 1).
318
530
  # @param confidence_threshold [Float] Confidence threshold of identification,
@@ -323,18 +535,53 @@ module Azure::CognitiveServices::Face::V1_0
323
535
  #
324
536
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
325
537
  #
326
- def identify_with_http_info(person_group_id, face_ids, max_num_of_candidates_returned:1, confidence_threshold:nil, custom_headers:nil)
327
- identify_async(person_group_id, face_ids, max_num_of_candidates_returned:max_num_of_candidates_returned, confidence_threshold:confidence_threshold, custom_headers:custom_headers).value!
538
+ def identify_with_http_info(face_ids, person_group_id:nil, large_person_group_id:nil, max_num_of_candidates_returned:1, confidence_threshold:nil, custom_headers:nil)
539
+ identify_async(face_ids, person_group_id:person_group_id, large_person_group_id:large_person_group_id, max_num_of_candidates_returned:max_num_of_candidates_returned, confidence_threshold:confidence_threshold, custom_headers:custom_headers).value!
328
540
  end
329
541
 
330
542
  #
331
- # Identify unknown faces from a person group.
543
+ # 1-to-many identification to find the closest matches of the specific query
544
+ # person face from a person group or large person group.
545
+ # <br/> For each face in the faceIds array, Face Identify will compute
546
+ # similarities between the query face and all the faces in the person group
547
+ # (given by personGroupId) or large person group (given by largePersonGroupId),
548
+ # and return candidate person(s) for that face ranked by similarity confidence.
549
+ # The person group/large person group should be trained to make it ready for
550
+ # identification. See more in [PersonGroup -
551
+ # Train](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395249)
552
+ # and [LargePersonGroup -
553
+ # Train](/docs/services/563879b61984550e40cbbe8d/operations/599ae2d16ac60f11b48b5aa4).
554
+ # <br/>
555
+ #
556
+ # Remarks:<br />
557
+ # * The algorithm allows more than one face to be identified independently at
558
+ # the same request, but no more than 10 faces.
559
+ # * Each person in the person group/large person group could have more than one
560
+ # face, but no more than 248 faces.
561
+ # * Higher face image quality means better identification precision. Please
562
+ # consider high-quality faces: frontal, clear, and face size is 200x200 pixels
563
+ # (100 pixels between eyes) or bigger.
564
+ # * Number of candidates returned is restricted by maxNumOfCandidatesReturned
565
+ # and confidenceThreshold. If no person is identified, the returned candidates
566
+ # will be an empty array.
567
+ # * Try [Face - Find
568
+ # Similar](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395237)
569
+ # when you need to find similar faces from a face list/large face list instead
570
+ # of a person group/large person group.
571
+ # * The 'recognitionModel' associated with the query faces' faceIds should be
572
+ # the same as the 'recognitionModel' used by the target person group or large
573
+ # person group.
574
+ #
332
575
  #
333
- # @param person_group_id [String] PersonGroupId of the target person group,
334
- # created by PersonGroups.Create
335
576
  # @param face_ids Array of query faces faceIds, created by the Face - Detect.
336
577
  # Each of the faces are identified independently. The valid number of faceIds
337
578
  # is between [1, 10].
579
+ # @param person_group_id [String] PersonGroupId of the target person group,
580
+ # created by PersonGroup - Create. Parameter personGroupId and
581
+ # largePersonGroupId should not be provided at the same time.
582
+ # @param large_person_group_id [String] LargePersonGroupId of the target large
583
+ # person group, created by LargePersonGroup - Create. Parameter personGroupId
584
+ # and largePersonGroupId should not be provided at the same time.
338
585
  # @param max_num_of_candidates_returned [Integer] The range of
339
586
  # maxNumOfCandidatesReturned is between 1 and 5 (default is 1).
340
587
  # @param confidence_threshold [Float] Confidence threshold of identification,
@@ -345,19 +592,22 @@ module Azure::CognitiveServices::Face::V1_0
345
592
  #
346
593
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
347
594
  #
348
- def identify_async(person_group_id, face_ids, max_num_of_candidates_returned:1, confidence_threshold:nil, custom_headers:nil)
349
- fail ArgumentError, 'person_group_id is nil' if person_group_id.nil?
350
- fail ArgumentError, "'person_group_id' should satisfy the constraint - 'MaxLength': '64'" if !person_group_id.nil? && person_group_id.length > 64
351
- fail ArgumentError, "'person_group_id' should satisfy the constraint - 'Pattern': '^[a-z0-9-_]+$'" if !person_group_id.nil? && person_group_id.match(Regexp.new('^^[a-z0-9-_]+$$')).nil?
595
+ def identify_async(face_ids, person_group_id:nil, large_person_group_id:nil, max_num_of_candidates_returned:1, confidence_threshold:nil, custom_headers:nil)
596
+ fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
352
597
  fail ArgumentError, 'face_ids is nil' if face_ids.nil?
353
598
  fail ArgumentError, "'face_ids' should satisfy the constraint - 'MaxItems': '10'" if !face_ids.nil? && face_ids.length > 10
599
+ fail ArgumentError, "'person_group_id' should satisfy the constraint - 'MaxLength': '64'" if !person_group_id.nil? && person_group_id.length > 64
600
+ fail ArgumentError, "'person_group_id' should satisfy the constraint - 'Pattern': '^[a-z0-9-_]+$'" if !person_group_id.nil? && person_group_id.match(Regexp.new('^^[a-z0-9-_]+$$')).nil?
601
+ fail ArgumentError, "'large_person_group_id' should satisfy the constraint - 'MaxLength': '64'" if !large_person_group_id.nil? && large_person_group_id.length > 64
602
+ fail ArgumentError, "'large_person_group_id' should satisfy the constraint - 'Pattern': '^[a-z0-9-_]+$'" if !large_person_group_id.nil? && large_person_group_id.match(Regexp.new('^^[a-z0-9-_]+$$')).nil?
354
603
  fail ArgumentError, "'max_num_of_candidates_returned' should satisfy the constraint - 'InclusiveMaximum': '5'" if !max_num_of_candidates_returned.nil? && max_num_of_candidates_returned > 5
355
604
  fail ArgumentError, "'max_num_of_candidates_returned' should satisfy the constraint - 'InclusiveMinimum': '1'" if !max_num_of_candidates_returned.nil? && max_num_of_candidates_returned < 1
356
605
 
357
606
  body = IdentifyRequest.new
358
- unless person_group_id.nil? && face_ids.nil? && max_num_of_candidates_returned.nil? && confidence_threshold.nil?
359
- body.person_group_id = person_group_id
607
+ unless face_ids.nil? && person_group_id.nil? && large_person_group_id.nil? && max_num_of_candidates_returned.nil? && confidence_threshold.nil?
360
608
  body.face_ids = face_ids
609
+ body.person_group_id = person_group_id
610
+ body.large_person_group_id = large_person_group_id
361
611
  body.max_num_of_candidates_returned = max_num_of_candidates_returned
362
612
  body.confidence_threshold = confidence_threshold
363
613
  end
@@ -377,6 +627,7 @@ module Azure::CognitiveServices::Face::V1_0
377
627
  path_template = 'identify'
378
628
 
379
629
  request_url = @base_url || @client.base_url
630
+ request_url = request_url.gsub('{Endpoint}', @client.endpoint)
380
631
 
381
632
  options = {
382
633
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
@@ -432,6 +683,17 @@ module Azure::CognitiveServices::Face::V1_0
432
683
  #
433
684
  # Verify whether two faces belong to a same person or whether one face belongs
434
685
  # to a person.
686
+ # <br/>
687
+ # Remarks:<br />
688
+ # * Higher face image quality means better identification precision. Please
689
+ # consider high-quality faces: frontal, clear, and face size is 200x200 pixels
690
+ # (100 pixels between eyes) or bigger.
691
+ # * For the scenarios that are sensitive to accuracy please make your own
692
+ # judgment.
693
+ # * The 'recognitionModel' associated with the query faces' faceIds should be
694
+ # the same as the 'recognitionModel' used by the target face, person group or
695
+ # large person group.
696
+ #
435
697
  #
436
698
  # @param face_id1 FaceId of the first face, comes from Face - Detect
437
699
  # @param face_id2 FaceId of the second face, comes from Face - Detect
@@ -448,6 +710,17 @@ module Azure::CognitiveServices::Face::V1_0
448
710
  #
449
711
  # Verify whether two faces belong to a same person or whether one face belongs
450
712
  # to a person.
713
+ # <br/>
714
+ # Remarks:<br />
715
+ # * Higher face image quality means better identification precision. Please
716
+ # consider high-quality faces: frontal, clear, and face size is 200x200 pixels
717
+ # (100 pixels between eyes) or bigger.
718
+ # * For the scenarios that are sensitive to accuracy please make your own
719
+ # judgment.
720
+ # * The 'recognitionModel' associated with the query faces' faceIds should be
721
+ # the same as the 'recognitionModel' used by the target face, person group or
722
+ # large person group.
723
+ #
451
724
  #
452
725
  # @param face_id1 FaceId of the first face, comes from Face - Detect
453
726
  # @param face_id2 FaceId of the second face, comes from Face - Detect
@@ -463,6 +736,17 @@ module Azure::CognitiveServices::Face::V1_0
463
736
  #
464
737
  # Verify whether two faces belong to a same person or whether one face belongs
465
738
  # to a person.
739
+ # <br/>
740
+ # Remarks:<br />
741
+ # * Higher face image quality means better identification precision. Please
742
+ # consider high-quality faces: frontal, clear, and face size is 200x200 pixels
743
+ # (100 pixels between eyes) or bigger.
744
+ # * For the scenarios that are sensitive to accuracy please make your own
745
+ # judgment.
746
+ # * The 'recognitionModel' associated with the query faces' faceIds should be
747
+ # the same as the 'recognitionModel' used by the target face, person group or
748
+ # large person group.
749
+ #
466
750
  #
467
751
  # @param face_id1 FaceId of the first face, comes from Face - Detect
468
752
  # @param face_id2 FaceId of the second face, comes from Face - Detect
@@ -472,6 +756,7 @@ module Azure::CognitiveServices::Face::V1_0
472
756
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
473
757
  #
474
758
  def verify_face_to_face_async(face_id1, face_id2, custom_headers:nil)
759
+ fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
475
760
  fail ArgumentError, 'face_id1 is nil' if face_id1.nil?
476
761
  fail ArgumentError, 'face_id2 is nil' if face_id2.nil?
477
762
 
@@ -496,6 +781,7 @@ module Azure::CognitiveServices::Face::V1_0
496
781
  path_template = 'verify'
497
782
 
498
783
  request_url = @base_url || @client.base_url
784
+ request_url = request_url.gsub('{Endpoint}', @client.endpoint)
499
785
 
500
786
  options = {
501
787
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
@@ -533,8 +819,45 @@ module Azure::CognitiveServices::Face::V1_0
533
819
  end
534
820
 
535
821
  #
536
- # Detect human faces in an image and returns face locations, and optionally
537
- # with faceIds, landmarks, and attributes.
822
+ # Detect human faces in an image, return face rectangles, and optionally with
823
+ # faceIds, landmarks, and attributes.<br />
824
+ # * Optional parameters including faceId, landmarks, and attributes. Attributes
825
+ # include age, gender, headPose, smile, facialHair, glasses, emotion, hair,
826
+ # makeup, occlusion, accessories, blur, exposure and noise.
827
+ # * The extracted face feature, instead of the actual image, will be stored on
828
+ # server. The faceId is an identifier of the face feature and will be used in
829
+ # [Face -
830
+ # Identify](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395239),
831
+ # [Face -
832
+ # Verify](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039523a),
833
+ # and [Face - Find
834
+ # Similar](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395237).
835
+ # It will expire 24 hours after the detection call.
836
+ # * Higher face image quality means better detection and recognition precision.
837
+ # Please consider high-quality faces: frontal, clear, and face size is 200x200
838
+ # pixels (100 pixels between eyes) or bigger.
839
+ # * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed
840
+ # image file size is from 1KB to 6MB.
841
+ # * Faces are detectable when its size is 36x36 to 4096x4096 pixels. If need to
842
+ # detect very small but clear faces, please try to enlarge the input image.
843
+ # * Up to 64 faces can be returned for an image. Faces are ranked by face
844
+ # rectangle size from large to small.
845
+ # * Face detector prefer frontal and near-frontal faces. There are cases that
846
+ # faces may not be detected, e.g. exceptionally large face angles (head-pose)
847
+ # or being occluded, or wrong image orientation.
848
+ # * Attributes (age, gender, headPose, smile, facialHair, glasses, emotion,
849
+ # hair, makeup, occlusion, accessories, blur, exposure and noise) may not be
850
+ # perfectly accurate. HeadPose's pitch value is a reserved field and will
851
+ # always return 0.
852
+ # * Different 'recognitionModel' values are provided. If follow-up operations
853
+ # like Verify, Identify, Find Similar are needed, please specify the
854
+ # recognition model with 'recognitionModel' parameter. The default value for
855
+ # 'recognitionModel' is 'recognition_01', if latest model needed, please
856
+ # explicitly specify the model you need in this parameter. Once specified, the
857
+ # detected faceIds will be associated with the specified recognition model.
858
+ # More details, please refer to [How to specify a recognition
859
+ # model](https://docs.microsoft.com/en-us/azure/cognitive-services/face/face-api-how-to-topics/specify-recognition-model)
860
+ #
538
861
  #
539
862
  # @param url [String] Publicly reachable URL of an image
540
863
  # @param return_face_id [Boolean] A value indicating whether the operation
@@ -546,19 +869,65 @@ module Azure::CognitiveServices::Face::V1_0
546
869
  # "returnFaceAttributes=age,gender". Supported face attributes include age,
547
870
  # gender, headPose, smile, facialHair, glasses and emotion. Note that each face
548
871
  # attribute analysis has additional computational and time cost.
872
+ # @param recognition_model [RecognitionModel] Name of recognition model.
873
+ # Recognition model is used when the face features are extracted and associated
874
+ # with detected faceIds, (Large)FaceList or (Large)PersonGroup. A recognition
875
+ # model name can be provided when performing Face - Detect or (Large)FaceList -
876
+ # Create or (Large)PersonGroup - Create. The default value is 'recognition_01',
877
+ # if latest model needed, please explicitly specify the model you need.
878
+ # Possible values include: 'recognition_01', 'recognition_02'
879
+ # @param return_recognition_model [Boolean] A value indicating whether the
880
+ # operation should return 'recognitionModel' in response.
549
881
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
550
882
  # will be added to the HTTP request.
551
883
  #
552
884
  # @return [Array] operation results.
553
885
  #
554
- def detect_with_url(url, return_face_id:true, return_face_landmarks:false, return_face_attributes:nil, custom_headers:nil)
555
- response = detect_with_url_async(url, return_face_id:return_face_id, return_face_landmarks:return_face_landmarks, return_face_attributes:return_face_attributes, custom_headers:custom_headers).value!
886
+ def detect_with_url(url, return_face_id:true, return_face_landmarks:false, return_face_attributes:nil, recognition_model:nil, return_recognition_model:false, custom_headers:nil)
887
+ response = detect_with_url_async(url, return_face_id:return_face_id, return_face_landmarks:return_face_landmarks, return_face_attributes:return_face_attributes, recognition_model:recognition_model, return_recognition_model:return_recognition_model, custom_headers:custom_headers).value!
556
888
  response.body unless response.nil?
557
889
  end
558
890
 
559
891
  #
560
- # Detect human faces in an image and returns face locations, and optionally
561
- # with faceIds, landmarks, and attributes.
892
+ # Detect human faces in an image, return face rectangles, and optionally with
893
+ # faceIds, landmarks, and attributes.<br />
894
+ # * Optional parameters including faceId, landmarks, and attributes. Attributes
895
+ # include age, gender, headPose, smile, facialHair, glasses, emotion, hair,
896
+ # makeup, occlusion, accessories, blur, exposure and noise.
897
+ # * The extracted face feature, instead of the actual image, will be stored on
898
+ # server. The faceId is an identifier of the face feature and will be used in
899
+ # [Face -
900
+ # Identify](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395239),
901
+ # [Face -
902
+ # Verify](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039523a),
903
+ # and [Face - Find
904
+ # Similar](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395237).
905
+ # It will expire 24 hours after the detection call.
906
+ # * Higher face image quality means better detection and recognition precision.
907
+ # Please consider high-quality faces: frontal, clear, and face size is 200x200
908
+ # pixels (100 pixels between eyes) or bigger.
909
+ # * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed
910
+ # image file size is from 1KB to 6MB.
911
+ # * Faces are detectable when its size is 36x36 to 4096x4096 pixels. If need to
912
+ # detect very small but clear faces, please try to enlarge the input image.
913
+ # * Up to 64 faces can be returned for an image. Faces are ranked by face
914
+ # rectangle size from large to small.
915
+ # * Face detector prefer frontal and near-frontal faces. There are cases that
916
+ # faces may not be detected, e.g. exceptionally large face angles (head-pose)
917
+ # or being occluded, or wrong image orientation.
918
+ # * Attributes (age, gender, headPose, smile, facialHair, glasses, emotion,
919
+ # hair, makeup, occlusion, accessories, blur, exposure and noise) may not be
920
+ # perfectly accurate. HeadPose's pitch value is a reserved field and will
921
+ # always return 0.
922
+ # * Different 'recognitionModel' values are provided. If follow-up operations
923
+ # like Verify, Identify, Find Similar are needed, please specify the
924
+ # recognition model with 'recognitionModel' parameter. The default value for
925
+ # 'recognitionModel' is 'recognition_01', if latest model needed, please
926
+ # explicitly specify the model you need in this parameter. Once specified, the
927
+ # detected faceIds will be associated with the specified recognition model.
928
+ # More details, please refer to [How to specify a recognition
929
+ # model](https://docs.microsoft.com/en-us/azure/cognitive-services/face/face-api-how-to-topics/specify-recognition-model)
930
+ #
562
931
  #
563
932
  # @param url [String] Publicly reachable URL of an image
564
933
  # @param return_face_id [Boolean] A value indicating whether the operation
@@ -570,18 +939,64 @@ module Azure::CognitiveServices::Face::V1_0
570
939
  # "returnFaceAttributes=age,gender". Supported face attributes include age,
571
940
  # gender, headPose, smile, facialHair, glasses and emotion. Note that each face
572
941
  # attribute analysis has additional computational and time cost.
942
+ # @param recognition_model [RecognitionModel] Name of recognition model.
943
+ # Recognition model is used when the face features are extracted and associated
944
+ # with detected faceIds, (Large)FaceList or (Large)PersonGroup. A recognition
945
+ # model name can be provided when performing Face - Detect or (Large)FaceList -
946
+ # Create or (Large)PersonGroup - Create. The default value is 'recognition_01',
947
+ # if latest model needed, please explicitly specify the model you need.
948
+ # Possible values include: 'recognition_01', 'recognition_02'
949
+ # @param return_recognition_model [Boolean] A value indicating whether the
950
+ # operation should return 'recognitionModel' in response.
573
951
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
574
952
  # will be added to the HTTP request.
575
953
  #
576
954
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
577
955
  #
578
- def detect_with_url_with_http_info(url, return_face_id:true, return_face_landmarks:false, return_face_attributes:nil, custom_headers:nil)
579
- detect_with_url_async(url, return_face_id:return_face_id, return_face_landmarks:return_face_landmarks, return_face_attributes:return_face_attributes, custom_headers:custom_headers).value!
956
+ def detect_with_url_with_http_info(url, return_face_id:true, return_face_landmarks:false, return_face_attributes:nil, recognition_model:nil, return_recognition_model:false, custom_headers:nil)
957
+ detect_with_url_async(url, return_face_id:return_face_id, return_face_landmarks:return_face_landmarks, return_face_attributes:return_face_attributes, recognition_model:recognition_model, return_recognition_model:return_recognition_model, custom_headers:custom_headers).value!
580
958
  end
581
959
 
582
960
  #
583
- # Detect human faces in an image and returns face locations, and optionally
584
- # with faceIds, landmarks, and attributes.
961
+ # Detect human faces in an image, return face rectangles, and optionally with
962
+ # faceIds, landmarks, and attributes.<br />
963
+ # * Optional parameters including faceId, landmarks, and attributes. Attributes
964
+ # include age, gender, headPose, smile, facialHair, glasses, emotion, hair,
965
+ # makeup, occlusion, accessories, blur, exposure and noise.
966
+ # * The extracted face feature, instead of the actual image, will be stored on
967
+ # server. The faceId is an identifier of the face feature and will be used in
968
+ # [Face -
969
+ # Identify](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395239),
970
+ # [Face -
971
+ # Verify](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039523a),
972
+ # and [Face - Find
973
+ # Similar](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395237).
974
+ # It will expire 24 hours after the detection call.
975
+ # * Higher face image quality means better detection and recognition precision.
976
+ # Please consider high-quality faces: frontal, clear, and face size is 200x200
977
+ # pixels (100 pixels between eyes) or bigger.
978
+ # * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed
979
+ # image file size is from 1KB to 6MB.
980
+ # * Faces are detectable when its size is 36x36 to 4096x4096 pixels. If need to
981
+ # detect very small but clear faces, please try to enlarge the input image.
982
+ # * Up to 64 faces can be returned for an image. Faces are ranked by face
983
+ # rectangle size from large to small.
984
+ # * Face detector prefer frontal and near-frontal faces. There are cases that
985
+ # faces may not be detected, e.g. exceptionally large face angles (head-pose)
986
+ # or being occluded, or wrong image orientation.
987
+ # * Attributes (age, gender, headPose, smile, facialHair, glasses, emotion,
988
+ # hair, makeup, occlusion, accessories, blur, exposure and noise) may not be
989
+ # perfectly accurate. HeadPose's pitch value is a reserved field and will
990
+ # always return 0.
991
+ # * Different 'recognitionModel' values are provided. If follow-up operations
992
+ # like Verify, Identify, Find Similar are needed, please specify the
993
+ # recognition model with 'recognitionModel' parameter. The default value for
994
+ # 'recognitionModel' is 'recognition_01', if latest model needed, please
995
+ # explicitly specify the model you need in this parameter. Once specified, the
996
+ # detected faceIds will be associated with the specified recognition model.
997
+ # More details, please refer to [How to specify a recognition
998
+ # model](https://docs.microsoft.com/en-us/azure/cognitive-services/face/face-api-how-to-topics/specify-recognition-model)
999
+ #
585
1000
  #
586
1001
  # @param url [String] Publicly reachable URL of an image
587
1002
  # @param return_face_id [Boolean] A value indicating whether the operation
@@ -593,12 +1008,22 @@ module Azure::CognitiveServices::Face::V1_0
593
1008
  # "returnFaceAttributes=age,gender". Supported face attributes include age,
594
1009
  # gender, headPose, smile, facialHair, glasses and emotion. Note that each face
595
1010
  # attribute analysis has additional computational and time cost.
1011
+ # @param recognition_model [RecognitionModel] Name of recognition model.
1012
+ # Recognition model is used when the face features are extracted and associated
1013
+ # with detected faceIds, (Large)FaceList or (Large)PersonGroup. A recognition
1014
+ # model name can be provided when performing Face - Detect or (Large)FaceList -
1015
+ # Create or (Large)PersonGroup - Create. The default value is 'recognition_01',
1016
+ # if latest model needed, please explicitly specify the model you need.
1017
+ # Possible values include: 'recognition_01', 'recognition_02'
1018
+ # @param return_recognition_model [Boolean] A value indicating whether the
1019
+ # operation should return 'recognitionModel' in response.
596
1020
  # @param [Hash{String => String}] A hash of custom headers that will be added
597
1021
  # to the HTTP request.
598
1022
  #
599
1023
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
600
1024
  #
601
- def detect_with_url_async(url, return_face_id:true, return_face_landmarks:false, return_face_attributes:nil, custom_headers:nil)
1025
+ def detect_with_url_async(url, return_face_id:true, return_face_landmarks:false, return_face_attributes:nil, recognition_model:nil, return_recognition_model:false, custom_headers:nil)
1026
+ fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
602
1027
  fail ArgumentError, 'url is nil' if url.nil?
603
1028
 
604
1029
  image_url = ImageUrl.new
@@ -621,10 +1046,11 @@ module Azure::CognitiveServices::Face::V1_0
621
1046
  path_template = 'detect'
622
1047
 
623
1048
  request_url = @base_url || @client.base_url
1049
+ request_url = request_url.gsub('{Endpoint}', @client.endpoint)
624
1050
 
625
1051
  options = {
626
1052
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
627
- query_params: {'returnFaceId' => return_face_id,'returnFaceLandmarks' => return_face_landmarks,'returnFaceAttributes' => return_face_attributes.nil? ? nil : return_face_attributes.join(',')},
1053
+ query_params: {'returnFaceId' => return_face_id,'returnFaceLandmarks' => return_face_landmarks,'returnFaceAttributes' => return_face_attributes.nil? ? nil : return_face_attributes.join(','),'recognitionModel' => recognition_model,'returnRecognitionModel' => return_recognition_model},
628
1054
  body: request_content,
629
1055
  headers: request_headers.merge(custom_headers || {}),
630
1056
  base_url: request_url
@@ -678,19 +1104,25 @@ module Azure::CognitiveServices::Face::V1_0
678
1104
  # Verify whether two faces belong to a same person. Compares a face Id with a
679
1105
  # Person Id
680
1106
  #
681
- # @param face_id FaceId the face, comes from Face - Detect
1107
+ # @param face_id FaceId of the face, comes from Face - Detect
1108
+ # @param person_id Specify a certain person in a person group or a large person
1109
+ # group. personId is created in PersonGroup Person - Create or LargePersonGroup
1110
+ # Person - Create.
682
1111
  # @param person_group_id [String] Using existing personGroupId and personId for
683
- # fast loading a specified person. personGroupId is created in Person
684
- # Groups.Create.
685
- # @param person_id Specify a certain person in a person group. personId is
686
- # created in Persons.Create.
1112
+ # fast loading a specified person. personGroupId is created in PersonGroup -
1113
+ # Create. Parameter personGroupId and largePersonGroupId should not be provided
1114
+ # at the same time.
1115
+ # @param large_person_group_id [String] Using existing largePersonGroupId and
1116
+ # personId for fast loading a specified person. largePersonGroupId is created
1117
+ # in LargePersonGroup - Create. Parameter personGroupId and largePersonGroupId
1118
+ # should not be provided at the same time.
687
1119
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
688
1120
  # will be added to the HTTP request.
689
1121
  #
690
1122
  # @return [VerifyResult] operation results.
691
1123
  #
692
- def verify_face_to_person(face_id, person_group_id, person_id, custom_headers:nil)
693
- response = verify_face_to_person_async(face_id, person_group_id, person_id, custom_headers:custom_headers).value!
1124
+ def verify_face_to_person(face_id, person_id, person_group_id:nil, large_person_group_id:nil, custom_headers:nil)
1125
+ response = verify_face_to_person_async(face_id, person_id, person_group_id:person_group_id, large_person_group_id:large_person_group_id, custom_headers:custom_headers).value!
694
1126
  response.body unless response.nil?
695
1127
  end
696
1128
 
@@ -698,47 +1130,62 @@ module Azure::CognitiveServices::Face::V1_0
698
1130
  # Verify whether two faces belong to a same person. Compares a face Id with a
699
1131
  # Person Id
700
1132
  #
701
- # @param face_id FaceId the face, comes from Face - Detect
1133
+ # @param face_id FaceId of the face, comes from Face - Detect
1134
+ # @param person_id Specify a certain person in a person group or a large person
1135
+ # group. personId is created in PersonGroup Person - Create or LargePersonGroup
1136
+ # Person - Create.
702
1137
  # @param person_group_id [String] Using existing personGroupId and personId for
703
- # fast loading a specified person. personGroupId is created in Person
704
- # Groups.Create.
705
- # @param person_id Specify a certain person in a person group. personId is
706
- # created in Persons.Create.
1138
+ # fast loading a specified person. personGroupId is created in PersonGroup -
1139
+ # Create. Parameter personGroupId and largePersonGroupId should not be provided
1140
+ # at the same time.
1141
+ # @param large_person_group_id [String] Using existing largePersonGroupId and
1142
+ # personId for fast loading a specified person. largePersonGroupId is created
1143
+ # in LargePersonGroup - Create. Parameter personGroupId and largePersonGroupId
1144
+ # should not be provided at the same time.
707
1145
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
708
1146
  # will be added to the HTTP request.
709
1147
  #
710
1148
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
711
1149
  #
712
- def verify_face_to_person_with_http_info(face_id, person_group_id, person_id, custom_headers:nil)
713
- verify_face_to_person_async(face_id, person_group_id, person_id, custom_headers:custom_headers).value!
1150
+ def verify_face_to_person_with_http_info(face_id, person_id, person_group_id:nil, large_person_group_id:nil, custom_headers:nil)
1151
+ verify_face_to_person_async(face_id, person_id, person_group_id:person_group_id, large_person_group_id:large_person_group_id, custom_headers:custom_headers).value!
714
1152
  end
715
1153
 
716
1154
  #
717
1155
  # Verify whether two faces belong to a same person. Compares a face Id with a
718
1156
  # Person Id
719
1157
  #
720
- # @param face_id FaceId the face, comes from Face - Detect
1158
+ # @param face_id FaceId of the face, comes from Face - Detect
1159
+ # @param person_id Specify a certain person in a person group or a large person
1160
+ # group. personId is created in PersonGroup Person - Create or LargePersonGroup
1161
+ # Person - Create.
721
1162
  # @param person_group_id [String] Using existing personGroupId and personId for
722
- # fast loading a specified person. personGroupId is created in Person
723
- # Groups.Create.
724
- # @param person_id Specify a certain person in a person group. personId is
725
- # created in Persons.Create.
1163
+ # fast loading a specified person. personGroupId is created in PersonGroup -
1164
+ # Create. Parameter personGroupId and largePersonGroupId should not be provided
1165
+ # at the same time.
1166
+ # @param large_person_group_id [String] Using existing largePersonGroupId and
1167
+ # personId for fast loading a specified person. largePersonGroupId is created
1168
+ # in LargePersonGroup - Create. Parameter personGroupId and largePersonGroupId
1169
+ # should not be provided at the same time.
726
1170
  # @param [Hash{String => String}] A hash of custom headers that will be added
727
1171
  # to the HTTP request.
728
1172
  #
729
1173
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
730
1174
  #
731
- def verify_face_to_person_async(face_id, person_group_id, person_id, custom_headers:nil)
1175
+ def verify_face_to_person_async(face_id, person_id, person_group_id:nil, large_person_group_id:nil, custom_headers:nil)
1176
+ fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
732
1177
  fail ArgumentError, 'face_id is nil' if face_id.nil?
733
- fail ArgumentError, 'person_group_id is nil' if person_group_id.nil?
734
1178
  fail ArgumentError, "'person_group_id' should satisfy the constraint - 'MaxLength': '64'" if !person_group_id.nil? && person_group_id.length > 64
735
1179
  fail ArgumentError, "'person_group_id' should satisfy the constraint - 'Pattern': '^[a-z0-9-_]+$'" if !person_group_id.nil? && person_group_id.match(Regexp.new('^^[a-z0-9-_]+$$')).nil?
1180
+ fail ArgumentError, "'large_person_group_id' should satisfy the constraint - 'MaxLength': '64'" if !large_person_group_id.nil? && large_person_group_id.length > 64
1181
+ fail ArgumentError, "'large_person_group_id' should satisfy the constraint - 'Pattern': '^[a-z0-9-_]+$'" if !large_person_group_id.nil? && large_person_group_id.match(Regexp.new('^^[a-z0-9-_]+$$')).nil?
736
1182
  fail ArgumentError, 'person_id is nil' if person_id.nil?
737
1183
 
738
1184
  body = VerifyFaceToPersonRequest.new
739
- unless face_id.nil? && person_group_id.nil? && person_id.nil?
1185
+ unless face_id.nil? && person_group_id.nil? && large_person_group_id.nil? && person_id.nil?
740
1186
  body.face_id = face_id
741
1187
  body.person_group_id = person_group_id
1188
+ body.large_person_group_id = large_person_group_id
742
1189
  body.person_id = person_id
743
1190
  end
744
1191
 
@@ -757,6 +1204,7 @@ module Azure::CognitiveServices::Face::V1_0
757
1204
  path_template = 'verify'
758
1205
 
759
1206
  request_url = @base_url || @client.base_url
1207
+ request_url = request_url.gsub('{Endpoint}', @client.endpoint)
760
1208
 
761
1209
  options = {
762
1210
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
@@ -807,13 +1255,22 @@ module Azure::CognitiveServices::Face::V1_0
807
1255
  # "returnFaceAttributes=age,gender". Supported face attributes include age,
808
1256
  # gender, headPose, smile, facialHair, glasses and emotion. Note that each face
809
1257
  # attribute analysis has additional computational and time cost.
1258
+ # @param recognition_model [RecognitionModel] Name of recognition model.
1259
+ # Recognition model is used when the face features are extracted and associated
1260
+ # with detected faceIds, (Large)FaceList or (Large)PersonGroup. A recognition
1261
+ # model name can be provided when performing Face - Detect or (Large)FaceList -
1262
+ # Create or (Large)PersonGroup - Create. The default value is 'recognition_01',
1263
+ # if latest model needed, please explicitly specify the model you need.
1264
+ # Possible values include: 'recognition_01', 'recognition_02'
1265
+ # @param return_recognition_model [Boolean] A value indicating whether the
1266
+ # operation should return 'recognitionModel' in response.
810
1267
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
811
1268
  # will be added to the HTTP request.
812
1269
  #
813
1270
  # @return [Array] operation results.
814
1271
  #
815
- def detect_with_stream(image, return_face_id:true, return_face_landmarks:false, return_face_attributes:nil, custom_headers:nil)
816
- response = detect_with_stream_async(image, return_face_id:return_face_id, return_face_landmarks:return_face_landmarks, return_face_attributes:return_face_attributes, custom_headers:custom_headers).value!
1272
+ def detect_with_stream(image, return_face_id:true, return_face_landmarks:false, return_face_attributes:nil, recognition_model:nil, return_recognition_model:false, custom_headers:nil)
1273
+ response = detect_with_stream_async(image, return_face_id:return_face_id, return_face_landmarks:return_face_landmarks, return_face_attributes:return_face_attributes, recognition_model:recognition_model, return_recognition_model:return_recognition_model, custom_headers:custom_headers).value!
817
1274
  response.body unless response.nil?
818
1275
  end
819
1276
 
@@ -831,13 +1288,22 @@ module Azure::CognitiveServices::Face::V1_0
831
1288
  # "returnFaceAttributes=age,gender". Supported face attributes include age,
832
1289
  # gender, headPose, smile, facialHair, glasses and emotion. Note that each face
833
1290
  # attribute analysis has additional computational and time cost.
1291
+ # @param recognition_model [RecognitionModel] Name of recognition model.
1292
+ # Recognition model is used when the face features are extracted and associated
1293
+ # with detected faceIds, (Large)FaceList or (Large)PersonGroup. A recognition
1294
+ # model name can be provided when performing Face - Detect or (Large)FaceList -
1295
+ # Create or (Large)PersonGroup - Create. The default value is 'recognition_01',
1296
+ # if latest model needed, please explicitly specify the model you need.
1297
+ # Possible values include: 'recognition_01', 'recognition_02'
1298
+ # @param return_recognition_model [Boolean] A value indicating whether the
1299
+ # operation should return 'recognitionModel' in response.
834
1300
  # @param custom_headers [Hash{String => String}] A hash of custom headers that
835
1301
  # will be added to the HTTP request.
836
1302
  #
837
1303
  # @return [MsRestAzure::AzureOperationResponse] HTTP response information.
838
1304
  #
839
- def detect_with_stream_with_http_info(image, return_face_id:true, return_face_landmarks:false, return_face_attributes:nil, custom_headers:nil)
840
- detect_with_stream_async(image, return_face_id:return_face_id, return_face_landmarks:return_face_landmarks, return_face_attributes:return_face_attributes, custom_headers:custom_headers).value!
1305
+ def detect_with_stream_with_http_info(image, return_face_id:true, return_face_landmarks:false, return_face_attributes:nil, recognition_model:nil, return_recognition_model:false, custom_headers:nil)
1306
+ detect_with_stream_async(image, return_face_id:return_face_id, return_face_landmarks:return_face_landmarks, return_face_attributes:return_face_attributes, recognition_model:recognition_model, return_recognition_model:return_recognition_model, custom_headers:custom_headers).value!
841
1307
  end
842
1308
 
843
1309
  #
@@ -854,12 +1320,22 @@ module Azure::CognitiveServices::Face::V1_0
854
1320
  # "returnFaceAttributes=age,gender". Supported face attributes include age,
855
1321
  # gender, headPose, smile, facialHair, glasses and emotion. Note that each face
856
1322
  # attribute analysis has additional computational and time cost.
1323
+ # @param recognition_model [RecognitionModel] Name of recognition model.
1324
+ # Recognition model is used when the face features are extracted and associated
1325
+ # with detected faceIds, (Large)FaceList or (Large)PersonGroup. A recognition
1326
+ # model name can be provided when performing Face - Detect or (Large)FaceList -
1327
+ # Create or (Large)PersonGroup - Create. The default value is 'recognition_01',
1328
+ # if latest model needed, please explicitly specify the model you need.
1329
+ # Possible values include: 'recognition_01', 'recognition_02'
1330
+ # @param return_recognition_model [Boolean] A value indicating whether the
1331
+ # operation should return 'recognitionModel' in response.
857
1332
  # @param [Hash{String => String}] A hash of custom headers that will be added
858
1333
  # to the HTTP request.
859
1334
  #
860
1335
  # @return [Concurrent::Promise] Promise object which holds the HTTP response.
861
1336
  #
862
- def detect_with_stream_async(image, return_face_id:true, return_face_landmarks:false, return_face_attributes:nil, custom_headers:nil)
1337
+ def detect_with_stream_async(image, return_face_id:true, return_face_landmarks:false, return_face_attributes:nil, recognition_model:nil, return_recognition_model:false, custom_headers:nil)
1338
+ fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
863
1339
  fail ArgumentError, 'image is nil' if image.nil?
864
1340
 
865
1341
 
@@ -884,10 +1360,11 @@ module Azure::CognitiveServices::Face::V1_0
884
1360
  path_template = 'detect'
885
1361
 
886
1362
  request_url = @base_url || @client.base_url
1363
+ request_url = request_url.gsub('{Endpoint}', @client.endpoint)
887
1364
 
888
1365
  options = {
889
1366
  middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
890
- query_params: {'returnFaceId' => return_face_id,'returnFaceLandmarks' => return_face_landmarks,'returnFaceAttributes' => return_face_attributes.nil? ? nil : return_face_attributes.join(',')},
1367
+ query_params: {'returnFaceId' => return_face_id,'returnFaceLandmarks' => return_face_landmarks,'returnFaceAttributes' => return_face_attributes.nil? ? nil : return_face_attributes.join(','),'recognitionModel' => recognition_model,'returnRecognitionModel' => return_recognition_model},
891
1368
  body: request_content,
892
1369
  headers: request_headers.merge(custom_headers || {}),
893
1370
  base_url: request_url