-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathdetect.yml
More file actions
236 lines (213 loc) · 9.27 KB
/
detect.yml
File metadata and controls
236 lines (213 loc) · 9.27 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
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
openapi: 3.0.4
paths:
/detect:
parameters:
- $ref: "./common.yml#/components/parameters/x-request"
post:
tags:
- match
summary: "detect and check quality"
description: "Use the POST `api/detect` endpoint to analyze images, recognize faces in them, and return cropped and aligned portraits of the detected people.
The Face Detection feature lets you additionally:
- **Check face image quality**: Assess whether a portrait meets certain standards, for example, ICAO, Schengen visa, USA visa. To perform image quality check, use the `processParam.quality` field. For the list of assessed characteristics, see the [Face Image Quality Characteristics page](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/usage/face-detection/face-image-quality-check/).
- **Evaluate face attributes**: Estimate the age range of a person; check whether the eyes are occluded, closed, or open; detect a facial expression or smile; see if there are glasses, sunglasses, head coverage, medical mask, etc. To evaluate attributes, add the `processParam.attributes` field. For the list of assessed attributes, see the [Attributes List page](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/usage/face-detection/attributes-detection/).
You can perform Face Detection in two ways:
- By adding parameters manually. In this case, the configuration is not saved and you will need to add all the necessary parameters to each request.
- By a processing `scenario` that includes certain parameters. You can use predefined scenarios or add custom ones. For detailed information about scenarios, refer to the [Scenarios page](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/usage/face-detection/scenarios/)."
operationId: detect
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/DetectRequest"
responses:
200:
description: "Successful operation; the coordinates of the detected faces are returned."
content:
application/json:
schema:
$ref: "#/components/schemas/DetectResponse"
403:
$ref: "./common.yml#/components/responses/BadLicense"
components:
schemas:
DetectRequest:
title: "DetectRequest"
type: object
allOf:
- $ref: "./common.yml#/components/schemas/TransactionLabels"
- $ref: "#/components/schemas/DetectRequestData"
DetectRequestData:
title: "DetectRequestData"
type: object
properties:
tag:
type: string
description: "Session identificator, should be unique for each session."
processParam:
$ref: "./common.yml#/components/schemas/ProcessParam"
image:
$ref: "./common.yml#/components/schemas/ImageData"
DetectResponse:
title: "DetectResponse"
allOf:
- $ref: "./common.yml#/components/schemas/FaceSDKResult"
- $ref: "#/components/schemas/DetectResponseResults"
DetectResponseResults:
title: "DetectResponseResults"
type: object
properties:
results:
$ref: "#/components/schemas/DetectResult"
DetectResult:
title: "DetectResult"
type: object
description: "The detection results."
required:
- detections
properties:
detections:
type: array
description: "The array of performed checks."
items:
$ref: "#/components/schemas/Detection"
detectorType:
description: "Internal."
type: integer
landmarksType:
description: "Internal."
type: integer
scenario:
description: "The face detection scenario that was set in the `processParam.scenario` field of the request."
type: string
elapsedTime:
type: number
format: float
description: "Server processing time, ms. Does not include the time taken to receive the request or deliver the response."
example: 0.84793560000000001
DetectAttributesDetails:
title: "DetectAttributesDetails"
allOf:
- $ref: "#/components/schemas/DetailItem"
- $ref: "#/components/schemas/AttributesData"
AttributesData:
title: "AttributesData"
type: object
properties:
value:
type: array
description: "The estimated value for the attribute, see the [Returned values column](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/usage/face-detection/attributes-detection/)."
items:
type: integer
DetectDetailsMeta:
title: "DetectDetailsMeta"
allOf:
- $ref: "#/components/schemas/DetailItem"
- $ref: "#/components/schemas/DetectMetaData"
DetectMetaData:
title: "DetectMetaData"
type: object
properties:
confidence:
type: number
description: "The confidence in the estimated value, `1.0` is for 100% confidence."
format: float
value:
type: string
description: "The estimated value for the attribute, see the [Returned values column](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/usage/face-detection/attributes-detection/)."
Detection:
title: "Detection"
type: object
required:
- landmarks
- roi
properties:
crop:
$ref: "./common.yml#/components/schemas/ImageData"
attributes:
$ref: "#/components/schemas/DetectionAttributes"
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: integer
example: [ x, y ]
example: [ [ x, y ] ]
quality:
$ref: "#/components/schemas/DetectionQuality"
roi:
$ref: "./common.yml#/components/schemas/FaceRectangular"
DetectionAttributes:
title: "DetectionAttributes"
type: object
description: "The evaluated attributes, see the [Attributes List](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/usage/face-detection/attributes-detection/) for details."
properties:
details:
type: array
description: "Attributes assessment details. Returns `DetectDetailsMeta` or `DetectAttributesDetails`."
items:
oneOf:
- $ref: "#/components/schemas/DetectAttributesDetails"
- $ref: "#/components/schemas/DetectDetailsMeta"
elapsedTime:
type: number
description: "Server processing time for attribute detection, ms."
DetailItem:
title: "DetailItem"
type: object
properties:
name:
description: "The name of the attribute."
type: string
discriminator:
propertyName: name
mapping:
Age: "DetectAttributesDetails"
EyeRight: "DetectDetailsMeta"
EyeLeft: "DetectDetailsMeta"
Emotion: "DetectDetailsMeta"
Smile: "DetectDetailsMeta"
Glasses: "DetectDetailsMeta"
HeadCovering: "DetectDetailsMeta"
ForeheadCovering: "DetectDetailsMeta"
Mouth: "DetectDetailsMeta"
MedicalMask: "DetectDetailsMeta"
Occlusion: "DetectDetailsMeta"
StrongMakeup: "DetectDetailsMeta"
Headphones: "DetectDetailsMeta"
DetectionQuality:
title: "DetectionQuality"
type: object
description: "The portrait quality assessment results, see [Face Image Quality Characteristics](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/usage/face-detection/face-image-quality-check/). If not set in request, no quality check is performed."
properties:
nonCompliant:
type: array
description: "Non-compliant assessment characteristics."
items:
$ref: "./common.yml#/components/schemas/FaceQualityConfigName"
example: [ "ImageWidthToHeight", "Yaw" ]
detailsGroups:
description: "Assessment results for each [group of characteristics](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/enums/face-image-quality-groups/)."
type: array
items:
$ref: "./common.yml#/components/schemas/QualityDetailsGroups"
details:
type: array
description: "Assessment characteristics that were set in the request."
items:
$ref: "./common.yml#/components/schemas/QualityDetail"
score:
type: number
format: float
description: "Returns the estimated portrait quality assessment result,
a number from `0` to `1`, where `1` is for absolute compliance."
example: -1.0
elapsedTime:
type: number
format: float
description: "Server processing time for quality assessment, ms."
example: 0.42036411166191101