-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathmatch.yml
More file actions
189 lines (171 loc) · 6.32 KB
/
match.yml
File metadata and controls
189 lines (171 loc) · 6.32 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
openapi: 3.0.4
paths:
/match:
parameters:
- $ref: "./common.yml#/components/parameters/x-request"
post:
tags:
- match
summary: "compare faces (1:1)"
description: "To perform a comparison of faces in the same image or in two different images, use POST `/api/match`. It's possible to compare faces in the same image or in two different images, this is defined by the `images.type` parameter. <br><br> The face detection result is displayed in the `detections` field.
Each face is identified by two parameters: `faceIndex` (the index number of the face) and `imageIndex` (the index number of the image on which the face is detected).
So, if there are two images each of which has two faces in them, the parameters will be the following:
- First face in the first image: `faceIndex: 0`, `imageIndex: 0`
- Second face in the first image: `faceIndex: 1`, `imageIndex: 0`
- First face of the second image: `faceIndex: 0`, `imageIndex: 1`
- Second face in the second image: `faceIndex: 1`, `imageIndex: 1`"
operationId: match
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/MatchRequest"
responses:
200:
description: "Successful operation; the compare results are returned."
content:
application/json:
schema:
$ref: "#/components/schemas/MatchResponse"
403:
$ref: "./common.yml#/components/responses/BadLicense"
components:
schemas:
MatchRequest:
title: "MatchRequest"
allOf:
- $ref: "./common.yml#/components/schemas/TransactionLabels"
- $ref: "#/components/schemas/MatchRequestData"
MatchRequestData:
title: "MatchRequestData"
type: object
required:
- images
properties:
tag:
type: string
description: "Session identificator, should be unique for each session."
images:
type: array
description: "An array of images to be processed. At least two images must be provided."
items:
$ref: "#/components/schemas/MatchImage"
outputImageParams:
$ref: "./common.yml#/components/schemas/ProcessParam/properties/outputImageParams"
MatchImageIndex:
title: "MatchImageIndex"
type: integer
description: "The image index number. Can be given; if not given, the index numbers are set automatically starting from `0`. All index numbers must be whole and unique—not repeated."
MatchFaceIndex:
title: "MatchFaceIndex"
type: number
description: "The detected face index number."
MatchImage:
title: "MatchImage"
type: object
required:
- data
properties:
index:
$ref: "#/components/schemas/MatchImageIndex"
type:
$ref: "./common.yml#/components/schemas/ImageSource"
data:
$ref: "./common.yml#/components/schemas/ImageData"
detectAll:
$ref: "#/components/schemas/detectAll"
MatchResponse:
title: "MatchResponse"
allOf:
- $ref: "./common.yml#/components/schemas/FaceSDKResult"
- $ref: "#/components/schemas/MatchResponseData"
MatchResponseData:
title: "MatchResponseData"
type: object
properties:
detections:
type: array
description: "The detection results."
items:
$ref: "#/components/schemas/MatchImageDetection"
results:
type: array
description: "The comparison results."
items:
$ref: "#/components/schemas/MatchImageResult"
metadata:
type: object
additionalProperties: true
description: "A free-form object containing person's extended attributes."
MatchImageResult:
title: "MatchImageResult"
type: object
required:
- firstIndex
- secondIndex
properties:
firstIndex:
$ref: "#/components/schemas/MatchImageIndex"
firstFaceIndex:
$ref: "#/components/schemas/MatchFaceIndex"
first:
$ref: "./common.yml#/components/schemas/ImageSource"
secondIndex:
$ref: "#/components/schemas/MatchImageIndex"
secondFaceIndex:
$ref: "#/components/schemas/MatchFaceIndex"
second:
$ref: "./common.yml#/components/schemas/ImageSource"
score:
type: number
description: "A dimensionless number that shows how similar the compared faces are. 0—absolutely identical faces."
similarity:
type: number
description: "The detected faces similarity, %. 100%—absolutely identical faces, 0%—absolutely not identical."
MatchImageDetection:
title: "MatchImageDetection"
type: object
required:
- imageIndex
- status
properties:
faces:
type: array
description: "Detected faces."
items:
$ref: "#/components/schemas/DetectionFace"
imageIndex:
$ref: "#/components/schemas/MatchImageIndex"
status:
$ref: "./common.yml#/components/schemas/FaceSDKResultCode"
DetectionFace:
title: "DetectionFace"
type: object
properties:
faceIndex:
$ref: "#/components/schemas/MatchFaceIndex"
landmarks:
description: "Absolute coordinates (x,y) of five points of each detected face: left eye, right eye, nose, left point of lips, right point of lips."
type: array
items:
description: "Cartesian points. First element - X-axis coordinate. Second element - Y-axis coordinate."
type: array
items:
type: number
example: [ x, y ]
example: [ [ x, y ] ]
rotationAngle:
description: "Angle of rotation of the face from the vertical axis, degrees."
type: number
roi:
$ref: "./common.yml#/components/schemas/FaceRectangular"
crop:
type: string
format: byte
description: "Base64-encoded aligned and cropped portrait."
detectAll:
title: "detectAll"
type: boolean
description: "Whether to detect all faces in the image. If set to `false`, only the most central face is detected."
default: false