-
Notifications
You must be signed in to change notification settings - Fork 0
/
matching.yml
executable file
·198 lines (181 loc) · 6.5 KB
/
matching.yml
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
190
191
192
193
194
195
196
197
198
openapi: 3.0.3
paths:
/match:
parameters:
- $ref: './common.yml#/components/parameters/x-request'
post:
tags:
- matching
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"
info:
title: Regula FaceSDK Web API
version: 6.1.0
components:
schemas:
MatchRequest:
type: object
required:
- images
properties:
tag:
type: string
description: "Session identificator, should be unique for each session."
thumbnails:
description: "Use `outputImageParams.crop` instead."
deprecated: true
images:
type: array
description: "All images included in the comparison."
items:
$ref: "#/components/schemas/MatchImage"
outputImageParams:
$ref: "./common.yml#/components/schemas/ProcessParam/properties/outputImageParams"
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:
type: number
description: "The detected face index number."
MatchImage:
type: object
required:
- data
properties:
index:
$ref: "#/components/schemas/MatchImageIndex"
type:
$ref: "#/components/schemas/ImageSource"
data:
$ref: "./common.yml#/components/schemas/ImageData"
detectAll:
$ref: "#/components/schemas/detectAll"
MatchResponse:
allOf:
- $ref: './common.yml#/components/schemas/FaceSDKResult'
- 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:
type: object
required:
- firstIndex
- secondIndex
properties:
firstIndex:
$ref: "#/components/schemas/MatchImageIndex"
firstFaceIndex:
$ref: "#/components/schemas/MatchFaceIndex"
first:
$ref: "#/components/schemas/ImageSource"
secondIndex:
$ref: "#/components/schemas/MatchImageIndex"
secondFaceIndex:
$ref: "#/components/schemas/MatchFaceIndex"
second:
$ref: "#/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:
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:
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"
thumbnail:
$ref: "./common.yml#/components/schemas/Thumbnail"
crop:
type: string
format: byte
description: "Base64-encoded aligned and cropped portrait."
ImageSource:
description: "The type of the image, defines the way the comparison is performed, see the [ImageSource enum](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/enums/image-source/)."
type: integer
enum:
- 1
- 2
- 3
- 4
- 5
- 6
- 7
x-enum-varnames:
- DOCUMENT_PRINTED
- DOCUMENT_RFID
- LIVE
- DOCUMENT_WITH_LIVE
- EXTERNAL
- GHOST
- BARCODE
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