Skip to content

Commit 280936a

Browse files
irynaharoshkaGubinAlexanderKirylKovaliov
authored
Updating Detect (#98)
* Updating Detect * SP-9396: Add attributes detect details (#99) * added descriptions * fixed descriprions + remaned timer to elapsedTime * Removed originalRect * adjusted descriptions + added AttributesAll member to FaceQualityScenarios enum * https://app.clickup.com/t/4535044/SP-17852 * minor fix * fixes according to review https://app.clickup.com/t/4535044/SP-9396 * adjusted scenarion description in the request and elapsedTime descriptions * adjusted links to docs * minor fix --------- Co-authored-by: Alexander Gubin <aliaksandr.hubin@regula.us> Co-authored-by: Kiryl Kovaliov <kkirusha@gmail.com>
1 parent 7a072de commit 280936a

4 files changed

Lines changed: 70 additions & 53 deletions

File tree

common.yml

100755100644
Lines changed: 16 additions & 23 deletions
Original file line numberDiff line numberDiff line change
@@ -51,13 +51,13 @@ components:
5151
onlyCentralFace:
5252
type: boolean
5353
description: "Whether to process only the central face in the image. If set to `false`, all the faces are processed."
54-
example: false
54+
example: true
5555
outputImageParams:
5656
$ref: "#/components/schemas/OutputImageParams"
5757
quality:
5858
$ref: "#/components/schemas/QualityRequest"
5959
attributes:
60-
description: "If set, the selected attributes, such as age or emotions, are evaluated."
60+
description: "If set, the selected attributes, such as age or emotions, are evaluated. To check all the available attributes, you can set the `AttributesAll` scenario in `processParam.scenario`."
6161
type: object
6262
properties:
6363
config:
@@ -75,7 +75,7 @@ components:
7575

7676
QualityRequest:
7777
type: object
78-
description: "If set, the face image quality check is performed according to the set scenario or characteristics."
78+
description: "If set, the face image quality check is performed according to the given list of [characteristics](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/usage/face-detection/face-image-quality-check/) in `quality.config`."
7979
properties:
8080
backgroundMatchColor:
8181
description: "The RGB value for the background color: the silhouette of a person is cut out and the background is filled with this color."
@@ -85,7 +85,7 @@ components:
8585

8686
Crop:
8787
type: object
88-
description: "Whether to return a Base64-encoded image of an aligned and cropped portrait in the `crop` field. Alignment is performed according to `type`; if a head on the original image is tilted, for the returned portrait it is aligned in a straight vertical line. If there are more than one face in the photo, all the faces are detected and processed, and separate portraits for each face are returned. So, if there are five people in the photo, you'll get five processed portraits. Each portrait can be downloaded."
88+
description: "Whether to return a Base64-encoded image of each aligned and cropped portrait in the `crop` field. Faces are aligned to a straight vertical line based on the value in the `crop.type` field, correcting any tilt present in the original image. If the image contains multiple faces, the system will detect and process each face separately, returning individual portraits. For example, if there are five people in the photo, five processed portraits will be returned. Each portrait is available for download."
8989
properties:
9090
type:
9191
$ref: "#/components/schemas/FaceImageQualityAlignType"
@@ -102,10 +102,6 @@ components:
102102
maxItems: 2
103103
description: "The resize value in case `type` matches this value. If it doesn't, no resize is performed."
104104
example: [300, 400]
105-
returnOriginalRect:
106-
type: boolean
107-
description: "Whether to return the coordinates of the rectangle with the face in the original image prepared for the face crop."
108-
example: true
109105

110106
QualityConfigList:
111107
type: array
@@ -128,7 +124,7 @@ components:
128124
format: float
129125
minItems: 2
130126
maxItems: 2
131-
description: "The range of applicable values for this characteristic. If the returned in the response value fits this range, the characteristic is identified as compliant with the requirements."
127+
description: "The range of applicable values for this characteristic. If the returned in the response value fits this range, the characteristic is identified as compliant with the requirements. For recommended ranges, see [Face Image Quality Assessment](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/usage/face-detection/face-image-quality-check/)."
132128
example: [x, y]
133129

134130
AttributeConfigList:
@@ -177,7 +173,7 @@ components:
177173
example: "Roll"
178174
range:
179175
type: array
180-
description: "The range of set values for this characteristic."
176+
description: "The range of set values for this characteristic, see the [Recommended range column](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/usage/face-detection/face-image-quality-check/)."
181177
items:
182178
type: number
183179
format: float
@@ -191,7 +187,7 @@ components:
191187
value:
192188
type: number
193189
format: float
194-
description: "The assessed value for the characteristic, returned in the set units."
190+
description: "The result value for the characteristic, returned in set units."
195191
example: 0.0
196192

197193
RGB:
@@ -205,7 +201,7 @@ components:
205201

206202
FaceImageQualityStatus:
207203
type: integer
208-
description: "The processing status returned for each assessed quality characteristic."
204+
description: "The processing status returned for each quality characteristic, see the [FaceImageQualityStatus enum](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/enums/face-image-quality-status/)."
209205
enum:
210206
- 0
211207
- 1
@@ -217,13 +213,8 @@ components:
217213

218214
FaceQualityScenarios:
219215
type: string
220-
description: "Face detection scenario. If applied and the scenario is found, the parameters are set automatically and any other parameters mentioned in the request are ignored.
221-
222-
223-
If not set, left empty, or the name is not found, the processing is performed according to the set parameters.
224-
225-
226-
You can find detailed descriptions of available scenarios on the [Scenarios page](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/usage/face-detection/scenarios/)."
216+
description: "Face detection scenario. If set and the scenario is found, it automatically applies the relevant parameters, overriding any other parameters specified in the request. If the scenario is not set, is empty, or the name is not recognized, processing will follow the parameters directly set in the request. For detailed descriptions of available scenarios, refer to the [Scenarios page](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/usage/face-detection/scenarios/)."
217+
example: "QualityICAO"
227218
enum:
228219
- "OldMode"
229220
- "QualityFull"
@@ -233,6 +224,7 @@ components:
233224
- "CropCentralFace"
234225
- "CropAllFaces"
235226
- "Thumbnail"
227+
- "AttributesAll"
236228
- ""
237229
x-enum-varnames:
238230
- OLD_MODE
@@ -243,11 +235,12 @@ components:
243235
- CROP_CENTRAL_FACE
244236
- CROP_ALL_FACES
245237
- THUMBNAIL
238+
- ATTRIBUTES_ALL
246239
- EMPTY
247240

248241
FaceImageQualityGroups:
249242
type: integer
250-
description: "Face image quality group types for face image quality assessment."
243+
description: "The group ID of the characteristic, see the [FaceImageQualityGroups enum](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/enums/face-image-quality-groups/) for details."
251244
enum:
252245
- 1
253246
- 2
@@ -268,7 +261,7 @@ components:
268261
- BACKGROUND
269262
FaceImageQualityGroupsStrings:
270263
type: string
271-
description: "Face image quality group types for face image quality assessment."
264+
description: "Face image quality assessment group name, see [FaceImageQualityGroups](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/enums/face-image-quality-groups/)."
272265
enum:
273266
- "ImageCharacteristics"
274267
- "HeadSizeAndPosition"
@@ -290,7 +283,7 @@ components:
290283

291284
FaceQualityConfigName:
292285
type: string
293-
description: "The name of the quality check characteristic. For definitions, see the [FaceQualityConfigName enum](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/enums/face-quality-config-name/)."
286+
description: "The name of the characteristic. For definitions, see the [FaceQualityConfigName enum](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/enums/face-quality-config-name/)."
294287
enum:
295288
- "ImageWidth"
296289
- "ImageHeight"
@@ -399,7 +392,7 @@ components:
399392
$ref: "#/components/schemas/FaceSDKResultCode"
400393

401394
ImageData:
402-
description: "Base64-encoded image."
395+
description: "Thumbnail: Base64-encoded image."
403396
type: string
404397
format: byte
405398

detect.yml

Lines changed: 52 additions & 25 deletions
Original file line numberDiff line numberDiff line change
@@ -10,18 +10,18 @@ paths:
1010
description: "Use the POST `api/detect` endpoint to analyze images, recognize faces in them, and return cropped and aligned portraits of the detected people.
1111
1212
13-
The Face Detection feature lets you:
13+
The Face Detection feature lets you additionally:
1414
15-
- **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.
15+
- **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/).
1616
17-
- **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.
17+
- **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/).
1818
1919
2020
You can perform Face Detection in two ways:
2121
22-
- By adding parameters manually. In this case, the configuration is not saved and can not be automatically repeated.
22+
- 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.
2323
24-
- By a processing `scenario` that includes certain parameters. You can use predefined scenarios or add custom ones."
24+
- 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/)."
2525
operationId: detect
2626
requestBody:
2727
required: true
@@ -51,11 +51,6 @@ components:
5151
$ref: "./common.yml#/components/schemas/ProcessParam"
5252
image:
5353
$ref: "./common.yml#/components/schemas/ImageData"
54-
thumbnails:
55-
description: "Use `processParam.outputImageParams.crop` instead."
56-
deprecated: true
57-
type: boolean
58-
default: false
5954

