Skip to content

Commit fe07949

Browse files
Merge pull request #97 from regulaforensics/9396-update-detect
Update Detect
2 parents cfa791e + 1fcc5ae commit fe07949

3 files changed

Lines changed: 38 additions & 55 deletions

File tree

common.yml

Lines changed: 19 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,7 @@ components:
5050
$ref: "#/components/schemas/FaceQualityScenarios"
5151
onlyCentralFace:
5252
type: boolean
53-
description: "Whether to process only the central face on the image (true) or all the faces (false)."
53+
description: "Whether to process only the central face in the image. If set to `false`, all the faces are processed."
5454
example: false
5555
outputImageParams:
5656
$ref: "#/components/schemas/OutputImageParams"
@@ -65,18 +65,17 @@ components:
6565

6666
OutputImageParams:
6767
type: object
68-
description: "Whether to process the uploaded image according to the indicated settings."
68+
description: "Allows to process the uploaded image according to the indicated settings."
6969
properties:
7070
backgroundColor:
7171
description: "The RGB value for the background color: the silhouette of a person is cut out and the background is filled with this color."
7272
$ref: "#/components/schemas/RGB"
7373
crop:
74-
description: "Whether to return the Base64 of an aligned and cropped portrait in the `crop` field."
7574
$ref: "#/components/schemas/Crop"
7675

7776
QualityRequest:
7877
type: object
79-
description: "Whether to perform the portrait quality check."
78+
description: "If set, the face image quality check is performed according to the set scenario or characteristics."
8079
properties:
8180
backgroundMatchColor:
8281
description: "The RGB value for the background color: the silhouette of a person is cut out and the background is filled with this color."
@@ -86,15 +85,15 @@ components:
8685

8786
Crop:
8887
type: object
89-
description: "Whether to return the Base64 image of an aligned and cropped portrait in the `crop` field."
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."
9089
properties:
9190
type:
9291
$ref: "#/components/schemas/FaceImageQualityAlignType"
93-
description: "The aspect ratio according to which face alignment is performed during face detection."
92+
description: "The aspect ratio according to which face alignment is performed, see the [FaceImageQualityAlignType enum](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/enums/face-image-quality-align-type/). <br><br>To get a thumbnail with dimensions 3x4, set `0`."
9493
example: 1
9594
padColor:
9695
$ref: "#/components/schemas/RGB"
97-
description: "The RGB value for the color that will complement the image if this is needed for alignment."
96+
description: "The RGB value of a color for filling background behind a person's silhouette and for aligning the image."
9897
size:
9998
type: array
10099
items:
@@ -110,6 +109,7 @@ components:
110109

111110
QualityConfigList:
112111
type: array
112+
description: "The list of quality check characteristics."
113113
items:
114114
$ref: "#/components/schemas/QualityConfig"
115115

@@ -128,13 +128,12 @@ components:
128128
format: float
129129
minItems: 2
130130
maxItems: 2
131-
description: "The range of applicable values for this characteristic.
132-
If the returned in the Response value fits this range,
133-
the value is identified as compliant with the requirements."
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."
134132
example: [x, y]
135133

136134
AttributeConfigList:
137135
type: array
136+
description: "The list of attributes for evaluation."
138137
items:
139138
$ref: "#/components/schemas/AttributeConfig"
140139

@@ -218,7 +217,13 @@ components:
218217

219218
FaceQualityScenarios:
220219
type: string
221-
description: "Face detection scenario."
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/)."
222227
enum:
223228
- "OldMode"
224229
- "QualityFull"
@@ -285,7 +290,7 @@ components:
285290

286291
FaceQualityConfigName:
287292
type: string
288-
description: "All image characteristics that can be assessed during face image quality assessment."
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/)."
289294
enum:
290295
- "ImageWidth"
291296
- "ImageHeight"
@@ -433,7 +438,7 @@ components:
433438

434439
FaceImageQualityAlignType:
435440
type: integer
436-
description: "The aspect ratio according to which face alignment is performed during face detection."
441+
description: "The aspect ratio according to which face alignment is performed. See the [FaceImageQualityAlignType enum](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/enums/face-image-quality-align-type/). To get a thumbnail with aspect ratio 3:4, set `0`."
437442
enum:
438443
- 0
439444
- 1
@@ -550,7 +555,7 @@ components:
550555

551556
FaceAttribute:
552557
type: string
553-
description: "Face attributes."
558+
description: "The name of the attribute. For definitions, see the [FaceAttribute enum](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/enums/face-attribute/)."
554559
enum:
555560
- "Age"
556561
- "Emotion"

detect.yml

Lines changed: 18 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,7 +6,22 @@ paths:
66
post:
77
tags:
88
- matching
9-
description: "Detect face, evaluate attributes, assess the portrait quality"
9+
summary: "detect and check quality"
10+
description: "Use the POST `api/detect` endpoint to analyze images, recognize faces in them, and return cropped and aligned portraits of the detected people.
11+
12+
13+
The Face Detection feature lets you:
14+
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.
16+
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.
18+
19+
20+
You can perform Face Detection in two ways:
21+
22+
- By adding parameters manually. In this case, the configuration is not saved and can not be automatically repeated.
23+
24+
- By a processing `scenario` that includes certain parameters. You can use predefined scenarios or add custom ones."
1025
operationId: detect
1126
requestBody:
1227
required: true
@@ -37,7 +52,8 @@ components:
3752
image:
3853
$ref: "./common.yml#/components/schemas/ImageData"
3954
thumbnails:
40-
description: "Deprecated, use the `crop` field in `processParam` instead."
55+
description: "Use `processParam.outputImageParams.crop` instead."
56+
deprecated: true
4157
type: boolean
4258
default: false
4359

matching.yml

Lines changed: 1 addition & 39 deletions
Original file line numberDiff line numberDiff line change
@@ -61,45 +61,7 @@ components:
6161
items:
6262
$ref: "#/components/schemas/MatchImage"
6363
outputImageParams:
64-
type: object
65-
description: "Whether to process the uploaded image according to the indicated settings."
66-
properties:
67-
backgroundColor:
68-
type: array
69-
description: "The RGB value of a color for filling background behind a person's silhouette and for aligning the image."
70-
default: null
71-
items:
72-
type: integer
73-
crop:
74-
type: object
75-
description: "If set, a Base64-encoded aligned and cropped by the indicated settings portrait is returned in the `crop` field."
76-
properties:
77-
padColor:
78-
type: array
79-
description: "The RGB value of a color for filling background behind a person's silhouette and for aligning the image."
80-
default: null
81-
items:
82-
type: integer
83-
returnOriginalRect:
84-
type: boolean
85-
description: "Whether to return the coordinates of the rectangle with the face in the original image prepared for the face crop."
86-
default: null
87-
size:
88-
type: array
89-
description: "The resize value in case `type` matches this value. If it doesn't, no resize is performed."
90-
default: null
91-
items:
92-
type: integer
93-
type:
94-
type: integer
95-
description: "The aspect ratio according to which face alignment is performed. See the [FaceImageQualityAlignType enum](https://docs.regulaforensics.com/develop/face-sdk/web-service/development/enums/face-image-quality-align-type/). To get a thumbnail with aspect ratio 3:4, set `0`."
96-
default: null
97-
enum:
98-
- 0
99-
- 1
100-
- 2
101-
- 3
102-
- 4
64+
$ref: "./common.yml#/components/schemas/ProcessParam/properties/outputImageParams"
10365

10466
MatchImageIndex:
10567
type: integer

0 commit comments

Comments
 (0)