swagger: '2.0'
info:
version: 2020-08-01-preview
title: Microsoft Azure AccessControlClient AccessConnector Largefacelists API
schemes:
- https
tags:
- name: Largefacelists
paths:
/largefacelists/{largeFaceListId}:
put:
description: 'Create an empty large face list with user-specified largeFaceListId, name, an optional userData and recognitionModel.
Large face list is a list of faces, up to 1,000,000 faces, and used by [Face - Find Similar](https://docs.microsoft.com/rest/api/faceapi/face/findsimilar).
After creation, user should use [LargeFaceList Face - Add](https://docs.microsoft.com/rest/api/faceapi/largefacelist/addfacefromurl) to import the faces and [LargeFaceList - Train](https://docs.microsoft.com/rest/api/faceapi/largefacelist/train) to make it ready for [Face - Find Similar](https://docs.microsoft.com/rest/api/faceapi/face/findsimilar). No image will be stored. Only the extracted face features are stored on server until [LargeFaceList - Delete](https://docs.microsoft.com/rest/api/faceapi/largefacelist/delete) is called.
Find Similar is used for scenario like finding celebrity-like faces, similar face filtering, or as a light way face identification. But if the actual use is to identify person, please use [PersonGroup](https://docs.microsoft.com/rest/api/faceapi/persongroup) / [LargePersonGroup](https://docs.microsoft.com/rest/api/faceapi/largepersongroup) and [Face - Identify](https://docs.microsoft.com/rest/api/faceapi/face/identify).
''recognitionModel'' should be specified to associate with this large face list. The default value for ''recognitionModel'' is ''recognition_01'', if the latest model needed, please explicitly specify the model you need in this parameter. New faces that are added to an existing large face list will use the recognition model that''s already associated with the collection. Existing face features in a large face list can''t be updated to features extracted by another version of recognition model. Please refer to [Specify a recognition model](https://docs.microsoft.com/azure/cognitive-services/face/face-api-how-to-topics/specify-recognition-model).
Large face list quota:
* Free-tier subscription quota: 64 large face lists.
* S0-tier subscription quota: 1,000,000 large face lists.'
operationId: microsoftAzureLargefacelistCreate
parameters:
- $ref: '#/parameters/largeFaceListId'
- name: body
description: Request body for creating a large face list.
in: body
required: true
x-ms-client-flatten: true
schema:
$ref: '#/definitions/MetaDataContract'
consumes:
- application/json
produces:
- application/json
responses:
'200':
description: A successful call returns an empty response body.
default:
description: Error response.
schema:
$ref: '#/definitions/APIError'
x-ms-examples:
Create new large face list example:
$ref: ./examples/CreateNewLargeFaceList.json
summary: Microsoft Azure Put Largefacelists Largefacelistid
tags:
- Largefacelists
get:
description: Retrieve a large face list’s largeFaceListId, name, userData and recognitionModel.
operationId: microsoftAzureLargefacelistGet
parameters:
- $ref: '#/parameters/largeFaceListId'
- $ref: '#/parameters/returnRecognitionModel'
produces:
- application/json
responses:
'200':
description: A successful call returns the large face list's information.
schema:
$ref: '#/definitions/LargeFaceList'
default:
description: Error response.
schema:
$ref: '#/definitions/APIError'
x-ms-examples:
Get large face list example:
$ref: ./examples/GetLargeFaceList.json
summary: Microsoft Azure Get Largefacelists Largefacelistid
tags:
- Largefacelists
patch:
description: Update information of a large face list.
operationId: microsoftAzureLargefacelistUpdate
parameters:
- $ref: '#/parameters/largeFaceListId'
- name: body
description: Request body for updating a large face list.
in: body
required: true
x-ms-client-flatten: true
schema:
$ref: '#/definitions/NameAndUserDataContract'
consumes:
- application/json
produces:
- application/json
responses:
'200':
description: A successful call returns an empty response body.
default:
description: Error response.
schema:
$ref: '#/definitions/APIError'
x-ms-examples:
Update large face list example:
$ref: ./examples/UpdateLargeFaceList.json
summary: Microsoft Azure Patch Largefacelists Largefacelistid
tags:
- Largefacelists
delete:
description: Delete a specified large face list.
operationId: microsoftAzureLargefacelistDelete
parameters:
- $ref: '#/parameters/largeFaceListId'
produces:
- application/json
responses:
'200':
description: A successful call returns an empty response body.
default:
description: Error response.
schema:
$ref: '#/definitions/APIError'
x-ms-examples:
Delete large face list example:
$ref: ./examples/DeleteLargeFaceList.json
summary: Microsoft Azure Delete Largefacelists Largefacelistid
tags:
- Largefacelists
/largefacelists/{largeFaceListId}/training:
get:
description: Retrieve the training status of a large face list (completed or ongoing).
operationId: microsoftAzureLargefacelistGettrainingstatus
parameters:
- $ref: '#/parameters/largeFaceListId'
responses:
'200':
description: A successful call returns the large face list's training status.
schema:
$ref: '#/definitions/TrainingStatus'
default:
description: Error response.
schema:
$ref: '#/definitions/APIError'
produces:
- application/json
x-ms-examples:
Get large face list's training status example:
$ref: ./examples/GetLargeFaceListTrainingStatus.json
summary: Microsoft Azure Get Largefacelists Largefacelistid Training
tags:
- Largefacelists
/largefacelists:
get:
description: 'List large face lists’ information of largeFaceListId, name, userData and recognitionModel.
To get face information inside largeFaceList use [LargeFaceList Face - Get](https://docs.microsoft.com/rest/api/faceapi/largefacelist/getface)
* Large face lists are stored in alphabetical order of largeFaceListId.
* "start" parameter (string, optional) is a user-provided largeFaceListId value that returned entries have larger ids by string comparison. "start" set to empty to indicate return from the first item.
* "top" parameter (int, optional) specifies the number of entries to return. A maximal of 1000 entries can be returned in one call. To fetch more, you can specify "start" with the last returned entry’s Id of the current call.
For example, total 5 large person lists: "list1", ..., "list5".
"start=&top=" will return all 5 lists.
"start=&top=2" will return "list1", "list2".
"start=list2&top=3" will return "list3", "list4", "list5".
'
operationId: microsoftAzureLargefacelistList
parameters:
- $ref: '#/parameters/returnRecognitionModel'
- name: start
description: Starting large face list id to return (used to list a range of large face lists).
in: query
required: false
type: string
- name: top
description: Number of large face lists to return starting with the large face list id indicated by the 'start' parameter.
in: query
required: false
type: integer
minimum: 1
maximum: 1000
responses:
'200':
description: A successful call returns an array of largeFaceList.
schema:
$ref: '#/definitions/LargeFaceLists'
default:
description: Error response.
schema:
$ref: '#/definitions/APIError'
produces:
- application/json
x-ms-examples:
List large face lists example:
$ref: ./examples/ListLargeFaceLists.json
summary: Microsoft Azure Get Largefacelists
tags:
- Largefacelists
/largefacelists/{largeFaceListId}/train:
post:
description: Queue a large face list training task, the training task may not be started immediately.
operationId: microsoftAzureLargefacelistTrain
parameters:
- $ref: '#/parameters/largeFaceListId'
produces:
- application/json
responses:
'202':
description: The training task was queued successfully.
default:
description: Error response.
schema:
$ref: '#/definitions/APIError'
x-ms-examples:
Queue large face list training:
$ref: ./examples/QueueLargeFaceListTraining.json
summary: Microsoft Azure Post Largefacelists Largefacelistid Train
tags:
- Largefacelists
/largefacelists/{largeFaceListId}/persistedfaces/{persistedFaceId}:
delete:
description: Delete a face from a large face list by specified largeFaceListId and persistedFaceId.
Adding/deleting faces to/from a same large face list are processed sequentially and to/from different large face lists are in parallel.
operationId: microsoftAzureLargefacelistDeleteface
parameters:
- $ref: '#/parameters/largeFaceListId'
- $ref: '#/parameters/persistedFaceId'
produces:
- application/json
responses:
'200':
description: A successful call returns an empty response body.
default:
description: Error response.
schema:
$ref: '#/definitions/APIError'
x-ms-examples:
Delete face in large face list example:
$ref: ./examples/DeleteLargeFaceListFace.json
summary: Microsoft Azure Delete Largefacelists Largefacelistid Persistedfaces Persistedfaceid
tags:
- Largefacelists
get:
description: Retrieve information about a persisted face (specified by persistedFaceId and its belonging largeFaceListId).
operationId: microsoftAzureLargefacelistGetface
parameters:
- $ref: '#/parameters/largeFaceListId'
- $ref: '#/parameters/persistedFaceId'
produces:
- application/json
responses:
'200':
description: A successful call returns target persisted face's information (persistedFaceId and userData).
schema:
$ref: '#/definitions/PersistedFace'
default:
description: Error response.
schema:
$ref: '#/definitions/APIError'
x-ms-examples:
Get persisted face example:
$ref: ./examples/GetLargeFaceListPersistedFace.json
summary: Microsoft Azure Get Largefacelists Largefacelistid Persistedfaces Persistedfaceid
tags:
- Largefacelists
patch:
description: Update a persisted face's userData field.
operationId: microsoftAzureLargefacelistUpdateface
parameters:
- $ref: '#/parameters/largeFaceListId'
- $ref: '#/parameters/persistedFaceId'
- name: body
description: Request body for updating persisted face.
in: body
required: true
x-ms-client-flatten: true
schema:
$ref: '#/definitions/UpdateFaceRequest'
consumes:
- application/json
produces:
- application/json
responses:
'200':
description: A successful call returns an empty response body.
default:
description: Error response.
schema:
$ref: '#/definitions/APIError'
x-ms-examples:
Update face example:
$ref: ./examples/UpdateLargeFaceListFace.json
summary: Microsoft Azure Patch Largefacelists Largefacelistid Persistedfaces Persistedfaceid
tags:
- Largefacelists
/largefacelists/{largeFaceListId}/persistedfaces:
post:
description: 'Add a face to a specified large face list, up to 1,000,000 faces.
To deal with an image contains multiple faces, input face can be specified as an image with a targetFace rectangle. It returns a persistedFaceId representing the added face. No image will be stored. Only the extracted face feature will be stored on server until [LargeFaceList Face - Delete](https://docs.microsoft.com/rest/api/faceapi/largefacelist/deleteface) or [LargeFaceList - Delete](https://docs.microsoft.com/rest/api/faceapi/largefacelist/delete) is called.
Note persistedFaceId is different from faceId generated by [Face - Detect](https://docs.microsoft.com/rest/api/faceapi/face/detectwithurl).
* Higher face image quality means better recognition precision. Please consider high-quality faces: frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger.
* JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB.
* "targetFace" rectangle should contain one face. Zero or multiple faces will be regarded as an error. If the provided "targetFace" rectangle is not returned from [Face - Detect](https://docs.microsoft.com/rest/api/faceapi/face/detectwithurl), there’s no guarantee to detect and add the face successfully.
* Out of detectable face size (36x36 - 4096x4096 pixels), large head-pose, or large occlusions will cause failures.
* Adding/deleting faces to/from a same face list are processed sequentially and to/from different face lists are in parallel.
* The minimum detectable face size is 36x36 pixels in an image no larger than 1920x1080 pixels. Images with dimensions higher than 1920x1080 pixels will need a proportionally larger minimum face size.
* Different ''detectionModel'' values can be provided. To use and compare different detection models, please refer to [How to specify a detection model](https://docs.microsoft.com/azure/cognitive-services/face/face-api-how-to-topics/specify-detection-model)
Quota:
* Free-tier subscription quota: 1,000 faces per large face list.
* S0-tier subscription quota: 1,000,000 faces per large face list.'
operationId: microsoftAzureLargefacelistAddfacefromurl
parameters:
- $ref: '#/parameters/largeFaceListId'
- $ref: '#/parameters/faceUserData'
- $ref: '#/parameters/targetFace'
- $ref: ../../../Common/Parameters.json#/parameters/ImageUrl
- $ref: '#/parameters/detectionModel'
produces:
- application/json
consumes:
- application/json
responses:
'200':
description: A successful call returns a new persistedFaceId.
schema:
$ref: '#/definitions/PersistedFace'
default:
description: Error response.
schema:
$ref: '#/definitions/APIError'
x-ms-examples:
Create large face list face example:
$ref: ./examples/AddLargeFaceListFaceFromUrl.json
summary: Microsoft Azure Post Largefacelists Largefacelistid Persistedfaces
tags:
- Largefacelists
get:
description: List all faces in a large face list, and retrieve face information (including userData and persistedFaceIds of registered faces of the face).
operationId: microsoftAzureLargefacelistListfaces
parameters:
- $ref: '#/parameters/largeFaceListId'
- name: start
description: Starting face id to return (used to list a range of faces).
in: query
required: false
type: string
- name: top
description: Number of faces to return starting with the face id indicated by the 'start' parameter.
in: query
required: false
type: integer
minimum: 1
maximum: 1000
produces:
- application/json
responses:
'200':
description: A successful call returns an array of face information that belong to the large face list.
schema:
$ref: '#/definitions/PersistedFaces'
default:
description: Error response.
schema:
$ref: '#/definitions/APIError'
x-ms-examples:
List faces in large face list:
$ref: ./examples/ListLargeFaceListFaces.json
summary: Microsoft Azure Get Largefacelists Largefacelistid Persistedfaces
tags:
- Largefacelists
definitions:
RecognitionModel:
type: string
description: Name of recognition model. Recognition model is used when the face features are extracted and associated with detected faceIds, (Large)FaceList or (Large)PersonGroup. A recognition model name can be provided when performing Face - Detect or (Large)FaceList - Create or (Large)PersonGroup - Create. The default value is 'recognition_01', if latest model needed, please explicitly specify the model you need.
default: recognition_01
x-nullable: false
x-ms-enum:
name: RecognitionModel
modelAsString: true
enum:
- recognition_01
- recognition_02
- recognition_03
- recognition_04
NameAndUserDataContract:
type: object
description: A combination of user defined name and user specified data for the person, largePersonGroup/personGroup, and largeFaceList/faceList.
properties:
name:
type: string
description: User defined name, maximum length is 128.
maxLength: 128
userData:
type: string
description: User specified data. Length should not exceed 16KB.
maxLength: 16384
MetaDataContract:
type: object
description: A combination of user defined name and user specified data and recognition model name for largePersonGroup/personGroup, and largeFaceList/faceList.
properties:
recognitionModel:
$ref: '#/definitions/RecognitionModel'
allOf:
- $ref: '#/definitions/NameAndUserDataContractForCreation'
PersistedFace:
type: object
required:
- persistedFaceId
description: PersonFace object.
properties:
persistedFaceId:
type: string
format: uuid
description: The persistedFaceId of the target face, which is persisted and will not expire. Different from faceId created by Face - Detect and will expire in at the time specified by faceIdTimeToLive after the detection call.
userData:
type: string
description: User-provided data attached to the face. The size limit is 1KB.
maxLength: 1024
UpdateFaceRequest:
type: object
description: Request to update face data.
properties:
userData:
type: string
description: User-provided data attached to the face. The size limit is 1KB.
maxLength: 1024
TrainingStatus:
type: object
required:
- status
- createdDateTime
description: Training status object.
properties:
status:
type: string
description: 'Training status: notstarted, running, succeeded, failed. If the training process is waiting to perform, the status is notstarted. If the training is ongoing, the status is running. Status succeed means this person group or large person group is ready for Face - Identify, or this large face list is ready for Face - Find Similar. Status failed is often caused by no person or no persisted face exist in the person group or large person group, or no persisted face exist in the large face list.'
x-ms-enum:
name: TrainingStatusType
modelAsString: false
enum:
- nonstarted
- running
- succeeded
- failed
createdDateTime:
type: string
format: date-time
description: A combined UTC date and time string that describes the created time of the person group, large person group or large face list.
x-ms-client-name: created
lastActionDateTime:
type: string
format: date-time
description: A combined UTC date and time string that describes the last modify time of the person group, large person group or large face list, could be null value when the group is not successfully trained.
x-ms-client-name: lastAction
lastSuccessfulTrainingDateTime:
type: string
format: date-time
description: A combined UTC date and time string that describes the last successful training time of the person group, large person group or large face list.
x-ms-client-name: lastSuccessfulTraining
message:
type: string
description: Show failure message when training failed (omitted when training succeed).
LargeFaceList:
description: Large face list object.
type: object
required:
- largeFaceListId
- name
properties:
largeFaceListId:
type: string
description: LargeFaceListId of the target large face list.
maxLength: 64
pattern: ^[a-z0-9-_]+$
name:
type: string
description: User defined name, maximum length is 128.
maxLength: 128
minLength: 1
userData:
type: string
description: User specified data. Length should not exceed 16KB.
maxLength: 16384
recognitionModel:
$ref: '#/definitions/RecognitionModel'
APIError:
type: object
description: Error information returned by the API
properties:
error:
$ref: '#/definitions/Error'
PersistedFaces:
type: array
description: An array of persisted faces within the face list or large face list.
items:
$ref: '#/definitions/PersistedFace'
LargeFaceLists:
type: array
description: An array of large face list results, with fields of largeFaceListId, name and userData
items:
$ref: '#/definitions/LargeFaceList'
Error:
type: object
description: Error body.
properties:
code:
type: string
message:
type: string
NameAndUserDataContractForCreation:
type: object
description: A combination of user defined name and user specified data for the person, largePersonGroup/personGroup, and largeFaceList/faceList.
required:
- name
properties:
name:
type: string
description: User defined name, maximum length is 128.
maxLength: 128
minLength: 1
userData:
type: string
description: User specified data. Length should not exceed 16KB.
maxLength: 16384
parameters:
persistedFaceId:
name: persistedFaceId
in: path
description: Id referencing a particular persistedFaceId of an existing face.
required: true
type: string
format: uuid
x-ms-parameter-location: method
collectionFormat: csv
detectionModel:
name: detectionModel
description: Name of detection model. Detection model is used to detect faces in the submitted image. A detection model name can be provided when performing Face - Detect or (Large)FaceList - Add Face or (Large)PersonGroup - Add Face. The default value is 'detection_01', if another model is needed, please explicitly specify it.
default: detection_01
required: false
type: string
in: query
x-ms-parameter-location: method
x-nullable: false
x-ms-enum:
name: DetectionModel
modelAsString: true
enum:
- detection_01
- detection_02
- detection_03
faceUserData:
name: userData
in: query
description: User-specified data about the face for any purpose. The maximum length is 1KB.
type: string
maxLength: 1024
x-ms-parameter-location: method
required: false
collectionFormat: csv
targetFace:
name: targetFace
in: query
description: A face rectangle to specify the target face to be added to a person in the format of "targetFace=left,top,width,height". E.g. "targetFace=10,10,100,100". If there is more than one face in the image, targetFace is required to specify which face to add. No targetFace means there is only one face detected in the entire image.
type: array
x-ms-parameter-location: method
required: false
collectionFormat: csv
items:
type: integer
format: int32
x-nullable: false
maxItems: 4
minItems: 4
largeFaceListId:
name: largeFaceListId
in: path
description: Id referencing a particular large face list.
required: true
type: string
x-ms-parameter-location: method
collectionFormat: csv
maxLength: 64
pattern: ^[a-z0-9-_]+$
returnRecognitionModel:
name: returnRecognitionModel
description: A value indicating whether the operation should return 'recognitionModel' in response.
default: false
required: false
type: boolean
in: query
x-ms-parameter-location: method
x-ms-parameterized-host:
hostTemplate: '{endpoint}'
useSchemePrefix: false
parameters:
- $ref: '#/parameters/Endpoint'