6055
DetectResponse:
6156
allOf:
@@ -67,11 +62,13 @@ components:
6762

6863
DetectResult:
6964
type: object
65+
description: "The detection results."
7066
required:
7167
- detections
7268
properties:
7369
detections:
7470
type: array
71+
description: "The array of performed checks."
7572
items:
7673
$ref: "#/components/schemas/Detection"
7774
detectorType:
@@ -81,14 +78,39 @@ components:
8178
description: "Internal."
8279
type: integer
8380
scenario:
84-
description: "Scenario from Request processParam."
85-
$ref: "./common.yml#/components/schemas/FaceQualityScenarios"
86-
timer:
81+
description: "The face detection scenario that was set in the `processParam.scenario` field of the request."
82+
type: string
83+
elapsedTime:
8784
type: number
8885
format: float
89-
description: "The total time taken for the detection."
86+
description: "Server processing time, ms. Does not include the time taken to receive the request or deliver the response."
9087
example: 0.84793560000000001
9188

89+
DetectAttributesDetails:
90+
type: object
91+
properties:
92+
name:
93+
type: string
94+
description: "The name of the attribute."
95+
value:
96+
type: array
97+
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/)."
98+
items:
99+
type: integer
100+
101+
DetectDetailsMeta:
102+
type: object
103+
properties:
104+
confidence:
105+
type: number
106+
description: "The confidence in the estimated value, `1.0` is for 100% confidence."
107+
format: float
108+
value:
109+
type: string
110+
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/)."
111+
name:
112+
type: string
113+
description: "The name of the attribute."
92114
Detection:
93115
type: object
94116
required:
@@ -100,17 +122,22 @@ components:
100122
$ref: "./common.yml#/components/schemas/ImageData"
101123
attributes:
102124
type: object
125+
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."
103126
properties:
104127
details:
105128
type: array
129+
description: "Attributes assessment details. Returns `DetectDetailsMeta` or `DetectAttributesDetails`."
106130
items:
107-
type: object
108-
additionalProperties: true
131+
items:
132+
anyOf:
133+
- $ref: '#/components/schemas/DetectAttributesDetails'
134+
- $ref: '#/components/schemas/DetectDetailsMeta'
135+
109136
elapsedTime:
110137
type: number
111-
description: "The elapsed time for attribute detection."
138+
description: "Server processing time for attribute detection, ms."
112139
landmarks:
113-
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."
140+
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."
114141
type: array
115142
items:
116143
description: "Cartesian points. First element - X-axis coordinate. Second element - Y-axis coordinate."
@@ -121,35 +148,35 @@ components:
121148
example: [ [ x, y ] ]
122149
quality:
123150
type: object
124-
description: "Field for checking the portrait quality. If it is not mentioned, no quality check is performed."
151+
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."
125152
properties:
126153
nonCompliant:
127154
type: array
128-
description: "The array of all the non-compliant assessment characteristics."
155+
description: "Non-compliant assessment characteristics."
129156
items:
130157
$ref: "./common.yml#/components/schemas/FaceQualityConfigName"
131158
example: ["ImageWidthToHeight", "Yaw"]
132159
detailsGroups:
133-
description: "The array of the assessment results for each group of characteristics."
160+
description: "Assessment results for each [group of characteristics](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/enums/face-image-quality-groups/)."
134161
type: array
135162
items:
136163
$ref: "./common.yml#/components/schemas/QualityDetailsGroups"
137164
details:
138165
type: array
139-
description: "The array of the assessment characteristics that were set in the request."
166+
description: "Assessment characteristics that were set in the request."
140167
items:
141168
$ref: "./common.yml#/components/schemas/QualityDetail"
142169

