swagger: '2.0'
info:
version: 2020-08-01-preview
title: Microsoft Azure AccessControlClient AccessConnector Largepersongroups API
schemes:
- https
tags:
- name: Largepersongroups
paths:
/largepersongroups/{largePersonGroupId}/persons:
post:
description: Create a new person in a specified large person group.
operationId: microsoftAzureLargepersongrouppersonCreate
parameters:
- $ref: '#/parameters/largePersonGroupId'
- name: body
description: Request body for creating new person.
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 a new personId created.
schema:
$ref: '#/definitions/Person'
default:
description: Error response.
schema:
$ref: '#/definitions/APIError'
x-ms-examples:
Create new person for large person group example:
$ref: ./examples/CreateNewLargePersonGroupPerson.json
summary: Microsoft Azure Post Largepersongroups Largepersongroupid Persons
tags:
- Largepersongroups
get:
description: List all persons in a large person group, and retrieve person information (including personId, name, userData and persistedFaceIds of registered faces of the person).
operationId: microsoftAzureLargepersongrouppersonList
parameters:
- $ref: '#/parameters/largePersonGroupId'
- name: start
description: Starting person id to return (used to list a range of persons).
in: query
required: false
type: string
- name: top
description: Number of persons to return starting with the person 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 person information that belong to the large person group.
schema:
$ref: '#/definitions/Persons'
default:
description: Error response.
schema:
$ref: '#/definitions/APIError'
x-ms-examples:
List persons in person group:
$ref: ./examples/ListLargePersonGroupPersons.json
summary: Microsoft Azure Get Largepersongroups Largepersongroupid Persons
tags:
- Largepersongroups
/largepersongroups/{largePersonGroupId}/persons/{personId}:
delete:
description: Delete an existing person from a large person group. The persistedFaceId, userData, person name and face feature in the person entry will all be deleted.
operationId: microsoftAzureLargepersongrouppersonDelete
parameters:
- $ref: '#/parameters/largePersonGroupId'
- $ref: '#/parameters/personId'
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 an existing person example:
$ref: ./examples/DeleteLargePersonGroupPerson.json
summary: Microsoft Azure Delete Largepersongroups Largepersongroupid Persons Personid
tags:
- Largepersongroups
get:
description: Retrieve a person's name and userData, and the persisted faceIds representing the registered person face feature.
operationId: microsoftAzureLargepersongrouppersonGet
parameters:
- $ref: '#/parameters/largePersonGroupId'
- $ref: '#/parameters/personId'
produces:
- application/json
responses:
'200':
description: A successful call returns the person's information.
schema:
$ref: '#/definitions/Person'
default:
description: Error response.
schema:
$ref: '#/definitions/APIError'
x-ms-examples:
Get person example:
$ref: ./examples/GetLargePersonGroupPerson.json
summary: Microsoft Azure Get Largepersongroups Largepersongroupid Persons Personid
tags:
- Largepersongroups
patch:
description: Update name or userData of a person.
operationId: microsoftAzureLargepersongrouppersonUpdate
parameters:
- $ref: '#/parameters/largePersonGroupId'
- $ref: '#/parameters/personId'
- name: body
description: Request body for person update operation.
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 person example:
$ref: ./examples/UpdateLargePersonGroupPerson.json
summary: Microsoft Azure Patch Largepersongroups Largepersongroupid Persons Personid
tags:
- Largepersongroups
/largepersongroups/{largePersonGroupId}/persons/{personId}/persistedfaces/{persistedFaceId}:
delete:
description: Delete a face from a person in a large person group by specified largePersonGroupId, personId and persistedFaceId.
Adding/deleting faces to/from a same person will be processed sequentially. Adding/deleting faces to/from different persons are processed in parallel.
operationId: microsoftAzureLargepersongrouppersonDeleteface
parameters:
- $ref: '#/parameters/largePersonGroupId'
- $ref: '#/parameters/personId'
- $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 from person example:
$ref: ./examples/DeleteLargePersonGroupPersonFace.json
summary: Microsoft Azure Delete Largepersongroups Largepersongroupid Persons Personid Persistedfaces Persistedfaceid
tags:
- Largepersongroups
get:
description: Retrieve information about a persisted face (specified by persistedFaceId, personId and its belonging largePersonGroupId).
operationId: microsoftAzureLargepersongrouppersonGetface
parameters:
- $ref: '#/parameters/largePersonGroupId'
- $ref: '#/parameters/personId'
- $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/GetLargePersonGroupPersistedFace.json
summary: Microsoft Azure Get Largepersongroups Largepersongroupid Persons Personid Persistedfaces Persistedfaceid
tags:
- Largepersongroups
patch:
description: Update a person persisted face's userData field.
operationId: microsoftAzureLargepersongrouppersonUpdateface
parameters:
- $ref: '#/parameters/largePersonGroupId'
- $ref: '#/parameters/personId'
- $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 person face example:
$ref: ./examples/UpdateLargePersonGroupPersonFace.json
summary: Microsoft Azure Patch Largepersongroups Largepersongroupid Persons Personid Persistedfaces Persistedfaceid
tags:
- Largepersongroups
/largepersongroups/{largePersonGroupId}:
put:
description: 'Create a new large person group with user-specified largePersonGroupId, name, an optional userData and recognitionModel.
A large person group is the container of the uploaded person data, including face recognition feature, and up to 1,000,000
people.
After creation, use [LargePersonGroup Person - Create](https://docs.microsoft.com/rest/api/faceapi/largepersongroupperson/create) to add person into the group, and call [LargePersonGroup - Train](https://docs.microsoft.com/rest/api/faceapi/largepersongroup/train) to get this group ready for [Face - Identify](https://docs.microsoft.com/rest/api/faceapi/face/identify).
No image will be stored. Only the person''s extracted face features and userData will be stored on server until [LargePersonGroup Person - Delete](https://docs.microsoft.com/rest/api/faceapi/largepersongroupperson/delete) or [LargePersonGroup - Delete](https://docs.microsoft.com/rest/api/faceapi/largepersongroup/delete) is called.
''recognitionModel'' should be specified to associate with this large person group. 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 person group will use the recognition model that''s already associated with the collection. Existing face features in a large person group can''t be updated to features extracted by another version of recognition model. Please refer to [Specify a face recognition model](https://docs.microsoft.com/azure/cognitive-services/face/face-api-how-to-topics/specify-recognition-model).
Large person group quota:
* Free-tier subscription quota: 1,000 large person groups.
* S0-tier subscription quota: 1,000,000 large person groups.'
operationId: microsoftAzureLargepersongroupCreate
parameters:
- $ref: '#/parameters/largePersonGroupId'
- name: body
description: Request body for creating new large person group.
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 person group example:
$ref: ./examples/CreateNewLargePersonGroup.json
summary: Microsoft Azure Put Largepersongroups Largepersongroupid
tags:
- Largepersongroups
delete:
description: Delete an existing large person group. Persisted face features of all people in the large person group will also be deleted.
operationId: microsoftAzureLargepersongroupDelete
parameters:
- $ref: '#/parameters/largePersonGroupId'
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 a large person group example:
$ref: ./examples/DeleteLargePersonGroup.json
summary: Microsoft Azure Delete Largepersongroups Largepersongroupid
tags:
- Largepersongroups
get:
description: Retrieve the information of a large person group, including its name, userData and recognitionModel. This API returns large person group information only, use [LargePersonGroup Person - List](https://docs.microsoft.com/rest/api/faceapi/largepersongroupperson/list) instead to retrieve person information under the large person group.
operationId: microsoftAzureLargepersongroupGet
parameters:
- $ref: '#/parameters/largePersonGroupId'
- $ref: '#/parameters/returnRecognitionModel'
responses:
'200':
description: A successful call returns the large person group's information.
schema:
$ref: '#/definitions/LargePersonGroup'
default:
description: Error response.
schema:
$ref: '#/definitions/APIError'
produces:
- application/json
x-ms-examples:
Get large person group example:
$ref: ./examples/GetLargePersonGroup.json
summary: Microsoft Azure Get Largepersongroups Largepersongroupid
tags:
- Largepersongroups
patch:
description: Update an existing large person group's display name and userData. The properties which does not appear in request body will not be updated.
operationId: microsoftAzureLargepersongroupUpdate
parameters:
- $ref: '#/parameters/largePersonGroupId'
- name: body
description: Request body for updating large person group.
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 person group example:
$ref: ./examples/UpdateLargePersonGroup.json
summary: Microsoft Azure Patch Largepersongroups Largepersongroupid
tags:
- Largepersongroups
/largepersongroups/{largePersonGroupId}/training:
get:
description: Retrieve the training status of a large person group (completed or ongoing).
operationId: microsoftAzureLargepersongroupGettrainingstatus
parameters:
- $ref: '#/parameters/largePersonGroupId'
responses:
'200':
description: A successful call returns the large person group's training status.
schema:
$ref: '#/definitions/TrainingStatus'
default:
description: Error response.
schema:
$ref: '#/definitions/APIError'
produces:
- application/json
x-ms-examples:
Get large person group's training status example:
$ref: ./examples/GetLargePersonGroupTrainingStatus.json
summary: Microsoft Azure Get Largepersongroups Largepersongroupid Training
tags:
- Largepersongroups
/largepersongroups:
get:
description: 'List all existing large person groups’ largePersonGroupId, name, userData and recognitionModel.
* Large person groups are stored in alphabetical order of largePersonGroupId.
* "start" parameter (string, optional) is a user-provided largePersonGroupId 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 groups: "group1", ..., "group5".
"start=&top=" will return all 5 groups.
"start=&top=2" will return "group1", "group2".
"start=group2&top=3" will return "group3", "group4", "group5".
'
operationId: microsoftAzureLargepersongroupList
parameters:
- name: start
in: query
required: false
description: List large person groups from the least largePersonGroupId greater than the "start".
type: string
maxLength: 64
- name: top
in: query
required: false
description: The number of large person groups to list.
type: integer
minimum: 1
maximum: 1000
default: 1000
- $ref: '#/parameters/returnRecognitionModel'
produces:
- application/json
responses:
'200':
description: A successful call returns an array of large person groups and their information.
schema:
$ref: '#/definitions/LargePersonGroups'
default:
description: Error response.
schema:
$ref: '#/definitions/APIError'
x-ms-examples:
List large person groups example:
$ref: ./examples/ListLargePersonGroups.json
summary: Microsoft Azure Get Largepersongroups
tags:
- Largepersongroups
/largepersongroups/{largePersonGroupId}/train:
post:
description: Queue a large person group training task, the training task may not be started immediately.
operationId: microsoftAzureLargepersongroupTrain
parameters:
- $ref: '#/parameters/largePersonGroupId'
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 person group training:
$ref: ./examples/QueueLargePersonGroupTraining.json
summary: Microsoft Azure Post Largepersongroups Largepersongroupid Train
tags:
- Largepersongroups
/largepersongroups/{largePersonGroupId}/persons/{personId}/persistedfaces:
post:
description: 'Add a face to a person into a large person group for face identification or verification. 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 [LargePersonGroup PersonFace - Delete](https://docs.microsoft.com/rest/api/faceapi/largepersongroupperson/deleteface), [LargePersonGroup Person - Delete](https://docs.microsoft.com/rest/api/faceapi/largepersongroupperson/delete) or [LargePersonGroup - Delete](https://docs.microsoft.com/rest/api/faceapi/largepersongroup/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.
* Each person entry can hold up to 248 faces.
* 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 person will be processed sequentially. Adding/deleting faces to/from different persons are processed 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)'
operationId: microsoftAzureLargepersongrouppersonAddfacefromurl
parameters:
- $ref: '#/parameters/largePersonGroupId'
- $ref: '#/parameters/personId'
- $ref: '#/parameters/faceUserData'
- $ref: '#/parameters/targetFace'
- $ref: ../../../Common/Parameters.json#/parameters/ImageUrl
- $ref: '#/parameters/detectionModel'
consumes:
- application/json
produces:
- application/json
responses:
'200':
description: A successful call returns the new persistedFaceId.
schema:
$ref: '#/definitions/PersistedFace'
default:
description: Error response.
schema:
$ref: '#/definitions/APIError'
x-ms-examples:
Add Person face example:
$ref: ./examples/AddLargePersonGroupPersonFaceFromUrl.json
summary: Microsoft Azure Post Largepersongroups Largepersongroupid Persons Personid Persistedfaces
tags:
- Largepersongroups
definitions:
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).
APIError:
type: object
description: Error information returned by the API
properties:
error:
$ref: '#/definitions/Error'
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
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
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
LargePersonGroup:
type: object
required:
- largePersonGroupId
- name
description: Large person group object.
properties:
largePersonGroupId:
description: LargePersonGroupId of the target large person groups
type: string
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'
LargePersonGroups:
type: array
description: An array of large person groups.
items:
$ref: '#/definitions/LargePersonGroup'
Person:
type: object
required:
- personId
description: Person object.
properties:
personId:
type: string
format: uuid
description: PersonId of the target face list.
persistedFaceIds:
type: array
description: PersistedFaceIds of registered faces in the person. These persistedFaceIds are returned from Person - Add a Person Face, and will not expire.
items:
type: string
format: uuid
x-nullable: false
allOf:
- $ref: '#/definitions/NameAndUserDataContract'
Error:
type: object
description: Error body.
properties:
code:
type: string
message:
type: string
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
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'
Persons:
type: array
description: An array of Persons.
items:
$ref: '#/definitions/Person'
parameters:
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
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
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
personId:
name: personId
in: path
description: Id referencing a particular person.
required: true
type: string
format: uuid
x-ms-parameter-location: method
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
largePersonGroupId:
name: largePersonGroupId
in: path
description: Id referencing a particular large person group.
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'