-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathsearch.yml
More file actions
205 lines (193 loc) · 6.6 KB
/
search.yml
File metadata and controls
205 lines (193 loc) · 6.6 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
openapi: 3.0.4
paths:
/search:
parameters:
- $ref: "./common.yml#/components/parameters/x-request"
- in: query
name: withImages
required: false
schema:
type: boolean
description: "When enabled, the response includes Base64-encoded images of matched persons. Each entry in the `persons` array contains an `images` field with image IDs and content. If omitted or set to false, images are excluded."
post:
tags:
- search
summary: Find person by image in groups
operationId: search
requestBody:
required: true
content:
application/json:
schema:
$ref: "#/components/schemas/SearchRequest"
responses:
200:
description: "Successful operation; the search result is returned."
content:
application/json:
schema:
$ref: "#/components/schemas/SearchResult"
201:
description: "New person created with the search photo and the data specified."
content:
application/json:
schema:
$ref: "#/components/schemas/SearchPerson"
400:
$ref: "./identification.yml#/components/responses/SearchBadParamsException"
components:
schemas:
SearchRequest:
title: "SearchRequest"
allOf:
- $ref: "./common.yml#/components/schemas/TransactionLabels"
- $ref: "#/components/schemas/SearchParameters"
- $ref: "./identification.yml#/components/schemas/ImageFields"
SearchParameters:
title: "SearchParameters"
type: object
description: "Request search data."
properties:
createPerson:
$ref: "#/components/schemas/SearchParametersCreatePerson"
groupIds:
type: array
description: "IDs of the groups in which the search is performed."
items:
type: string
format: uuid
filter:
$ref: "#/components/schemas/FilterSearchRequest"
SearchParametersCreatePerson:
title: "SearchParametersCreatePerson"
type: object
description: "If a person is not found, a new person entry is created using the descriptor calculated while searching."
properties:
name:
type: string
description: "Person's name."
metadata:
type: object
additionalProperties: true
description: "A free-form object containing person's extended attributes."
ttl:
type: integer
description: "The lifespan of the Person's records, seconds. Optional."
default: null
FilterSearchRequest:
title: "FilterSearchRequest"
type: object
description: "Allows to filter the search results based on the Person's `name`. If enabled, only the search results that meet the filter condition will be returned."
properties:
op:
$ref: "#/components/schemas/FilterOp"
field:
type: string
description: "`name` of the Person."
value:
type: array
description: "The list of `name` values against which the `field` is compared."
items:
type: string
FilterOp:
title: "FilterOp"
type: string
description: "The filter condition, determines the type of comparison to be performed on the `name` values of the Person entity. <br><br>When set to `in`, the `name` values of the Person should match any of the values specified in the `value` list. <br><br>When set to `nin`, the `name` values of the Person should not match any of the values specified in the `value` list."
enum:
- "in"
- "nin"
x-enum-varnames:
- "IN"
- "NOT_IN"
RecognizeImage:
title: "RecognizeImage"
allOf:
- $ref: "./identification.yml#/components/schemas/Image"
- $ref: "#/components/schemas/RecognizeImageData"
RecognizeImageData:
title: "RecognizeImageData"
type: object
properties:
similarity:
type: number
format: float
description: "Similarity score."
distance:
type: number
format: float
description: "Similarity distance score: the lower the distance, the higher the face's similarity."
SearchResult:
title: "SearchResult"
type: object
properties:
code:
type: integer
description: "Result code. It is returned only with response 200."
persons:
type: array
description: "Array of Person images. It is returned only with response 200."
items:
$ref: "#/components/schemas/SearchPerson"
SearchPerson:
title: "SearchPerson"
allOf:
- $ref: "./identification.yml#/components/schemas/Person"
- $ref: "#/components/schemas/SearchPersonData"
SearchPersonData:
title: "SearchPersonData"
type: object
properties:
detection:
$ref: "#/components/schemas/SearchDetection"
images:
type: array
description: "Array of Person images."
items:
$ref: "#/components/schemas/RecognizeImage"
SearchDetection:
title: "SearchDetection"
type: object
description: "The array of identified persons."
properties:
code:
type: integer
description: "Internal."
crop:
type: string
format: base64
description: "Base64 of the aligned and cropped portrait."
detectorType:
type: integer
description: "Internal."
hash:
type: string
description: "Internal."
idx:
type: integer
description: "Internal."
image:
type: string
format: base64
description: "Internal."
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 ] ]
landmarksType:
type: integer
description: "Internal."
example: 2
msg:
type: string
description: "Internal."
roi:
$ref: "./common.yml#/components/schemas/FaceRectangular"
versionSDK:
type: string
example: "5.2.245.687"