143170
score:
144171
type: number
145172
format: float
146173
description: "Returns the estimated portrait quality assessment result,
147-
a number from 0 to 1, where 1 is for absolute compliance."
174+
a number from `0` to `1`, where `1` is for absolute compliance."
148175
example: -1.0
149-
timer:
176+
elapsedTime:
150177
type: number
151178
format: float
152-
description: "The total time the quality assessment has taken."
179+
description: "Server processing time for quality assessment, ms."
153180
example: 0.42036411166191101
154181
roi:
155182
$ref: "./common.yml#/components/schemas/FaceRectangular"

match_and_search.yml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -62,7 +62,7 @@ components:
6262
$ref: './matching.yml#/components/schemas/MatchImageResult'
6363
elapsedTime:
6464
type: number
65-
description: "Time the processing has taken, ms."
65+
description: "Server processing time, ms. Does not include the time taken to receive the request or deliver the response."
6666
format: float
6767
example: 1.317137987
6868
metadata:

matching.yml

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -52,10 +52,7 @@ components:
5252
tag:
5353
type: string
5454
description: "Session identificator, should be unique for each session."
55-
thumbnails:
56-
description: "Use `outputImageParams.crop` instead."
57-
deprecated: true
58-
images:
55+
images:
5956
type: array
6057
description: "All images included in the comparison."
6158
items:

0 commit comments

Comments
 (0)