azure_cognitiveservices_face 0.16.0 → 0.19.1
Sign up to get free protection for your applications and to get access to all the features.
- checksums.yaml +5 -5
- data/lib/1.0/generated/azure_cognitiveservices_face.rb +39 -23
- data/lib/1.0/generated/azure_cognitiveservices_face/face.rb +859 -103
- data/lib/1.0/generated/azure_cognitiveservices_face/face_client.rb +27 -13
- data/lib/1.0/generated/azure_cognitiveservices_face/face_list_operations.rb +506 -94
- data/lib/1.0/generated/azure_cognitiveservices_face/large_face_list_operations.rb +1894 -0
- data/lib/1.0/generated/azure_cognitiveservices_face/large_person_group_operations.rb +886 -0
- data/lib/1.0/generated/azure_cognitiveservices_face/large_person_group_person.rb +1477 -0
- data/lib/1.0/generated/azure_cognitiveservices_face/models/apply_snapshot_request.rb +69 -0
- data/lib/1.0/generated/azure_cognitiveservices_face/models/detected_face.rb +13 -0
- data/lib/1.0/generated/azure_cognitiveservices_face/models/detection_model.rb +16 -0
- data/lib/1.0/generated/azure_cognitiveservices_face/models/face_attributes.rb +1 -1
- data/lib/1.0/generated/azure_cognitiveservices_face/models/face_list.rb +10 -1
- data/lib/1.0/generated/azure_cognitiveservices_face/models/find_similar_request.rb +23 -1
- data/lib/1.0/generated/azure_cognitiveservices_face/models/gender.rb +0 -1
- data/lib/1.0/generated/azure_cognitiveservices_face/models/identify_request.rb +34 -16
- data/lib/1.0/generated/azure_cognitiveservices_face/models/image_url.rb +1 -1
- data/lib/1.0/generated/azure_cognitiveservices_face/models/large_face_list.rb +81 -0
- data/lib/1.0/generated/azure_cognitiveservices_face/models/large_person_group.rb +81 -0
- data/lib/1.0/generated/azure_cognitiveservices_face/models/meta_data_contract.rb +72 -0
- data/lib/1.0/generated/azure_cognitiveservices_face/models/name_and_user_data_contract.rb +1 -1
- data/lib/1.0/generated/azure_cognitiveservices_face/models/operation_status.rb +112 -0
- data/lib/1.0/generated/azure_cognitiveservices_face/models/operation_status_type.rb +18 -0
- data/lib/1.0/generated/azure_cognitiveservices_face/models/person_group.rb +11 -2
- data/lib/1.0/generated/azure_cognitiveservices_face/models/recognition_model.rb +16 -0
- data/lib/1.0/generated/azure_cognitiveservices_face/models/snapshot.rb +136 -0
- data/lib/1.0/generated/azure_cognitiveservices_face/models/snapshot_apply_mode.rb +15 -0
- data/lib/1.0/generated/azure_cognitiveservices_face/models/snapshot_object_type.rb +18 -0
- data/lib/1.0/generated/azure_cognitiveservices_face/models/take_snapshot_request.rb +101 -0
- data/lib/1.0/generated/azure_cognitiveservices_face/models/training_status.rb +25 -7
- data/lib/1.0/generated/azure_cognitiveservices_face/models/{update_person_face_request.rb → update_face_request.rb} +5 -5
- data/lib/1.0/generated/azure_cognitiveservices_face/models/update_snapshot_request.rb +73 -0
- data/lib/1.0/generated/azure_cognitiveservices_face/models/verify_face_to_face_request.rb +1 -1
- data/lib/1.0/generated/azure_cognitiveservices_face/models/verify_face_to_person_request.rb +27 -7
- data/lib/1.0/generated/azure_cognitiveservices_face/person_group_operations.rb +235 -48
- data/lib/1.0/generated/azure_cognitiveservices_face/person_group_person.rb +476 -69
- data/lib/1.0/generated/azure_cognitiveservices_face/snapshot_operations.rb +983 -0
- data/lib/profiles/latest/modules/face_profile_module.rb +128 -72
- data/lib/version.rb +1 -1
- metadata +23 -7
- data/lib/1.0/generated/azure_cognitiveservices_face/models/azure_regions.rb +0 -26
checksums.yaml
CHANGED
@@ -1,7 +1,7 @@
|
|
1
1
|
---
|
2
|
-
|
3
|
-
metadata.gz:
|
4
|
-
data.tar.gz:
|
2
|
+
SHA256:
|
3
|
+
metadata.gz: d35347d590937ee50d22b3011ded744ed1bdb927a3a489fd21ebf9258d47da1b
|
4
|
+
data.tar.gz: 621b9506c5e42395ff09ea78cce315939c29c339af7982b67bb82c964088cccc
|
5
5
|
SHA512:
|
6
|
-
metadata.gz:
|
7
|
-
data.tar.gz:
|
6
|
+
metadata.gz: aa7df0a9db6e5065e11a24c745527ded7f736102bf814bc7bcccb2a02c63ed69f1f59c59e4ceb01c9a77775311293f153f32df3f6b3d88c3f7caf1815f12d928
|
7
|
+
data.tar.gz: a98254078a567ae75b664a3a4b92192fce40ac7ce7b87ff221b680989657bae01079568fafc9c7e777cd0db926b44aeff3cafd3fa45bfc3129e5ef356439a430
|
@@ -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 :
|
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 :
|
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 :
|
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 :
|
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 :
|
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 :
|
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 :
|
52
|
-
autoload :
|
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,7 +85,10 @@ 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
|
-
autoload :
|
92
|
+
autoload :DetectionModel, '1.0/generated/azure_cognitiveservices_face/models/detection_model.rb'
|
77
93
|
end
|
78
94
|
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,
|
26
|
-
# or a
|
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
|
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,
|
54
|
-
# or a
|
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
|
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,
|
81
|
-
# or a
|
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
|
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,19 +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)
|
103
|
-
fail ArgumentError, '@client.
|
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?
|
104
197
|
fail ArgumentError, 'face_id is nil' if face_id.nil?
|
105
198
|
fail ArgumentError, "'face_list_id' should satisfy the constraint - 'MaxLength': '64'" if !face_list_id.nil? && face_list_id.length > 64
|
106
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?
|
107
202
|
fail ArgumentError, "'face_ids' should satisfy the constraint - 'MaxItems': '1000'" if !face_ids.nil? && face_ids.length > 1000
|
108
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
|
109
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
|
110
205
|
|
111
206
|
body = FindSimilarRequest.new
|
112
|
-
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?
|
113
208
|
body.face_id = face_id
|
114
209
|
body.face_list_id = face_list_id
|
210
|
+
body.large_face_list_id = large_face_list_id
|
115
211
|
body.face_ids = face_ids
|
116
212
|
body.max_num_of_candidates_returned = max_num_of_candidates_returned
|
117
213
|
body.mode = mode
|
@@ -132,7 +228,7 @@ module Azure::CognitiveServices::Face::V1_0
|
|
132
228
|
path_template = 'findsimilars'
|
133
229
|
|
134
230
|
request_url = @base_url || @client.base_url
|
135
|
-
request_url = request_url.gsub('{
|
231
|
+
request_url = request_url.gsub('{Endpoint}', @client.endpoint)
|
136
232
|
|
137
233
|
options = {
|
138
234
|
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
@@ -152,6 +248,8 @@ module Azure::CognitiveServices::Face::V1_0
|
|
152
248
|
end
|
153
249
|
|
154
250
|
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
251
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
252
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
155
253
|
# Deserialize Response
|
156
254
|
if status_code == 200
|
157
255
|
begin
|
@@ -186,7 +284,21 @@ module Azure::CognitiveServices::Face::V1_0
|
|
186
284
|
end
|
187
285
|
|
188
286
|
#
|
189
|
-
# Divide candidate faces into groups based on face similarity
|
287
|
+
# Divide candidate faces into groups based on face similarity.<br />
|
288
|
+
# * The output is one or more disjointed face groups and a messyGroup. A face
|
289
|
+
# group contains faces that have similar looking, often of the same person.
|
290
|
+
# Face groups are ranked by group size, i.e. number of faces. Notice that faces
|
291
|
+
# belonging to a same person might be split into several groups in the result.
|
292
|
+
# * MessyGroup is a special face group containing faces that cannot find any
|
293
|
+
# similar counterpart face from original faces. The messyGroup will not appear
|
294
|
+
# in the result if all faces found their counterparts.
|
295
|
+
# * Group API needs at least 2 candidate faces and 1000 at most. We suggest to
|
296
|
+
# try [Face -
|
297
|
+
# Verify](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039523a)
|
298
|
+
# when you only have 2 candidate faces.
|
299
|
+
# * The 'recognitionModel' associated with the query faces' faceIds should be
|
300
|
+
# the same.
|
301
|
+
#
|
190
302
|
#
|
191
303
|
# @param face_ids Array of candidate faceId created by Face - Detect. The
|
192
304
|
# maximum is 1000 faces
|
@@ -201,7 +313,21 @@ module Azure::CognitiveServices::Face::V1_0
|
|
201
313
|
end
|
202
314
|
|
203
315
|
#
|
204
|
-
# Divide candidate faces into groups based on face similarity
|
316
|
+
# Divide candidate faces into groups based on face similarity.<br />
|
317
|
+
# * The output is one or more disjointed face groups and a messyGroup. A face
|
318
|
+
# group contains faces that have similar looking, often of the same person.
|
319
|
+
# Face groups are ranked by group size, i.e. number of faces. Notice that faces
|
320
|
+
# belonging to a same person might be split into several groups in the result.
|
321
|
+
# * MessyGroup is a special face group containing faces that cannot find any
|
322
|
+
# similar counterpart face from original faces. The messyGroup will not appear
|
323
|
+
# in the result if all faces found their counterparts.
|
324
|
+
# * Group API needs at least 2 candidate faces and 1000 at most. We suggest to
|
325
|
+
# try [Face -
|
326
|
+
# Verify](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039523a)
|
327
|
+
# when you only have 2 candidate faces.
|
328
|
+
# * The 'recognitionModel' associated with the query faces' faceIds should be
|
329
|
+
# the same.
|
330
|
+
#
|
205
331
|
#
|
206
332
|
# @param face_ids Array of candidate faceId created by Face - Detect. The
|
207
333
|
# maximum is 1000 faces
|
@@ -215,7 +341,21 @@ module Azure::CognitiveServices::Face::V1_0
|
|
215
341
|
end
|
216
342
|
|
217
343
|
#
|
218
|
-
# Divide candidate faces into groups based on face similarity
|
344
|
+
# Divide candidate faces into groups based on face similarity.<br />
|
345
|
+
# * The output is one or more disjointed face groups and a messyGroup. A face
|
346
|
+
# group contains faces that have similar looking, often of the same person.
|
347
|
+
# Face groups are ranked by group size, i.e. number of faces. Notice that faces
|
348
|
+
# belonging to a same person might be split into several groups in the result.
|
349
|
+
# * MessyGroup is a special face group containing faces that cannot find any
|
350
|
+
# similar counterpart face from original faces. The messyGroup will not appear
|
351
|
+
# in the result if all faces found their counterparts.
|
352
|
+
# * Group API needs at least 2 candidate faces and 1000 at most. We suggest to
|
353
|
+
# try [Face -
|
354
|
+
# Verify](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039523a)
|
355
|
+
# when you only have 2 candidate faces.
|
356
|
+
# * The 'recognitionModel' associated with the query faces' faceIds should be
|
357
|
+
# the same.
|
358
|
+
#
|
219
359
|
#
|
220
360
|
# @param face_ids Array of candidate faceId created by Face - Detect. The
|
221
361
|
# maximum is 1000 faces
|
@@ -225,7 +365,7 @@ module Azure::CognitiveServices::Face::V1_0
|
|
225
365
|
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
226
366
|
#
|
227
367
|
def group_async(face_ids, custom_headers:nil)
|
228
|
-
fail ArgumentError, '@client.
|
368
|
+
fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
|
229
369
|
fail ArgumentError, 'face_ids is nil' if face_ids.nil?
|
230
370
|
fail ArgumentError, "'face_ids' should satisfy the constraint - 'MaxItems': '1000'" if !face_ids.nil? && face_ids.length > 1000
|
231
371
|
|
@@ -249,7 +389,7 @@ module Azure::CognitiveServices::Face::V1_0
|
|
249
389
|
path_template = 'group'
|
250
390
|
|
251
391
|
request_url = @base_url || @client.base_url
|
252
|
-
request_url = request_url.gsub('{
|
392
|
+
request_url = request_url.gsub('{Endpoint}', @client.endpoint)
|
253
393
|
|
254
394
|
options = {
|
255
395
|
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
@@ -269,6 +409,8 @@ module Azure::CognitiveServices::Face::V1_0
|
|
269
409
|
end
|
270
410
|
|
271
411
|
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
412
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
413
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
272
414
|
# Deserialize Response
|
273
415
|
if status_code == 200
|
274
416
|
begin
|
@@ -287,13 +429,48 @@ module Azure::CognitiveServices::Face::V1_0
|
|
287
429
|
end
|
288
430
|
|
289
431
|
#
|
290
|
-
#
|
432
|
+
# 1-to-many identification to find the closest matches of the specific query
|
433
|
+
# person face from a person group or large person group.
|
434
|
+
# <br/> For each face in the faceIds array, Face Identify will compute
|
435
|
+
# similarities between the query face and all the faces in the person group
|
436
|
+
# (given by personGroupId) or large person group (given by largePersonGroupId),
|
437
|
+
# and return candidate person(s) for that face ranked by similarity confidence.
|
438
|
+
# The person group/large person group should be trained to make it ready for
|
439
|
+
# identification. See more in [PersonGroup -
|
440
|
+
# Train](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395249)
|
441
|
+
# and [LargePersonGroup -
|
442
|
+
# Train](/docs/services/563879b61984550e40cbbe8d/operations/599ae2d16ac60f11b48b5aa4).
|
443
|
+
# <br/>
|
444
|
+
#
|
445
|
+
# Remarks:<br />
|
446
|
+
# * The algorithm allows more than one face to be identified independently at
|
447
|
+
# the same request, but no more than 10 faces.
|
448
|
+
# * Each person in the person group/large person group could have more than one
|
449
|
+
# face, but no more than 248 faces.
|
450
|
+
# * Higher face image quality means better identification precision. Please
|
451
|
+
# consider high-quality faces: frontal, clear, and face size is 200x200 pixels
|
452
|
+
# (100 pixels between eyes) or bigger.
|
453
|
+
# * Number of candidates returned is restricted by maxNumOfCandidatesReturned
|
454
|
+
# and confidenceThreshold. If no person is identified, the returned candidates
|
455
|
+
# will be an empty array.
|
456
|
+
# * Try [Face - Find
|
457
|
+
# Similar](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395237)
|
458
|
+
# when you need to find similar faces from a face list/large face list instead
|
459
|
+
# of a person group/large person group.
|
460
|
+
# * The 'recognitionModel' associated with the query faces' faceIds should be
|
461
|
+
# the same as the 'recognitionModel' used by the target person group or large
|
462
|
+
# person group.
|
463
|
+
#
|
291
464
|
#
|
292
|
-
# @param person_group_id [String] PersonGroupId of the target person group,
|
293
|
-
# created by PersonGroups.Create
|
294
465
|
# @param face_ids Array of query faces faceIds, created by the Face - Detect.
|
295
466
|
# Each of the faces are identified independently. The valid number of faceIds
|
296
467
|
# is between [1, 10].
|
468
|
+
# @param person_group_id [String] PersonGroupId of the target person group,
|
469
|
+
# created by PersonGroup - Create. Parameter personGroupId and
|
470
|
+
# largePersonGroupId should not be provided at the same time.
|
471
|
+
# @param large_person_group_id [String] LargePersonGroupId of the target large
|
472
|
+
# person group, created by LargePersonGroup - Create. Parameter personGroupId
|
473
|
+
# and largePersonGroupId should not be provided at the same time.
|
297
474
|
# @param max_num_of_candidates_returned [Integer] The range of
|
298
475
|
# maxNumOfCandidatesReturned is between 1 and 5 (default is 1).
|
299
476
|
# @param confidence_threshold [Float] Confidence threshold of identification,
|
@@ -304,19 +481,54 @@ module Azure::CognitiveServices::Face::V1_0
|
|
304
481
|
#
|
305
482
|
# @return [Array] operation results.
|
306
483
|
#
|
307
|
-
def identify(person_group_id,
|
308
|
-
response = identify_async(person_group_id,
|
484
|
+
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)
|
485
|
+
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!
|
309
486
|
response.body unless response.nil?
|
310
487
|
end
|
311
488
|
|
312
489
|
#
|
313
|
-
#
|
490
|
+
# 1-to-many identification to find the closest matches of the specific query
|
491
|
+
# person face from a person group or large person group.
|
492
|
+
# <br/> For each face in the faceIds array, Face Identify will compute
|
493
|
+
# similarities between the query face and all the faces in the person group
|
494
|
+
# (given by personGroupId) or large person group (given by largePersonGroupId),
|
495
|
+
# and return candidate person(s) for that face ranked by similarity confidence.
|
496
|
+
# The person group/large person group should be trained to make it ready for
|
497
|
+
# identification. See more in [PersonGroup -
|
498
|
+
# Train](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395249)
|
499
|
+
# and [LargePersonGroup -
|
500
|
+
# Train](/docs/services/563879b61984550e40cbbe8d/operations/599ae2d16ac60f11b48b5aa4).
|
501
|
+
# <br/>
|
502
|
+
#
|
503
|
+
# Remarks:<br />
|
504
|
+
# * The algorithm allows more than one face to be identified independently at
|
505
|
+
# the same request, but no more than 10 faces.
|
506
|
+
# * Each person in the person group/large person group could have more than one
|
507
|
+
# face, but no more than 248 faces.
|
508
|
+
# * Higher face image quality means better identification precision. Please
|
509
|
+
# consider high-quality faces: frontal, clear, and face size is 200x200 pixels
|
510
|
+
# (100 pixels between eyes) or bigger.
|
511
|
+
# * Number of candidates returned is restricted by maxNumOfCandidatesReturned
|
512
|
+
# and confidenceThreshold. If no person is identified, the returned candidates
|
513
|
+
# will be an empty array.
|
514
|
+
# * Try [Face - Find
|
515
|
+
# Similar](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395237)
|
516
|
+
# when you need to find similar faces from a face list/large face list instead
|
517
|
+
# of a person group/large person group.
|
518
|
+
# * The 'recognitionModel' associated with the query faces' faceIds should be
|
519
|
+
# the same as the 'recognitionModel' used by the target person group or large
|
520
|
+
# person group.
|
521
|
+
#
|
314
522
|
#
|
315
|
-
# @param person_group_id [String] PersonGroupId of the target person group,
|
316
|
-
# created by PersonGroups.Create
|
317
523
|
# @param face_ids Array of query faces faceIds, created by the Face - Detect.
|
318
524
|
# Each of the faces are identified independently. The valid number of faceIds
|
319
525
|
# is between [1, 10].
|
526
|
+
# @param person_group_id [String] PersonGroupId of the target person group,
|
527
|
+
# created by PersonGroup - Create. Parameter personGroupId and
|
528
|
+
# largePersonGroupId should not be provided at the same time.
|
529
|
+
# @param large_person_group_id [String] LargePersonGroupId of the target large
|
530
|
+
# person group, created by LargePersonGroup - Create. Parameter personGroupId
|
531
|
+
# and largePersonGroupId should not be provided at the same time.
|
320
532
|
# @param max_num_of_candidates_returned [Integer] The range of
|
321
533
|
# maxNumOfCandidatesReturned is between 1 and 5 (default is 1).
|
322
534
|
# @param confidence_threshold [Float] Confidence threshold of identification,
|
@@ -327,18 +539,53 @@ module Azure::CognitiveServices::Face::V1_0
|
|
327
539
|
#
|
328
540
|
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
329
541
|
#
|
330
|
-
def identify_with_http_info(person_group_id,
|
331
|
-
identify_async(person_group_id,
|
542
|
+
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)
|
543
|
+
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!
|
332
544
|
end
|
333
545
|
|
334
546
|
#
|
335
|
-
#
|
547
|
+
# 1-to-many identification to find the closest matches of the specific query
|
548
|
+
# person face from a person group or large person group.
|
549
|
+
# <br/> For each face in the faceIds array, Face Identify will compute
|
550
|
+
# similarities between the query face and all the faces in the person group
|
551
|
+
# (given by personGroupId) or large person group (given by largePersonGroupId),
|
552
|
+
# and return candidate person(s) for that face ranked by similarity confidence.
|
553
|
+
# The person group/large person group should be trained to make it ready for
|
554
|
+
# identification. See more in [PersonGroup -
|
555
|
+
# Train](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395249)
|
556
|
+
# and [LargePersonGroup -
|
557
|
+
# Train](/docs/services/563879b61984550e40cbbe8d/operations/599ae2d16ac60f11b48b5aa4).
|
558
|
+
# <br/>
|
559
|
+
#
|
560
|
+
# Remarks:<br />
|
561
|
+
# * The algorithm allows more than one face to be identified independently at
|
562
|
+
# the same request, but no more than 10 faces.
|
563
|
+
# * Each person in the person group/large person group could have more than one
|
564
|
+
# face, but no more than 248 faces.
|
565
|
+
# * Higher face image quality means better identification precision. Please
|
566
|
+
# consider high-quality faces: frontal, clear, and face size is 200x200 pixels
|
567
|
+
# (100 pixels between eyes) or bigger.
|
568
|
+
# * Number of candidates returned is restricted by maxNumOfCandidatesReturned
|
569
|
+
# and confidenceThreshold. If no person is identified, the returned candidates
|
570
|
+
# will be an empty array.
|
571
|
+
# * Try [Face - Find
|
572
|
+
# Similar](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395237)
|
573
|
+
# when you need to find similar faces from a face list/large face list instead
|
574
|
+
# of a person group/large person group.
|
575
|
+
# * The 'recognitionModel' associated with the query faces' faceIds should be
|
576
|
+
# the same as the 'recognitionModel' used by the target person group or large
|
577
|
+
# person group.
|
578
|
+
#
|
336
579
|
#
|
337
|
-
# @param person_group_id [String] PersonGroupId of the target person group,
|
338
|
-
# created by PersonGroups.Create
|
339
580
|
# @param face_ids Array of query faces faceIds, created by the Face - Detect.
|
340
581
|
# Each of the faces are identified independently. The valid number of faceIds
|
341
582
|
# is between [1, 10].
|
583
|
+
# @param person_group_id [String] PersonGroupId of the target person group,
|
584
|
+
# created by PersonGroup - Create. Parameter personGroupId and
|
585
|
+
# largePersonGroupId should not be provided at the same time.
|
586
|
+
# @param large_person_group_id [String] LargePersonGroupId of the target large
|
587
|
+
# person group, created by LargePersonGroup - Create. Parameter personGroupId
|
588
|
+
# and largePersonGroupId should not be provided at the same time.
|
342
589
|
# @param max_num_of_candidates_returned [Integer] The range of
|
343
590
|
# maxNumOfCandidatesReturned is between 1 and 5 (default is 1).
|
344
591
|
# @param confidence_threshold [Float] Confidence threshold of identification,
|
@@ -349,20 +596,22 @@ module Azure::CognitiveServices::Face::V1_0
|
|
349
596
|
#
|
350
597
|
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
351
598
|
#
|
352
|
-
def identify_async(person_group_id,
|
353
|
-
fail ArgumentError, '@client.
|
354
|
-
fail ArgumentError, 'person_group_id is nil' if person_group_id.nil?
|
355
|
-
fail ArgumentError, "'person_group_id' should satisfy the constraint - 'MaxLength': '64'" if !person_group_id.nil? && person_group_id.length > 64
|
356
|
-
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?
|
599
|
+
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)
|
600
|
+
fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
|
357
601
|
fail ArgumentError, 'face_ids is nil' if face_ids.nil?
|
358
602
|
fail ArgumentError, "'face_ids' should satisfy the constraint - 'MaxItems': '10'" if !face_ids.nil? && face_ids.length > 10
|
603
|
+
fail ArgumentError, "'person_group_id' should satisfy the constraint - 'MaxLength': '64'" if !person_group_id.nil? && person_group_id.length > 64
|
604
|
+
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?
|
605
|
+
fail ArgumentError, "'large_person_group_id' should satisfy the constraint - 'MaxLength': '64'" if !large_person_group_id.nil? && large_person_group_id.length > 64
|
606
|
+
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?
|
359
607
|
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
|
360
608
|
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
|
361
609
|
|
362
610
|
body = IdentifyRequest.new
|
363
|
-
unless person_group_id.nil? &&
|
364
|
-
body.person_group_id = person_group_id
|
611
|
+
unless face_ids.nil? && person_group_id.nil? && large_person_group_id.nil? && max_num_of_candidates_returned.nil? && confidence_threshold.nil?
|
365
612
|
body.face_ids = face_ids
|
613
|
+
body.person_group_id = person_group_id
|
614
|
+
body.large_person_group_id = large_person_group_id
|
366
615
|
body.max_num_of_candidates_returned = max_num_of_candidates_returned
|
367
616
|
body.confidence_threshold = confidence_threshold
|
368
617
|
end
|
@@ -382,7 +631,7 @@ module Azure::CognitiveServices::Face::V1_0
|
|
382
631
|
path_template = 'identify'
|
383
632
|
|
384
633
|
request_url = @base_url || @client.base_url
|
385
|
-
request_url = request_url.gsub('{
|
634
|
+
request_url = request_url.gsub('{Endpoint}', @client.endpoint)
|
386
635
|
|
387
636
|
options = {
|
388
637
|
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
@@ -402,6 +651,8 @@ module Azure::CognitiveServices::Face::V1_0
|
|
402
651
|
end
|
403
652
|
|
404
653
|
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
654
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
655
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
405
656
|
# Deserialize Response
|
406
657
|
if status_code == 200
|
407
658
|
begin
|
@@ -438,6 +689,17 @@ module Azure::CognitiveServices::Face::V1_0
|
|
438
689
|
#
|
439
690
|
# Verify whether two faces belong to a same person or whether one face belongs
|
440
691
|
# to a person.
|
692
|
+
# <br/>
|
693
|
+
# Remarks:<br />
|
694
|
+
# * Higher face image quality means better identification precision. Please
|
695
|
+
# consider high-quality faces: frontal, clear, and face size is 200x200 pixels
|
696
|
+
# (100 pixels between eyes) or bigger.
|
697
|
+
# * For the scenarios that are sensitive to accuracy please make your own
|
698
|
+
# judgment.
|
699
|
+
# * The 'recognitionModel' associated with the query faces' faceIds should be
|
700
|
+
# the same as the 'recognitionModel' used by the target face, person group or
|
701
|
+
# large person group.
|
702
|
+
#
|
441
703
|
#
|
442
704
|
# @param face_id1 FaceId of the first face, comes from Face - Detect
|
443
705
|
# @param face_id2 FaceId of the second face, comes from Face - Detect
|
@@ -454,6 +716,17 @@ module Azure::CognitiveServices::Face::V1_0
|
|
454
716
|
#
|
455
717
|
# Verify whether two faces belong to a same person or whether one face belongs
|
456
718
|
# to a person.
|
719
|
+
# <br/>
|
720
|
+
# Remarks:<br />
|
721
|
+
# * Higher face image quality means better identification precision. Please
|
722
|
+
# consider high-quality faces: frontal, clear, and face size is 200x200 pixels
|
723
|
+
# (100 pixels between eyes) or bigger.
|
724
|
+
# * For the scenarios that are sensitive to accuracy please make your own
|
725
|
+
# judgment.
|
726
|
+
# * The 'recognitionModel' associated with the query faces' faceIds should be
|
727
|
+
# the same as the 'recognitionModel' used by the target face, person group or
|
728
|
+
# large person group.
|
729
|
+
#
|
457
730
|
#
|
458
731
|
# @param face_id1 FaceId of the first face, comes from Face - Detect
|
459
732
|
# @param face_id2 FaceId of the second face, comes from Face - Detect
|
@@ -469,6 +742,17 @@ module Azure::CognitiveServices::Face::V1_0
|
|
469
742
|
#
|
470
743
|
# Verify whether two faces belong to a same person or whether one face belongs
|
471
744
|
# to a person.
|
745
|
+
# <br/>
|
746
|
+
# Remarks:<br />
|
747
|
+
# * Higher face image quality means better identification precision. Please
|
748
|
+
# consider high-quality faces: frontal, clear, and face size is 200x200 pixels
|
749
|
+
# (100 pixels between eyes) or bigger.
|
750
|
+
# * For the scenarios that are sensitive to accuracy please make your own
|
751
|
+
# judgment.
|
752
|
+
# * The 'recognitionModel' associated with the query faces' faceIds should be
|
753
|
+
# the same as the 'recognitionModel' used by the target face, person group or
|
754
|
+
# large person group.
|
755
|
+
#
|
472
756
|
#
|
473
757
|
# @param face_id1 FaceId of the first face, comes from Face - Detect
|
474
758
|
# @param face_id2 FaceId of the second face, comes from Face - Detect
|
@@ -478,7 +762,7 @@ module Azure::CognitiveServices::Face::V1_0
|
|
478
762
|
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
479
763
|
#
|
480
764
|
def verify_face_to_face_async(face_id1, face_id2, custom_headers:nil)
|
481
|
-
fail ArgumentError, '@client.
|
765
|
+
fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
|
482
766
|
fail ArgumentError, 'face_id1 is nil' if face_id1.nil?
|
483
767
|
fail ArgumentError, 'face_id2 is nil' if face_id2.nil?
|
484
768
|
|
@@ -503,7 +787,7 @@ module Azure::CognitiveServices::Face::V1_0
|
|
503
787
|
path_template = 'verify'
|
504
788
|
|
505
789
|
request_url = @base_url || @client.base_url
|
506
|
-
request_url = request_url.gsub('{
|
790
|
+
request_url = request_url.gsub('{Endpoint}', @client.endpoint)
|
507
791
|
|
508
792
|
options = {
|
509
793
|
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
@@ -523,6 +807,8 @@ module Azure::CognitiveServices::Face::V1_0
|
|
523
807
|
end
|
524
808
|
|
525
809
|
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
810
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
811
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
526
812
|
# Deserialize Response
|
527
813
|
if status_code == 200
|
528
814
|
begin
|
@@ -541,10 +827,69 @@ module Azure::CognitiveServices::Face::V1_0
|
|
541
827
|
end
|
542
828
|
|
543
829
|
#
|
544
|
-
# Detect human faces in an image
|
545
|
-
#
|
546
|
-
#
|
547
|
-
#
|
830
|
+
# Detect human faces in an image, return face rectangles, and optionally with
|
831
|
+
# faceIds, landmarks, and attributes.<br />
|
832
|
+
# * No image will be stored. Only the extracted face feature will be stored on
|
833
|
+
# server. The faceId is an identifier of the face feature and will be used in
|
834
|
+
# [Face -
|
835
|
+
# Identify](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395239),
|
836
|
+
# [Face -
|
837
|
+
# Verify](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039523a),
|
838
|
+
# and [Face - Find
|
839
|
+
# Similar](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395237).
|
840
|
+
# The stored face feature(s) will expire and be deleted 24 hours after the
|
841
|
+
# original detection call.
|
842
|
+
# * Optional parameters include faceId, landmarks, and attributes. Attributes
|
843
|
+
# include age, gender, headPose, smile, facialHair, glasses, emotion, hair,
|
844
|
+
# makeup, occlusion, accessories, blur, exposure and noise. Some of the results
|
845
|
+
# returned for specific attributes may not be highly accurate.
|
846
|
+
# * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed
|
847
|
+
# image file size is from 1KB to 6MB.
|
848
|
+
# * Up to 100 faces can be returned for an image. Faces are ranked by face
|
849
|
+
# rectangle size from large to small.
|
850
|
+
# * For optimal results when querying [Face -
|
851
|
+
# Identify](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395239),
|
852
|
+
# [Face -
|
853
|
+
# Verify](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039523a),
|
854
|
+
# and [Face - Find
|
855
|
+
# Similar](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395237)
|
856
|
+
# ('returnFaceId' is true), please use faces that are: frontal, clear, and with
|
857
|
+
# a minimum size of 200x200 pixels (100 pixels between eyes).
|
858
|
+
# * The minimum detectable face size is 36x36 pixels in an image no larger than
|
859
|
+
# 1920x1080 pixels. Images with dimensions higher than 1920x1080 pixels will
|
860
|
+
# need a proportionally larger minimum face size.
|
861
|
+
# * Different 'detectionModel' values can be provided. To use and compare
|
862
|
+
# different detection models, please refer to [How to specify a detection
|
863
|
+
# model](https://docs.microsoft.com/en-us/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model)
|
864
|
+
# | Model | Recommended use-case(s) |
|
865
|
+
# | ---------- | -------- |
|
866
|
+
# | 'detection_01': | The default detection model for [Face -
|
867
|
+
# Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236).
|
868
|
+
# Recommend for near frontal face detection. For scenarios with exceptionally
|
869
|
+
# large angle (head-pose) faces, occluded faces or wrong image orientation, the
|
870
|
+
# faces in such cases may not be detected. |
|
871
|
+
# | 'detection_02': | Detection model released in 2019 May with improved
|
872
|
+
# accuracy especially on small, side and blurry faces. |
|
873
|
+
#
|
874
|
+
# * Different 'recognitionModel' values are provided. If follow-up operations
|
875
|
+
# like Verify, Identify, Find Similar are needed, please specify the
|
876
|
+
# recognition model with 'recognitionModel' parameter. The default value for
|
877
|
+
# 'recognitionModel' is 'recognition_01', if latest model needed, please
|
878
|
+
# explicitly specify the model you need in this parameter. Once specified, the
|
879
|
+
# detected faceIds will be associated with the specified recognition model.
|
880
|
+
# More details, please refer to [How to specify a recognition
|
881
|
+
# model](https://docs.microsoft.com/en-us/azure/cognitive-services/face/face-api-how-to-topics/specify-recognition-model)
|
882
|
+
# | Model | Recommended use-case(s) |
|
883
|
+
# | ---------- | -------- |
|
884
|
+
# | 'recognition_01': | The default recognition model for [Face -
|
885
|
+
# Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236).
|
886
|
+
# All those faceIds created before 2019 March are bonded with this recognition
|
887
|
+
# model. |
|
888
|
+
# | 'recognition_02': | Recognition model released in 2019 March.
|
889
|
+
# 'recognition_02' is recommended since its overall accuracy is improved
|
890
|
+
# compared with 'recognition_01'. |
|
891
|
+
#
|
892
|
+
# @param url [String] Publicly reachable URL of an image
|
548
893
|
# @param return_face_id [Boolean] A value indicating whether the operation
|
549
894
|
# should return faceIds of detected faces.
|
550
895
|
# @param return_face_landmarks [Boolean] A value indicating whether the
|
@@ -554,21 +899,95 @@ module Azure::CognitiveServices::Face::V1_0
|
|
554
899
|
# "returnFaceAttributes=age,gender". Supported face attributes include age,
|
555
900
|
# gender, headPose, smile, facialHair, glasses and emotion. Note that each face
|
556
901
|
# attribute analysis has additional computational and time cost.
|
902
|
+
# @param recognition_model [RecognitionModel] Name of recognition model.
|
903
|
+
# Recognition model is used when the face features are extracted and associated
|
904
|
+
# with detected faceIds, (Large)FaceList or (Large)PersonGroup. A recognition
|
905
|
+
# model name can be provided when performing Face - Detect or (Large)FaceList -
|
906
|
+
# Create or (Large)PersonGroup - Create. The default value is 'recognition_01',
|
907
|
+
# if latest model needed, please explicitly specify the model you need.
|
908
|
+
# Possible values include: 'recognition_01', 'recognition_02'
|
909
|
+
# @param return_recognition_model [Boolean] A value indicating whether the
|
910
|
+
# operation should return 'recognitionModel' in response.
|
911
|
+
# @param detection_model [DetectionModel] Name of detection model. Detection
|
912
|
+
# model is used to detect faces in the submitted image. A detection model name
|
913
|
+
# can be provided when performing Face - Detect or (Large)FaceList - Add Face
|
914
|
+
# or (Large)PersonGroup - Add Face. The default value is 'detection_01', if
|
915
|
+
# another model is needed, please explicitly specify it. Possible values
|
916
|
+
# include: 'detection_01', 'detection_02'
|
557
917
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
558
918
|
# will be added to the HTTP request.
|
559
919
|
#
|
560
920
|
# @return [Array] operation results.
|
561
921
|
#
|
562
|
-
def detect_with_url(url, return_face_id:true, return_face_landmarks:false, return_face_attributes:nil, custom_headers:nil)
|
563
|
-
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!
|
922
|
+
def detect_with_url(url, return_face_id:true, return_face_landmarks:false, return_face_attributes:nil, recognition_model:nil, return_recognition_model:false, detection_model:nil, custom_headers:nil)
|
923
|
+
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, detection_model:detection_model, custom_headers:custom_headers).value!
|
564
924
|
response.body unless response.nil?
|
565
925
|
end
|
566
926
|
|
567
927
|
#
|
568
|
-
# Detect human faces in an image
|
569
|
-
#
|
570
|
-
#
|
571
|
-
#
|
928
|
+
# Detect human faces in an image, return face rectangles, and optionally with
|
929
|
+
# faceIds, landmarks, and attributes.<br />
|
930
|
+
# * No image will be stored. Only the extracted face feature will be stored on
|
931
|
+
# server. The faceId is an identifier of the face feature and will be used in
|
932
|
+
# [Face -
|
933
|
+
# Identify](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395239),
|
934
|
+
# [Face -
|
935
|
+
# Verify](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039523a),
|
936
|
+
# and [Face - Find
|
937
|
+
# Similar](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395237).
|
938
|
+
# The stored face feature(s) will expire and be deleted 24 hours after the
|
939
|
+
# original detection call.
|
940
|
+
# * Optional parameters include faceId, landmarks, and attributes. Attributes
|
941
|
+
# include age, gender, headPose, smile, facialHair, glasses, emotion, hair,
|
942
|
+
# makeup, occlusion, accessories, blur, exposure and noise. Some of the results
|
943
|
+
# returned for specific attributes may not be highly accurate.
|
944
|
+
# * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed
|
945
|
+
# image file size is from 1KB to 6MB.
|
946
|
+
# * Up to 100 faces can be returned for an image. Faces are ranked by face
|
947
|
+
# rectangle size from large to small.
|
948
|
+
# * For optimal results when querying [Face -
|
949
|
+
# Identify](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395239),
|
950
|
+
# [Face -
|
951
|
+
# Verify](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039523a),
|
952
|
+
# and [Face - Find
|
953
|
+
# Similar](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395237)
|
954
|
+
# ('returnFaceId' is true), please use faces that are: frontal, clear, and with
|
955
|
+
# a minimum size of 200x200 pixels (100 pixels between eyes).
|
956
|
+
# * The minimum detectable face size is 36x36 pixels in an image no larger than
|
957
|
+
# 1920x1080 pixels. Images with dimensions higher than 1920x1080 pixels will
|
958
|
+
# need a proportionally larger minimum face size.
|
959
|
+
# * Different 'detectionModel' values can be provided. To use and compare
|
960
|
+
# different detection models, please refer to [How to specify a detection
|
961
|
+
# model](https://docs.microsoft.com/en-us/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model)
|
962
|
+
# | Model | Recommended use-case(s) |
|
963
|
+
# | ---------- | -------- |
|
964
|
+
# | 'detection_01': | The default detection model for [Face -
|
965
|
+
# Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236).
|
966
|
+
# Recommend for near frontal face detection. For scenarios with exceptionally
|
967
|
+
# large angle (head-pose) faces, occluded faces or wrong image orientation, the
|
968
|
+
# faces in such cases may not be detected. |
|
969
|
+
# | 'detection_02': | Detection model released in 2019 May with improved
|
970
|
+
# accuracy especially on small, side and blurry faces. |
|
971
|
+
#
|
972
|
+
# * Different 'recognitionModel' values are provided. If follow-up operations
|
973
|
+
# like Verify, Identify, Find Similar are needed, please specify the
|
974
|
+
# recognition model with 'recognitionModel' parameter. The default value for
|
975
|
+
# 'recognitionModel' is 'recognition_01', if latest model needed, please
|
976
|
+
# explicitly specify the model you need in this parameter. Once specified, the
|
977
|
+
# detected faceIds will be associated with the specified recognition model.
|
978
|
+
# More details, please refer to [How to specify a recognition
|
979
|
+
# model](https://docs.microsoft.com/en-us/azure/cognitive-services/face/face-api-how-to-topics/specify-recognition-model)
|
980
|
+
# | Model | Recommended use-case(s) |
|
981
|
+
# | ---------- | -------- |
|
982
|
+
# | 'recognition_01': | The default recognition model for [Face -
|
983
|
+
# Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236).
|
984
|
+
# All those faceIds created before 2019 March are bonded with this recognition
|
985
|
+
# model. |
|
986
|
+
# | 'recognition_02': | Recognition model released in 2019 March.
|
987
|
+
# 'recognition_02' is recommended since its overall accuracy is improved
|
988
|
+
# compared with 'recognition_01'. |
|
989
|
+
#
|
990
|
+
# @param url [String] Publicly reachable URL of an image
|
572
991
|
# @param return_face_id [Boolean] A value indicating whether the operation
|
573
992
|
# should return faceIds of detected faces.
|
574
993
|
# @param return_face_landmarks [Boolean] A value indicating whether the
|
@@ -578,20 +997,94 @@ module Azure::CognitiveServices::Face::V1_0
|
|
578
997
|
# "returnFaceAttributes=age,gender". Supported face attributes include age,
|
579
998
|
# gender, headPose, smile, facialHair, glasses and emotion. Note that each face
|
580
999
|
# attribute analysis has additional computational and time cost.
|
1000
|
+
# @param recognition_model [RecognitionModel] Name of recognition model.
|
1001
|
+
# Recognition model is used when the face features are extracted and associated
|
1002
|
+
# with detected faceIds, (Large)FaceList or (Large)PersonGroup. A recognition
|
1003
|
+
# model name can be provided when performing Face - Detect or (Large)FaceList -
|
1004
|
+
# Create or (Large)PersonGroup - Create. The default value is 'recognition_01',
|
1005
|
+
# if latest model needed, please explicitly specify the model you need.
|
1006
|
+
# Possible values include: 'recognition_01', 'recognition_02'
|
1007
|
+
# @param return_recognition_model [Boolean] A value indicating whether the
|
1008
|
+
# operation should return 'recognitionModel' in response.
|
1009
|
+
# @param detection_model [DetectionModel] Name of detection model. Detection
|
1010
|
+
# model is used to detect faces in the submitted image. A detection model name
|
1011
|
+
# can be provided when performing Face - Detect or (Large)FaceList - Add Face
|
1012
|
+
# or (Large)PersonGroup - Add Face. The default value is 'detection_01', if
|
1013
|
+
# another model is needed, please explicitly specify it. Possible values
|
1014
|
+
# include: 'detection_01', 'detection_02'
|
581
1015
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
582
1016
|
# will be added to the HTTP request.
|
583
1017
|
#
|
584
1018
|
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
585
1019
|
#
|
586
|
-
def detect_with_url_with_http_info(url, return_face_id:true, return_face_landmarks:false, return_face_attributes:nil, custom_headers:nil)
|
587
|
-
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!
|
1020
|
+
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, detection_model:nil, custom_headers:nil)
|
1021
|
+
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, detection_model:detection_model, custom_headers:custom_headers).value!
|
588
1022
|
end
|
589
1023
|
|
590
1024
|
#
|
591
|
-
# Detect human faces in an image
|
592
|
-
#
|
593
|
-
#
|
594
|
-
#
|
1025
|
+
# Detect human faces in an image, return face rectangles, and optionally with
|
1026
|
+
# faceIds, landmarks, and attributes.<br />
|
1027
|
+
# * No image will be stored. Only the extracted face feature will be stored on
|
1028
|
+
# server. The faceId is an identifier of the face feature and will be used in
|
1029
|
+
# [Face -
|
1030
|
+
# Identify](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395239),
|
1031
|
+
# [Face -
|
1032
|
+
# Verify](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039523a),
|
1033
|
+
# and [Face - Find
|
1034
|
+
# Similar](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395237).
|
1035
|
+
# The stored face feature(s) will expire and be deleted 24 hours after the
|
1036
|
+
# original detection call.
|
1037
|
+
# * Optional parameters include faceId, landmarks, and attributes. Attributes
|
1038
|
+
# include age, gender, headPose, smile, facialHair, glasses, emotion, hair,
|
1039
|
+
# makeup, occlusion, accessories, blur, exposure and noise. Some of the results
|
1040
|
+
# returned for specific attributes may not be highly accurate.
|
1041
|
+
# * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed
|
1042
|
+
# image file size is from 1KB to 6MB.
|
1043
|
+
# * Up to 100 faces can be returned for an image. Faces are ranked by face
|
1044
|
+
# rectangle size from large to small.
|
1045
|
+
# * For optimal results when querying [Face -
|
1046
|
+
# Identify](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395239),
|
1047
|
+
# [Face -
|
1048
|
+
# Verify](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039523a),
|
1049
|
+
# and [Face - Find
|
1050
|
+
# Similar](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395237)
|
1051
|
+
# ('returnFaceId' is true), please use faces that are: frontal, clear, and with
|
1052
|
+
# a minimum size of 200x200 pixels (100 pixels between eyes).
|
1053
|
+
# * The minimum detectable face size is 36x36 pixels in an image no larger than
|
1054
|
+
# 1920x1080 pixels. Images with dimensions higher than 1920x1080 pixels will
|
1055
|
+
# need a proportionally larger minimum face size.
|
1056
|
+
# * Different 'detectionModel' values can be provided. To use and compare
|
1057
|
+
# different detection models, please refer to [How to specify a detection
|
1058
|
+
# model](https://docs.microsoft.com/en-us/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model)
|
1059
|
+
# | Model | Recommended use-case(s) |
|
1060
|
+
# | ---------- | -------- |
|
1061
|
+
# | 'detection_01': | The default detection model for [Face -
|
1062
|
+
# Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236).
|
1063
|
+
# Recommend for near frontal face detection. For scenarios with exceptionally
|
1064
|
+
# large angle (head-pose) faces, occluded faces or wrong image orientation, the
|
1065
|
+
# faces in such cases may not be detected. |
|
1066
|
+
# | 'detection_02': | Detection model released in 2019 May with improved
|
1067
|
+
# accuracy especially on small, side and blurry faces. |
|
1068
|
+
#
|
1069
|
+
# * Different 'recognitionModel' values are provided. If follow-up operations
|
1070
|
+
# like Verify, Identify, Find Similar are needed, please specify the
|
1071
|
+
# recognition model with 'recognitionModel' parameter. The default value for
|
1072
|
+
# 'recognitionModel' is 'recognition_01', if latest model needed, please
|
1073
|
+
# explicitly specify the model you need in this parameter. Once specified, the
|
1074
|
+
# detected faceIds will be associated with the specified recognition model.
|
1075
|
+
# More details, please refer to [How to specify a recognition
|
1076
|
+
# model](https://docs.microsoft.com/en-us/azure/cognitive-services/face/face-api-how-to-topics/specify-recognition-model)
|
1077
|
+
# | Model | Recommended use-case(s) |
|
1078
|
+
# | ---------- | -------- |
|
1079
|
+
# | 'recognition_01': | The default recognition model for [Face -
|
1080
|
+
# Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236).
|
1081
|
+
# All those faceIds created before 2019 March are bonded with this recognition
|
1082
|
+
# model. |
|
1083
|
+
# | 'recognition_02': | Recognition model released in 2019 March.
|
1084
|
+
# 'recognition_02' is recommended since its overall accuracy is improved
|
1085
|
+
# compared with 'recognition_01'. |
|
1086
|
+
#
|
1087
|
+
# @param url [String] Publicly reachable URL of an image
|
595
1088
|
# @param return_face_id [Boolean] A value indicating whether the operation
|
596
1089
|
# should return faceIds of detected faces.
|
597
1090
|
# @param return_face_landmarks [Boolean] A value indicating whether the
|
@@ -601,13 +1094,28 @@ module Azure::CognitiveServices::Face::V1_0
|
|
601
1094
|
# "returnFaceAttributes=age,gender". Supported face attributes include age,
|
602
1095
|
# gender, headPose, smile, facialHair, glasses and emotion. Note that each face
|
603
1096
|
# attribute analysis has additional computational and time cost.
|
1097
|
+
# @param recognition_model [RecognitionModel] Name of recognition model.
|
1098
|
+
# Recognition model is used when the face features are extracted and associated
|
1099
|
+
# with detected faceIds, (Large)FaceList or (Large)PersonGroup. A recognition
|
1100
|
+
# model name can be provided when performing Face - Detect or (Large)FaceList -
|
1101
|
+
# Create or (Large)PersonGroup - Create. The default value is 'recognition_01',
|
1102
|
+
# if latest model needed, please explicitly specify the model you need.
|
1103
|
+
# Possible values include: 'recognition_01', 'recognition_02'
|
1104
|
+
# @param return_recognition_model [Boolean] A value indicating whether the
|
1105
|
+
# operation should return 'recognitionModel' in response.
|
1106
|
+
# @param detection_model [DetectionModel] Name of detection model. Detection
|
1107
|
+
# model is used to detect faces in the submitted image. A detection model name
|
1108
|
+
# can be provided when performing Face - Detect or (Large)FaceList - Add Face
|
1109
|
+
# or (Large)PersonGroup - Add Face. The default value is 'detection_01', if
|
1110
|
+
# another model is needed, please explicitly specify it. Possible values
|
1111
|
+
# include: 'detection_01', 'detection_02'
|
604
1112
|
# @param [Hash{String => String}] A hash of custom headers that will be added
|
605
1113
|
# to the HTTP request.
|
606
1114
|
#
|
607
1115
|
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
608
1116
|
#
|
609
|
-
def detect_with_url_async(url, return_face_id:true, return_face_landmarks:false, return_face_attributes:nil, custom_headers:nil)
|
610
|
-
fail ArgumentError, '@client.
|
1117
|
+
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, detection_model:nil, custom_headers:nil)
|
1118
|
+
fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
|
611
1119
|
fail ArgumentError, 'url is nil' if url.nil?
|
612
1120
|
|
613
1121
|
image_url = ImageUrl.new
|
@@ -630,11 +1138,11 @@ module Azure::CognitiveServices::Face::V1_0
|
|
630
1138
|
path_template = 'detect'
|
631
1139
|
|
632
1140
|
request_url = @base_url || @client.base_url
|
633
|
-
request_url = request_url.gsub('{
|
1141
|
+
request_url = request_url.gsub('{Endpoint}', @client.endpoint)
|
634
1142
|
|
635
1143
|
options = {
|
636
1144
|
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
637
|
-
query_params: {'returnFaceId' => return_face_id,'returnFaceLandmarks' => return_face_landmarks,'returnFaceAttributes' => return_face_attributes.nil? ? nil : return_face_attributes.join(',')},
|
1145
|
+
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,'detectionModel' => detection_model},
|
638
1146
|
body: request_content,
|
639
1147
|
headers: request_headers.merge(custom_headers || {}),
|
640
1148
|
base_url: request_url
|
@@ -651,6 +1159,8 @@ module Azure::CognitiveServices::Face::V1_0
|
|
651
1159
|
end
|
652
1160
|
|
653
1161
|
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
1162
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
1163
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
654
1164
|
# Deserialize Response
|
655
1165
|
if status_code == 200
|
656
1166
|
begin
|
@@ -688,19 +1198,25 @@ module Azure::CognitiveServices::Face::V1_0
|
|
688
1198
|
# Verify whether two faces belong to a same person. Compares a face Id with a
|
689
1199
|
# Person Id
|
690
1200
|
#
|
691
|
-
# @param face_id FaceId the face, comes from Face - Detect
|
1201
|
+
# @param face_id FaceId of the face, comes from Face - Detect
|
1202
|
+
# @param person_id Specify a certain person in a person group or a large person
|
1203
|
+
# group. personId is created in PersonGroup Person - Create or LargePersonGroup
|
1204
|
+
# Person - Create.
|
692
1205
|
# @param person_group_id [String] Using existing personGroupId and personId for
|
693
|
-
# fast loading a specified person. personGroupId is created in
|
694
|
-
#
|
695
|
-
#
|
696
|
-
#
|
1206
|
+
# fast loading a specified person. personGroupId is created in PersonGroup -
|
1207
|
+
# Create. Parameter personGroupId and largePersonGroupId should not be provided
|
1208
|
+
# at the same time.
|
1209
|
+
# @param large_person_group_id [String] Using existing largePersonGroupId and
|
1210
|
+
# personId for fast loading a specified person. largePersonGroupId is created
|
1211
|
+
# in LargePersonGroup - Create. Parameter personGroupId and largePersonGroupId
|
1212
|
+
# should not be provided at the same time.
|
697
1213
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
698
1214
|
# will be added to the HTTP request.
|
699
1215
|
#
|
700
1216
|
# @return [VerifyResult] operation results.
|
701
1217
|
#
|
702
|
-
def verify_face_to_person(face_id, person_group_id,
|
703
|
-
response = verify_face_to_person_async(face_id, person_group_id,
|
1218
|
+
def verify_face_to_person(face_id, person_id, person_group_id:nil, large_person_group_id:nil, custom_headers:nil)
|
1219
|
+
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!
|
704
1220
|
response.body unless response.nil?
|
705
1221
|
end
|
706
1222
|
|
@@ -708,48 +1224,62 @@ module Azure::CognitiveServices::Face::V1_0
|
|
708
1224
|
# Verify whether two faces belong to a same person. Compares a face Id with a
|
709
1225
|
# Person Id
|
710
1226
|
#
|
711
|
-
# @param face_id FaceId the face, comes from Face - Detect
|
1227
|
+
# @param face_id FaceId of the face, comes from Face - Detect
|
1228
|
+
# @param person_id Specify a certain person in a person group or a large person
|
1229
|
+
# group. personId is created in PersonGroup Person - Create or LargePersonGroup
|
1230
|
+
# Person - Create.
|
712
1231
|
# @param person_group_id [String] Using existing personGroupId and personId for
|
713
|
-
# fast loading a specified person. personGroupId is created in
|
714
|
-
#
|
715
|
-
#
|
716
|
-
#
|
1232
|
+
# fast loading a specified person. personGroupId is created in PersonGroup -
|
1233
|
+
# Create. Parameter personGroupId and largePersonGroupId should not be provided
|
1234
|
+
# at the same time.
|
1235
|
+
# @param large_person_group_id [String] Using existing largePersonGroupId and
|
1236
|
+
# personId for fast loading a specified person. largePersonGroupId is created
|
1237
|
+
# in LargePersonGroup - Create. Parameter personGroupId and largePersonGroupId
|
1238
|
+
# should not be provided at the same time.
|
717
1239
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
718
1240
|
# will be added to the HTTP request.
|
719
1241
|
#
|
720
1242
|
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
721
1243
|
#
|
722
|
-
def verify_face_to_person_with_http_info(face_id, person_group_id,
|
723
|
-
verify_face_to_person_async(face_id, person_group_id,
|
1244
|
+
def verify_face_to_person_with_http_info(face_id, person_id, person_group_id:nil, large_person_group_id:nil, custom_headers:nil)
|
1245
|
+
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!
|
724
1246
|
end
|
725
1247
|
|
726
1248
|
#
|
727
1249
|
# Verify whether two faces belong to a same person. Compares a face Id with a
|
728
1250
|
# Person Id
|
729
1251
|
#
|
730
|
-
# @param face_id FaceId the face, comes from Face - Detect
|
1252
|
+
# @param face_id FaceId of the face, comes from Face - Detect
|
1253
|
+
# @param person_id Specify a certain person in a person group or a large person
|
1254
|
+
# group. personId is created in PersonGroup Person - Create or LargePersonGroup
|
1255
|
+
# Person - Create.
|
731
1256
|
# @param person_group_id [String] Using existing personGroupId and personId for
|
732
|
-
# fast loading a specified person. personGroupId is created in
|
733
|
-
#
|
734
|
-
#
|
735
|
-
#
|
1257
|
+
# fast loading a specified person. personGroupId is created in PersonGroup -
|
1258
|
+
# Create. Parameter personGroupId and largePersonGroupId should not be provided
|
1259
|
+
# at the same time.
|
1260
|
+
# @param large_person_group_id [String] Using existing largePersonGroupId and
|
1261
|
+
# personId for fast loading a specified person. largePersonGroupId is created
|
1262
|
+
# in LargePersonGroup - Create. Parameter personGroupId and largePersonGroupId
|
1263
|
+
# should not be provided at the same time.
|
736
1264
|
# @param [Hash{String => String}] A hash of custom headers that will be added
|
737
1265
|
# to the HTTP request.
|
738
1266
|
#
|
739
1267
|
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
740
1268
|
#
|
741
|
-
def verify_face_to_person_async(face_id, person_group_id,
|
742
|
-
fail ArgumentError, '@client.
|
1269
|
+
def verify_face_to_person_async(face_id, person_id, person_group_id:nil, large_person_group_id:nil, custom_headers:nil)
|
1270
|
+
fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
|
743
1271
|
fail ArgumentError, 'face_id is nil' if face_id.nil?
|
744
|
-
fail ArgumentError, 'person_group_id is nil' if person_group_id.nil?
|
745
1272
|
fail ArgumentError, "'person_group_id' should satisfy the constraint - 'MaxLength': '64'" if !person_group_id.nil? && person_group_id.length > 64
|
746
1273
|
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?
|
1274
|
+
fail ArgumentError, "'large_person_group_id' should satisfy the constraint - 'MaxLength': '64'" if !large_person_group_id.nil? && large_person_group_id.length > 64
|
1275
|
+
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?
|
747
1276
|
fail ArgumentError, 'person_id is nil' if person_id.nil?
|
748
1277
|
|
749
1278
|
body = VerifyFaceToPersonRequest.new
|
750
|
-
unless face_id.nil? && person_group_id.nil? && person_id.nil?
|
1279
|
+
unless face_id.nil? && person_group_id.nil? && large_person_group_id.nil? && person_id.nil?
|
751
1280
|
body.face_id = face_id
|
752
1281
|
body.person_group_id = person_group_id
|
1282
|
+
body.large_person_group_id = large_person_group_id
|
753
1283
|
body.person_id = person_id
|
754
1284
|
end
|
755
1285
|
|
@@ -768,7 +1298,7 @@ module Azure::CognitiveServices::Face::V1_0
|
|
768
1298
|
path_template = 'verify'
|
769
1299
|
|
770
1300
|
request_url = @base_url || @client.base_url
|
771
|
-
request_url = request_url.gsub('{
|
1301
|
+
request_url = request_url.gsub('{Endpoint}', @client.endpoint)
|
772
1302
|
|
773
1303
|
options = {
|
774
1304
|
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
@@ -788,6 +1318,8 @@ module Azure::CognitiveServices::Face::V1_0
|
|
788
1318
|
end
|
789
1319
|
|
790
1320
|
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
1321
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
1322
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
791
1323
|
# Deserialize Response
|
792
1324
|
if status_code == 200
|
793
1325
|
begin
|
@@ -806,8 +1338,67 @@ module Azure::CognitiveServices::Face::V1_0
|
|
806
1338
|
end
|
807
1339
|
|
808
1340
|
#
|
809
|
-
# Detect human faces in an image
|
810
|
-
#
|
1341
|
+
# Detect human faces in an image, return face rectangles, and optionally with
|
1342
|
+
# faceIds, landmarks, and attributes.<br />
|
1343
|
+
# * No image will be stored. Only the extracted face feature will be stored on
|
1344
|
+
# server. The faceId is an identifier of the face feature and will be used in
|
1345
|
+
# [Face -
|
1346
|
+
# Identify](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395239),
|
1347
|
+
# [Face -
|
1348
|
+
# Verify](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039523a),
|
1349
|
+
# and [Face - Find
|
1350
|
+
# Similar](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395237).
|
1351
|
+
# The stored face feature(s) will expire and be deleted 24 hours after the
|
1352
|
+
# original detection call.
|
1353
|
+
# * Optional parameters include faceId, landmarks, and attributes. Attributes
|
1354
|
+
# include age, gender, headPose, smile, facialHair, glasses, emotion, hair,
|
1355
|
+
# makeup, occlusion, accessories, blur, exposure and noise. Some of the results
|
1356
|
+
# returned for specific attributes may not be highly accurate.
|
1357
|
+
# * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed
|
1358
|
+
# image file size is from 1KB to 6MB.
|
1359
|
+
# * Up to 100 faces can be returned for an image. Faces are ranked by face
|
1360
|
+
# rectangle size from large to small.
|
1361
|
+
# * For optimal results when querying [Face -
|
1362
|
+
# Identify](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395239),
|
1363
|
+
# [Face -
|
1364
|
+
# Verify](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039523a),
|
1365
|
+
# and [Face - Find
|
1366
|
+
# Similar](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395237)
|
1367
|
+
# ('returnFaceId' is true), please use faces that are: frontal, clear, and with
|
1368
|
+
# a minimum size of 200x200 pixels (100 pixels between eyes).
|
1369
|
+
# * The minimum detectable face size is 36x36 pixels in an image no larger than
|
1370
|
+
# 1920x1080 pixels. Images with dimensions higher than 1920x1080 pixels will
|
1371
|
+
# need a proportionally larger minimum face size.
|
1372
|
+
# * Different 'detectionModel' values can be provided. To use and compare
|
1373
|
+
# different detection models, please refer to [How to specify a detection
|
1374
|
+
# model](https://docs.microsoft.com/en-us/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model)
|
1375
|
+
# | Model | Recommended use-case(s) |
|
1376
|
+
# | ---------- | -------- |
|
1377
|
+
# | 'detection_01': | The default detection model for [Face -
|
1378
|
+
# Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236).
|
1379
|
+
# Recommend for near frontal face detection. For scenarios with exceptionally
|
1380
|
+
# large angle (head-pose) faces, occluded faces or wrong image orientation, the
|
1381
|
+
# faces in such cases may not be detected. |
|
1382
|
+
# | 'detection_02': | Detection model released in 2019 May with improved
|
1383
|
+
# accuracy especially on small, side and blurry faces. |
|
1384
|
+
#
|
1385
|
+
# * Different 'recognitionModel' values are provided. If follow-up operations
|
1386
|
+
# like Verify, Identify, Find Similar are needed, please specify the
|
1387
|
+
# recognition model with 'recognitionModel' parameter. The default value for
|
1388
|
+
# 'recognitionModel' is 'recognition_01', if latest model needed, please
|
1389
|
+
# explicitly specify the model you need in this parameter. Once specified, the
|
1390
|
+
# detected faceIds will be associated with the specified recognition model.
|
1391
|
+
# More details, please refer to [How to specify a recognition
|
1392
|
+
# model](https://docs.microsoft.com/en-us/azure/cognitive-services/face/face-api-how-to-topics/specify-recognition-model)
|
1393
|
+
# | Model | Recommended use-case(s) |
|
1394
|
+
# | ---------- | -------- |
|
1395
|
+
# | 'recognition_01': | The default recognition model for [Face -
|
1396
|
+
# Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236).
|
1397
|
+
# All those faceIds created before 2019 March are bonded with this recognition
|
1398
|
+
# model. |
|
1399
|
+
# | 'recognition_02': | Recognition model released in 2019 March.
|
1400
|
+
# 'recognition_02' is recommended since its overall accuracy is improved
|
1401
|
+
# compared with 'recognition_01'. |
|
811
1402
|
#
|
812
1403
|
# @param image An image stream.
|
813
1404
|
# @param return_face_id [Boolean] A value indicating whether the operation
|
@@ -819,19 +1410,93 @@ module Azure::CognitiveServices::Face::V1_0
|
|
819
1410
|
# "returnFaceAttributes=age,gender". Supported face attributes include age,
|
820
1411
|
# gender, headPose, smile, facialHair, glasses and emotion. Note that each face
|
821
1412
|
# attribute analysis has additional computational and time cost.
|
1413
|
+
# @param recognition_model [RecognitionModel] Name of recognition model.
|
1414
|
+
# Recognition model is used when the face features are extracted and associated
|
1415
|
+
# with detected faceIds, (Large)FaceList or (Large)PersonGroup. A recognition
|
1416
|
+
# model name can be provided when performing Face - Detect or (Large)FaceList -
|
1417
|
+
# Create or (Large)PersonGroup - Create. The default value is 'recognition_01',
|
1418
|
+
# if latest model needed, please explicitly specify the model you need.
|
1419
|
+
# Possible values include: 'recognition_01', 'recognition_02'
|
1420
|
+
# @param return_recognition_model [Boolean] A value indicating whether the
|
1421
|
+
# operation should return 'recognitionModel' in response.
|
1422
|
+
# @param detection_model [DetectionModel] Name of detection model. Detection
|
1423
|
+
# model is used to detect faces in the submitted image. A detection model name
|
1424
|
+
# can be provided when performing Face - Detect or (Large)FaceList - Add Face
|
1425
|
+
# or (Large)PersonGroup - Add Face. The default value is 'detection_01', if
|
1426
|
+
# another model is needed, please explicitly specify it. Possible values
|
1427
|
+
# include: 'detection_01', 'detection_02'
|
822
1428
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
823
1429
|
# will be added to the HTTP request.
|
824
1430
|
#
|
825
1431
|
# @return [Array] operation results.
|
826
1432
|
#
|
827
|
-
def detect_with_stream(image, return_face_id:true, return_face_landmarks:false, return_face_attributes:nil, custom_headers:nil)
|
828
|
-
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!
|
1433
|
+
def detect_with_stream(image, return_face_id:true, return_face_landmarks:false, return_face_attributes:nil, recognition_model:nil, return_recognition_model:false, detection_model:nil, custom_headers:nil)
|
1434
|
+
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, detection_model:detection_model, custom_headers:custom_headers).value!
|
829
1435
|
response.body unless response.nil?
|
830
1436
|
end
|
831
1437
|
|
832
1438
|
#
|
833
|
-
# Detect human faces in an image
|
834
|
-
#
|
1439
|
+
# Detect human faces in an image, return face rectangles, and optionally with
|
1440
|
+
# faceIds, landmarks, and attributes.<br />
|
1441
|
+
# * No image will be stored. Only the extracted face feature will be stored on
|
1442
|
+
# server. The faceId is an identifier of the face feature and will be used in
|
1443
|
+
# [Face -
|
1444
|
+
# Identify](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395239),
|
1445
|
+
# [Face -
|
1446
|
+
# Verify](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039523a),
|
1447
|
+
# and [Face - Find
|
1448
|
+
# Similar](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395237).
|
1449
|
+
# The stored face feature(s) will expire and be deleted 24 hours after the
|
1450
|
+
# original detection call.
|
1451
|
+
# * Optional parameters include faceId, landmarks, and attributes. Attributes
|
1452
|
+
# include age, gender, headPose, smile, facialHair, glasses, emotion, hair,
|
1453
|
+
# makeup, occlusion, accessories, blur, exposure and noise. Some of the results
|
1454
|
+
# returned for specific attributes may not be highly accurate.
|
1455
|
+
# * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed
|
1456
|
+
# image file size is from 1KB to 6MB.
|
1457
|
+
# * Up to 100 faces can be returned for an image. Faces are ranked by face
|
1458
|
+
# rectangle size from large to small.
|
1459
|
+
# * For optimal results when querying [Face -
|
1460
|
+
# Identify](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395239),
|
1461
|
+
# [Face -
|
1462
|
+
# Verify](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039523a),
|
1463
|
+
# and [Face - Find
|
1464
|
+
# Similar](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395237)
|
1465
|
+
# ('returnFaceId' is true), please use faces that are: frontal, clear, and with
|
1466
|
+
# a minimum size of 200x200 pixels (100 pixels between eyes).
|
1467
|
+
# * The minimum detectable face size is 36x36 pixels in an image no larger than
|
1468
|
+
# 1920x1080 pixels. Images with dimensions higher than 1920x1080 pixels will
|
1469
|
+
# need a proportionally larger minimum face size.
|
1470
|
+
# * Different 'detectionModel' values can be provided. To use and compare
|
1471
|
+
# different detection models, please refer to [How to specify a detection
|
1472
|
+
# model](https://docs.microsoft.com/en-us/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model)
|
1473
|
+
# | Model | Recommended use-case(s) |
|
1474
|
+
# | ---------- | -------- |
|
1475
|
+
# | 'detection_01': | The default detection model for [Face -
|
1476
|
+
# Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236).
|
1477
|
+
# Recommend for near frontal face detection. For scenarios with exceptionally
|
1478
|
+
# large angle (head-pose) faces, occluded faces or wrong image orientation, the
|
1479
|
+
# faces in such cases may not be detected. |
|
1480
|
+
# | 'detection_02': | Detection model released in 2019 May with improved
|
1481
|
+
# accuracy especially on small, side and blurry faces. |
|
1482
|
+
#
|
1483
|
+
# * Different 'recognitionModel' values are provided. If follow-up operations
|
1484
|
+
# like Verify, Identify, Find Similar are needed, please specify the
|
1485
|
+
# recognition model with 'recognitionModel' parameter. The default value for
|
1486
|
+
# 'recognitionModel' is 'recognition_01', if latest model needed, please
|
1487
|
+
# explicitly specify the model you need in this parameter. Once specified, the
|
1488
|
+
# detected faceIds will be associated with the specified recognition model.
|
1489
|
+
# More details, please refer to [How to specify a recognition
|
1490
|
+
# model](https://docs.microsoft.com/en-us/azure/cognitive-services/face/face-api-how-to-topics/specify-recognition-model)
|
1491
|
+
# | Model | Recommended use-case(s) |
|
1492
|
+
# | ---------- | -------- |
|
1493
|
+
# | 'recognition_01': | The default recognition model for [Face -
|
1494
|
+
# Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236).
|
1495
|
+
# All those faceIds created before 2019 March are bonded with this recognition
|
1496
|
+
# model. |
|
1497
|
+
# | 'recognition_02': | Recognition model released in 2019 March.
|
1498
|
+
# 'recognition_02' is recommended since its overall accuracy is improved
|
1499
|
+
# compared with 'recognition_01'. |
|
835
1500
|
#
|
836
1501
|
# @param image An image stream.
|
837
1502
|
# @param return_face_id [Boolean] A value indicating whether the operation
|
@@ -843,18 +1508,92 @@ module Azure::CognitiveServices::Face::V1_0
|
|
843
1508
|
# "returnFaceAttributes=age,gender". Supported face attributes include age,
|
844
1509
|
# gender, headPose, smile, facialHair, glasses and emotion. Note that each face
|
845
1510
|
# attribute analysis has additional computational and time cost.
|
1511
|
+
# @param recognition_model [RecognitionModel] Name of recognition model.
|
1512
|
+
# Recognition model is used when the face features are extracted and associated
|
1513
|
+
# with detected faceIds, (Large)FaceList or (Large)PersonGroup. A recognition
|
1514
|
+
# model name can be provided when performing Face - Detect or (Large)FaceList -
|
1515
|
+
# Create or (Large)PersonGroup - Create. The default value is 'recognition_01',
|
1516
|
+
# if latest model needed, please explicitly specify the model you need.
|
1517
|
+
# Possible values include: 'recognition_01', 'recognition_02'
|
1518
|
+
# @param return_recognition_model [Boolean] A value indicating whether the
|
1519
|
+
# operation should return 'recognitionModel' in response.
|
1520
|
+
# @param detection_model [DetectionModel] Name of detection model. Detection
|
1521
|
+
# model is used to detect faces in the submitted image. A detection model name
|
1522
|
+
# can be provided when performing Face - Detect or (Large)FaceList - Add Face
|
1523
|
+
# or (Large)PersonGroup - Add Face. The default value is 'detection_01', if
|
1524
|
+
# another model is needed, please explicitly specify it. Possible values
|
1525
|
+
# include: 'detection_01', 'detection_02'
|
846
1526
|
# @param custom_headers [Hash{String => String}] A hash of custom headers that
|
847
1527
|
# will be added to the HTTP request.
|
848
1528
|
#
|
849
1529
|
# @return [MsRestAzure::AzureOperationResponse] HTTP response information.
|
850
1530
|
#
|
851
|
-
def detect_with_stream_with_http_info(image, return_face_id:true, return_face_landmarks:false, return_face_attributes:nil, custom_headers:nil)
|
852
|
-
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!
|
1531
|
+
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, detection_model:nil, custom_headers:nil)
|
1532
|
+
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, detection_model:detection_model, custom_headers:custom_headers).value!
|
853
1533
|
end
|
854
1534
|
|
855
1535
|
#
|
856
|
-
# Detect human faces in an image
|
857
|
-
#
|
1536
|
+
# Detect human faces in an image, return face rectangles, and optionally with
|
1537
|
+
# faceIds, landmarks, and attributes.<br />
|
1538
|
+
# * No image will be stored. Only the extracted face feature will be stored on
|
1539
|
+
# server. The faceId is an identifier of the face feature and will be used in
|
1540
|
+
# [Face -
|
1541
|
+
# Identify](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395239),
|
1542
|
+
# [Face -
|
1543
|
+
# Verify](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039523a),
|
1544
|
+
# and [Face - Find
|
1545
|
+
# Similar](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395237).
|
1546
|
+
# The stored face feature(s) will expire and be deleted 24 hours after the
|
1547
|
+
# original detection call.
|
1548
|
+
# * Optional parameters include faceId, landmarks, and attributes. Attributes
|
1549
|
+
# include age, gender, headPose, smile, facialHair, glasses, emotion, hair,
|
1550
|
+
# makeup, occlusion, accessories, blur, exposure and noise. Some of the results
|
1551
|
+
# returned for specific attributes may not be highly accurate.
|
1552
|
+
# * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed
|
1553
|
+
# image file size is from 1KB to 6MB.
|
1554
|
+
# * Up to 100 faces can be returned for an image. Faces are ranked by face
|
1555
|
+
# rectangle size from large to small.
|
1556
|
+
# * For optimal results when querying [Face -
|
1557
|
+
# Identify](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395239),
|
1558
|
+
# [Face -
|
1559
|
+
# Verify](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f3039523a),
|
1560
|
+
# and [Face - Find
|
1561
|
+
# Similar](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395237)
|
1562
|
+
# ('returnFaceId' is true), please use faces that are: frontal, clear, and with
|
1563
|
+
# a minimum size of 200x200 pixels (100 pixels between eyes).
|
1564
|
+
# * The minimum detectable face size is 36x36 pixels in an image no larger than
|
1565
|
+
# 1920x1080 pixels. Images with dimensions higher than 1920x1080 pixels will
|
1566
|
+
# need a proportionally larger minimum face size.
|
1567
|
+
# * Different 'detectionModel' values can be provided. To use and compare
|
1568
|
+
# different detection models, please refer to [How to specify a detection
|
1569
|
+
# model](https://docs.microsoft.com/en-us/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model)
|
1570
|
+
# | Model | Recommended use-case(s) |
|
1571
|
+
# | ---------- | -------- |
|
1572
|
+
# | 'detection_01': | The default detection model for [Face -
|
1573
|
+
# Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236).
|
1574
|
+
# Recommend for near frontal face detection. For scenarios with exceptionally
|
1575
|
+
# large angle (head-pose) faces, occluded faces or wrong image orientation, the
|
1576
|
+
# faces in such cases may not be detected. |
|
1577
|
+
# | 'detection_02': | Detection model released in 2019 May with improved
|
1578
|
+
# accuracy especially on small, side and blurry faces. |
|
1579
|
+
#
|
1580
|
+
# * Different 'recognitionModel' values are provided. If follow-up operations
|
1581
|
+
# like Verify, Identify, Find Similar are needed, please specify the
|
1582
|
+
# recognition model with 'recognitionModel' parameter. The default value for
|
1583
|
+
# 'recognitionModel' is 'recognition_01', if latest model needed, please
|
1584
|
+
# explicitly specify the model you need in this parameter. Once specified, the
|
1585
|
+
# detected faceIds will be associated with the specified recognition model.
|
1586
|
+
# More details, please refer to [How to specify a recognition
|
1587
|
+
# model](https://docs.microsoft.com/en-us/azure/cognitive-services/face/face-api-how-to-topics/specify-recognition-model)
|
1588
|
+
# | Model | Recommended use-case(s) |
|
1589
|
+
# | ---------- | -------- |
|
1590
|
+
# | 'recognition_01': | The default recognition model for [Face -
|
1591
|
+
# Detect](/docs/services/563879b61984550e40cbbe8d/operations/563879b61984550f30395236).
|
1592
|
+
# All those faceIds created before 2019 March are bonded with this recognition
|
1593
|
+
# model. |
|
1594
|
+
# | 'recognition_02': | Recognition model released in 2019 March.
|
1595
|
+
# 'recognition_02' is recommended since its overall accuracy is improved
|
1596
|
+
# compared with 'recognition_01'. |
|
858
1597
|
#
|
859
1598
|
# @param image An image stream.
|
860
1599
|
# @param return_face_id [Boolean] A value indicating whether the operation
|
@@ -866,13 +1605,28 @@ module Azure::CognitiveServices::Face::V1_0
|
|
866
1605
|
# "returnFaceAttributes=age,gender". Supported face attributes include age,
|
867
1606
|
# gender, headPose, smile, facialHair, glasses and emotion. Note that each face
|
868
1607
|
# attribute analysis has additional computational and time cost.
|
1608
|
+
# @param recognition_model [RecognitionModel] Name of recognition model.
|
1609
|
+
# Recognition model is used when the face features are extracted and associated
|
1610
|
+
# with detected faceIds, (Large)FaceList or (Large)PersonGroup. A recognition
|
1611
|
+
# model name can be provided when performing Face - Detect or (Large)FaceList -
|
1612
|
+
# Create or (Large)PersonGroup - Create. The default value is 'recognition_01',
|
1613
|
+
# if latest model needed, please explicitly specify the model you need.
|
1614
|
+
# Possible values include: 'recognition_01', 'recognition_02'
|
1615
|
+
# @param return_recognition_model [Boolean] A value indicating whether the
|
1616
|
+
# operation should return 'recognitionModel' in response.
|
1617
|
+
# @param detection_model [DetectionModel] Name of detection model. Detection
|
1618
|
+
# model is used to detect faces in the submitted image. A detection model name
|
1619
|
+
# can be provided when performing Face - Detect or (Large)FaceList - Add Face
|
1620
|
+
# or (Large)PersonGroup - Add Face. The default value is 'detection_01', if
|
1621
|
+
# another model is needed, please explicitly specify it. Possible values
|
1622
|
+
# include: 'detection_01', 'detection_02'
|
869
1623
|
# @param [Hash{String => String}] A hash of custom headers that will be added
|
870
1624
|
# to the HTTP request.
|
871
1625
|
#
|
872
1626
|
# @return [Concurrent::Promise] Promise object which holds the HTTP response.
|
873
1627
|
#
|
874
|
-
def detect_with_stream_async(image, return_face_id:true, return_face_landmarks:false, return_face_attributes:nil, custom_headers:nil)
|
875
|
-
fail ArgumentError, '@client.
|
1628
|
+
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, detection_model:nil, custom_headers:nil)
|
1629
|
+
fail ArgumentError, '@client.endpoint is nil' if @client.endpoint.nil?
|
876
1630
|
fail ArgumentError, 'image is nil' if image.nil?
|
877
1631
|
|
878
1632
|
|
@@ -897,11 +1651,11 @@ module Azure::CognitiveServices::Face::V1_0
|
|
897
1651
|
path_template = 'detect'
|
898
1652
|
|
899
1653
|
request_url = @base_url || @client.base_url
|
900
|
-
request_url = request_url.gsub('{
|
1654
|
+
request_url = request_url.gsub('{Endpoint}', @client.endpoint)
|
901
1655
|
|
902
1656
|
options = {
|
903
1657
|
middlewares: [[MsRest::RetryPolicyMiddleware, times: 3, retry: 0.02], [:cookie_jar]],
|
904
|
-
query_params: {'returnFaceId' => return_face_id,'returnFaceLandmarks' => return_face_landmarks,'returnFaceAttributes' => return_face_attributes.nil? ? nil : return_face_attributes.join(',')},
|
1658
|
+
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,'detectionModel' => detection_model},
|
905
1659
|
body: request_content,
|
906
1660
|
headers: request_headers.merge(custom_headers || {}),
|
907
1661
|
base_url: request_url
|
@@ -918,6 +1672,8 @@ module Azure::CognitiveServices::Face::V1_0
|
|
918
1672
|
end
|
919
1673
|
|
920
1674
|
result.request_id = http_response['x-ms-request-id'] unless http_response['x-ms-request-id'].nil?
|
1675
|
+
result.correlation_request_id = http_response['x-ms-correlation-request-id'] unless http_response['x-ms-correlation-request-id'].nil?
|
1676
|
+
result.client_request_id = http_response['x-ms-client-request-id'] unless http_response['x-ms-client-request-id'].nil?
|
921
1677
|
# Deserialize Response
|
922
1678
|
if status_code == 200
|
923
1679
|
begin
|