Skip to content

Commit

Permalink
Merge pull request #38 from regulaforensics/SP-6018-match_and_search_…
Browse files Browse the repository at this point in the history
…request

[SP-6018] Add Match&Search in one request
  • Loading branch information
dangost authored Nov 29, 2022
2 parents f68d501 + b2abec2 commit b5f1243
Show file tree
Hide file tree
Showing 5 changed files with 119 additions and 17 deletions.
3 changes: 2 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,2 +1,3 @@
.idea
*.html
*.html
/sample.json
7 changes: 7 additions & 0 deletions identification.yml
Original file line number Diff line number Diff line change
Expand Up @@ -63,12 +63,19 @@ components:
created_at:
type: string
description: "The returned image creation date."
updated_at:
type: string
description: "The returned image update date."
path:
type: string
description: "The returned image S3 path."
url:
type: string
description: "The returned image URL."
metadata:
type: object
additionalProperties: true
description: "A free-form object containing person's extended attributes."
GroupPage:
allOf:
- type: object
Expand Down
2 changes: 2 additions & 0 deletions index.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,6 +20,8 @@ servers:
paths:
/api/match:
$ref: './matching.yml#/paths/~1match'
/api/match_and_search:
$ref: './match_and_search.yml#/paths/~1match_and_search'
/api/detect:
$ref: './detect.yml#/paths/~1detect'
/api/persons:
Expand Down
88 changes: 88 additions & 0 deletions match_and_search.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,88 @@
openapi: 3.0.3
paths:
/match_and_search:
parameters:
- $ref: './common.yml#/components/parameters/x-request'
post:
tags:
- matching
summary: 'Match and Search in one request'
operationId: match_and_search
requestBody:
required: true
content:
application/json:
schema:
$ref: '#/components/schemas/MatchAndSearchRequest'
responses:
200:
description: 'Successful operation; the compare results are returned.'
content:
application/json:
schema:
$ref: '#/components/schemas/MatchAndSearchResponse'
403:
$ref: './common.yml#/components/responses/BadLicense'
components:
schemas:
MatchAndSearchRequest:
allOf:
- type: object
properties:
images:
type: array
items:
type: object
properties:
content:
$ref: './common.yml#/components/schemas/ImageData'
type:
$ref: './matching.yml#/components/schemas/ImageSource'
- $ref: './search.yml#/definitions/SearchParameters'

MatchAndSearchResponse:
allOf:
- $ref: './common.yml#/components/schemas/FaceSDKResult'
- type: object
properties:
detections:
type: array
items:
type: object
properties:
faces:
type: array
items:
allOf:
- $ref: './matching.yml#/components/schemas/DetectionFace'
- type: object
properties:
persons:
type: array
items:
$ref: '#/components/schemas/PersonWithImages'
rotationAngle:
type: float
example: 2.1272900104522705
imageIndex:
$ref: './matching.yml#/components/schemas/MatchImageIndex'
status:
$ref: './common.yml#/components/schemas/FaceSDKResultCode'
results:
$ref: './matching.yml#/components/schemas/MatchImageResult'
elapsedTime:
type: float
example: 1.317137987
metadata:
type: object
additionalProperties: true
description: "A free-form object containing person's extended attributes."
PersonWithImages:
allOf:
- type: object
properties:
images:
type: array
items:
$ref: './search.yml#/definitions/RecognizeImage'
- $ref: './identification.yml#/components/schemas/Person'
36 changes: 20 additions & 16 deletions search.yml
Original file line number Diff line number Diff line change
Expand Up @@ -29,23 +29,27 @@ paths:
definitions:
SearchRequest:
allOf:
- type: object
description: "Request search data."
properties:
limit:
type: integer
default: 100
description: "The number of returned Persons limit."
threshold:
type: float
default: 1.0
description: "The similarity distance threshold."
group_ids:
type: array
description: "The IDs of the groups in which the search is performed."
items:
type: integer
- $ref: "#/definitions/SearchParameters"
- $ref: "./identification.yml#/components/schemas/ImageFields"

SearchParameters:
type: object
description: "Request search data."
properties:
limit:
type: integer
default: 100
description: "The number of returned Persons limit."
threshold:
type: float
default: 1.0
description: "The similarity distance threshold."
group_ids:
type: array
description: "The IDs of the groups in which the search is performed."
items:
type: integer

RecognizeImage:
allOf:
- $ref: "./identification.yml#/components/schemas/Image"
Expand Down

0 comments on commit b5f1243

Please sign in to comment.