face

package
v68.0.0+incompatible Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Jan 19, 2023 License: MIT Imports: 10 Imported by: 366

Documentation

Overview

Package face implements the Azure ARM Face service API version 1.0.

An API for face detection, verification, and identification.

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func UserAgent

func UserAgent() string

UserAgent returns the UserAgent string to use when sending http.Requests.

func Version

func Version() string

Version returns the semantic version (see http://semver.org) of the client.

Types

type APIError

type APIError struct {
	Error *Error `json:"error,omitempty"`
}

APIError error information returned by the API

type Accessory

type Accessory struct {
	// Type - Type of an accessory. Possible values include: 'HeadWear', 'Glasses', 'Mask'
	Type AccessoryType `json:"type,omitempty"`
	// Confidence - Confidence level of an accessory
	Confidence *float64 `json:"confidence,omitempty"`
}

Accessory accessory item and corresponding confidence level.

type AccessoryType

type AccessoryType string

AccessoryType enumerates the values for accessory type.

const (
	// Glasses ...
	Glasses AccessoryType = "glasses"
	// HeadWear ...
	HeadWear AccessoryType = "headWear"
	// Mask ...
	Mask AccessoryType = "mask"
)

func PossibleAccessoryTypeValues

func PossibleAccessoryTypeValues() []AccessoryType

PossibleAccessoryTypeValues returns an array of possible values for the AccessoryType const type.

type ApplySnapshotRequest

type ApplySnapshotRequest struct {
	// ObjectID - User specified target object id to be created from the snapshot.
	ObjectID *string `json:"objectId,omitempty"`
	// Mode - Snapshot applying mode. Currently only CreateNew is supported, which means the apply operation will fail if target subscription already contains an object of same type and using the same objectId. Users can specify the "objectId" in request body to avoid such conflicts. Possible values include: 'CreateNew'
	Mode SnapshotApplyMode `json:"mode,omitempty"`
}

ApplySnapshotRequest request body for applying snapshot operation.

type AttributeType

type AttributeType string

AttributeType enumerates the values for attribute type.

const (
	// AttributeTypeAccessories ...
	AttributeTypeAccessories AttributeType = "accessories"
	// AttributeTypeAge ...
	AttributeTypeAge AttributeType = "age"
	// AttributeTypeBlur ...
	AttributeTypeBlur AttributeType = "blur"
	// AttributeTypeEmotion ...
	AttributeTypeEmotion AttributeType = "emotion"
	// AttributeTypeExposure ...
	AttributeTypeExposure AttributeType = "exposure"
	// AttributeTypeFacialHair ...
	AttributeTypeFacialHair AttributeType = "facialHair"
	// AttributeTypeGender ...
	AttributeTypeGender AttributeType = "gender"
	// AttributeTypeGlasses ...
	AttributeTypeGlasses AttributeType = "glasses"
	// AttributeTypeHair ...
	AttributeTypeHair AttributeType = "hair"
	// AttributeTypeHeadPose ...
	AttributeTypeHeadPose AttributeType = "headPose"
	// AttributeTypeMakeup ...
	AttributeTypeMakeup AttributeType = "makeup"
	// AttributeTypeNoise ...
	AttributeTypeNoise AttributeType = "noise"
	// AttributeTypeOcclusion ...
	AttributeTypeOcclusion AttributeType = "occlusion"
	// AttributeTypeSmile ...
	AttributeTypeSmile AttributeType = "smile"
)

func PossibleAttributeTypeValues

func PossibleAttributeTypeValues() []AttributeType

PossibleAttributeTypeValues returns an array of possible values for the AttributeType const type.

type Attributes

type Attributes struct {
	// Age - Age in years
	Age *float64 `json:"age,omitempty"`
	// Gender - Possible gender of the face. Possible values include: 'Male', 'Female'
	Gender Gender `json:"gender,omitempty"`
	// Smile - Smile intensity, a number between [0,1]
	Smile *float64 `json:"smile,omitempty"`
	// FacialHair - Properties describing facial hair attributes.
	FacialHair *FacialHair `json:"facialHair,omitempty"`
	// Glasses - Glasses type if any of the face. Possible values include: 'NoGlasses', 'ReadingGlasses', 'Sunglasses', 'SwimmingGoggles'
	Glasses GlassesType `json:"glasses,omitempty"`
	// HeadPose - Properties indicating head pose of the face.
	HeadPose *HeadPose `json:"headPose,omitempty"`
	// Emotion - Properties describing facial emotion in form of confidence ranging from 0 to 1.
	Emotion *Emotion `json:"emotion,omitempty"`
	// Hair - Properties describing hair attributes.
	Hair *Hair `json:"hair,omitempty"`
	// Makeup - Properties describing present makeups on a given face.
	Makeup *Makeup `json:"makeup,omitempty"`
	// Occlusion - Properties describing occlusions on a given face.
	Occlusion *Occlusion `json:"occlusion,omitempty"`
	// Accessories - Properties describing any accessories on a given face.
	Accessories *[]Accessory `json:"accessories,omitempty"`
	// Blur - Properties describing any presence of blur within the image.
	Blur *Blur `json:"blur,omitempty"`
	// Exposure - Properties describing exposure level of the image.
	Exposure *Exposure `json:"exposure,omitempty"`
	// Noise - Properties describing noise level of the image.
	Noise *Noise `json:"noise,omitempty"`
}

Attributes face Attributes

type BaseClient

type BaseClient struct {
	autorest.Client
	Endpoint string
}

BaseClient is the base client for Face.

func New

func New(endpoint string) BaseClient

New creates an instance of the BaseClient client.

func NewWithoutDefaults

func NewWithoutDefaults(endpoint string) BaseClient

NewWithoutDefaults creates an instance of the BaseClient client.

type Blur

type Blur struct {
	// BlurLevel - An enum value indicating level of blurriness. Possible values include: 'Low', 'Medium', 'High'
	BlurLevel BlurLevel `json:"blurLevel,omitempty"`
	// Value - A number indicating level of blurriness ranging from 0 to 1.
	Value *float64 `json:"value,omitempty"`
}

Blur properties describing any presence of blur within the image.

type BlurLevel

type BlurLevel string

BlurLevel enumerates the values for blur level.

const (
	// High ...
	High BlurLevel = "High"
	// Low ...
	Low BlurLevel = "Low"
	// Medium ...
	Medium BlurLevel = "Medium"
)

func PossibleBlurLevelValues

func PossibleBlurLevelValues() []BlurLevel

PossibleBlurLevelValues returns an array of possible values for the BlurLevel const type.

type Client

type Client struct {
	BaseClient
}

Client is the an API for face detection, verification, and identification.

func NewClient

func NewClient(endpoint string) Client

NewClient creates an instance of the Client client.

func (Client) DetectWithStream

func (client Client) DetectWithStream(ctx context.Context, imageParameter io.ReadCloser, returnFaceID *bool, returnFaceLandmarks *bool, returnFaceAttributes []AttributeType, recognitionModel RecognitionModel, returnRecognitionModel *bool, detectionModel DetectionModel) (result ListDetectedFace, err error)

DetectWithStream detect human faces in an image, return face rectangles, and optionally with faceIds, landmarks, and attributes.<br /> * No image will be stored. Only the extracted face feature will be stored on server. The faceId is an identifier of the face feature and will be used in [Face - Identify](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/identify), [Face - Verify](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/verifyfacetoface), and [Face - Find Similar](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/findsimilar). The stored face feature(s) will expire and be deleted 24 hours after the original detection call. * Optional parameters include faceId, landmarks, and attributes. Attributes include age, gender, headPose, smile, facialHair, glasses, emotion, hair, makeup, occlusion, accessories, blur, exposure and noise. Some of the results returned for specific attributes may not be highly accurate. * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. * Up to 100 faces can be returned for an image. Faces are ranked by face rectangle size from large to small. * For optimal results when querying [Face - Identify](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/identify), [Face - Verify](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/verifyfacetoface), and [Face - Find Similar](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/findsimilar) ('returnFaceId' is true), please use faces that are: frontal, clear, and with a minimum size of 200x200 pixels (100 pixels between eyes). * 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) | Model | Recommended use-case(s) | | ---------- | -------- | | 'detection_01': | The default detection model for [Face - Detect](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/detectwithurl). Recommend for near frontal face detection. For scenarios with exceptionally large angle (head-pose) faces, occluded faces or wrong image orientation, the faces in such cases may not be detected. | | 'detection_02': | Detection model released in 2019 May with improved accuracy especially on small, side and blurry faces. |

* Different 'recognitionModel' values are provided. If follow-up operations like Verify, Identify, Find Similar are needed, please specify the recognition model with 'recognitionModel' parameter. The default value for 'recognitionModel' is 'recognition_01', if latest model needed, please explicitly specify the model you need in this parameter. Once specified, the detected faceIds will be associated with the specified recognition model. More details, please refer to [How to specify a recognition model](https://docs.microsoft.com/azure/cognitive-services/face/face-api-how-to-topics/specify-recognition-model) | Model | Recommended use-case(s) | | ---------- | -------- | | 'recognition_01': | The default recognition model for [Face - Detect](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/detectwithurl). All those faceIds created before 2019 March are bonded with this recognition model. | | 'recognition_02': | Recognition model released in 2019 March. | | 'recognition_03': | Recognition model released in 2020 May. 'recognition_03' is recommended since its overall accuracy is improved compared with 'recognition_01' and 'recognition_02'. | Parameters: imageParameter - an image stream. returnFaceID - a value indicating whether the operation should return faceIds of detected faces. returnFaceLandmarks - a value indicating whether the operation should return landmarks of the detected faces. returnFaceAttributes - analyze and return the one or more specified face attributes in the comma-separated string like "returnFaceAttributes=age,gender". Supported face attributes include age, gender, headPose, smile, facialHair, glasses and emotion. Note that each face attribute analysis has additional computational and time cost. recognitionModel - 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. returnRecognitionModel - a value indicating whether the operation should return 'recognitionModel' in response. detectionModel - 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.

func (Client) DetectWithStreamPreparer

func (client Client) DetectWithStreamPreparer(ctx context.Context, imageParameter io.ReadCloser, returnFaceID *bool, returnFaceLandmarks *bool, returnFaceAttributes []AttributeType, recognitionModel RecognitionModel, returnRecognitionModel *bool, detectionModel DetectionModel) (*http.Request, error)

DetectWithStreamPreparer prepares the DetectWithStream request.

func (Client) DetectWithStreamResponder

func (client Client) DetectWithStreamResponder(resp *http.Response) (result ListDetectedFace, err error)

DetectWithStreamResponder handles the response to the DetectWithStream request. The method always closes the http.Response Body.

func (Client) DetectWithStreamSender

func (client Client) DetectWithStreamSender(req *http.Request) (*http.Response, error)

DetectWithStreamSender sends the DetectWithStream request. The method will close the http.Response Body if it receives an error.

func (Client) DetectWithURL

func (client Client) DetectWithURL(ctx context.Context, imageURL ImageURL, returnFaceID *bool, returnFaceLandmarks *bool, returnFaceAttributes []AttributeType, recognitionModel RecognitionModel, returnRecognitionModel *bool, detectionModel DetectionModel) (result ListDetectedFace, err error)

DetectWithURL detect human faces in an image, return face rectangles, and optionally with faceIds, landmarks, and attributes.<br /> * No image will be stored. Only the extracted face feature will be stored on server. The faceId is an identifier of the face feature and will be used in [Face - Identify](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/identify), [Face - Verify](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/verifyfacetoface), and [Face - Find Similar](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/findsimilar). The stored face feature(s) will expire and be deleted 24 hours after the original detection call. * Optional parameters include faceId, landmarks, and attributes. Attributes include age, gender, headPose, smile, facialHair, glasses, emotion, hair, makeup, occlusion, accessories, blur, exposure and noise. Some of the results returned for specific attributes may not be highly accurate. * JPEG, PNG, GIF (the first frame), and BMP format are supported. The allowed image file size is from 1KB to 6MB. * Up to 100 faces can be returned for an image. Faces are ranked by face rectangle size from large to small. * For optimal results when querying [Face - Identify](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/identify), [Face - Verify](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/verifyfacetoface), and [Face - Find Similar](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/findsimilar) ('returnFaceId' is true), please use faces that are: frontal, clear, and with a minimum size of 200x200 pixels (100 pixels between eyes). * 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) | Model | Recommended use-case(s) | | ---------- | -------- | | 'detection_01': | The default detection model for [Face - Detect](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/detectwithurl). Recommend for near frontal face detection. For scenarios with exceptionally large angle (head-pose) faces, occluded faces or wrong image orientation, the faces in such cases may not be detected. | | 'detection_02': | Detection model released in 2019 May with improved accuracy especially on small, side and blurry faces. |

* Different 'recognitionModel' values are provided. If follow-up operations like Verify, Identify, Find Similar are needed, please specify the recognition model with 'recognitionModel' parameter. The default value for 'recognitionModel' is 'recognition_01', if latest model needed, please explicitly specify the model you need in this parameter. Once specified, the detected faceIds will be associated with the specified recognition model. More details, please refer to [How to specify a recognition model](https://docs.microsoft.com/azure/cognitive-services/face/face-api-how-to-topics/specify-recognition-model) | Model | Recommended use-case(s) | | ---------- | -------- | | 'recognition_01': | The default recognition model for [Face - Detect](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/detectwithurl). All those faceIds created before 2019 March are bonded with this recognition model. | | 'recognition_02': | Recognition model released in 2019 March. | | 'recognition_03': | Recognition model released in 2020 May. 'recognition_03' is recommended since its overall accuracy is improved compared with 'recognition_01' and 'recognition_02'. | Parameters: imageURL - a JSON document with a URL pointing to the image that is to be analyzed. returnFaceID - a value indicating whether the operation should return faceIds of detected faces. returnFaceLandmarks - a value indicating whether the operation should return landmarks of the detected faces. returnFaceAttributes - analyze and return the one or more specified face attributes in the comma-separated string like "returnFaceAttributes=age,gender". Supported face attributes include age, gender, headPose, smile, facialHair, glasses and emotion. Note that each face attribute analysis has additional computational and time cost. recognitionModel - 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. returnRecognitionModel - a value indicating whether the operation should return 'recognitionModel' in response. detectionModel - 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.

func (Client) DetectWithURLPreparer

func (client Client) DetectWithURLPreparer(ctx context.Context, imageURL ImageURL, returnFaceID *bool, returnFaceLandmarks *bool, returnFaceAttributes []AttributeType, recognitionModel RecognitionModel, returnRecognitionModel *bool, detectionModel DetectionModel) (*http.Request, error)

DetectWithURLPreparer prepares the DetectWithURL request.

func (Client) DetectWithURLResponder

func (client Client) DetectWithURLResponder(resp *http.Response) (result ListDetectedFace, err error)

DetectWithURLResponder handles the response to the DetectWithURL request. The method always closes the http.Response Body.

func (Client) DetectWithURLSender

func (client Client) DetectWithURLSender(req *http.Request) (*http.Response, error)

DetectWithURLSender sends the DetectWithURL request. The method will close the http.Response Body if it receives an error.

func (Client) FindSimilar

func (client Client) FindSimilar(ctx context.Context, body FindSimilarRequest) (result ListSimilarFace, err error)

FindSimilar given query face's faceId, to search the similar-looking faces from a faceId array, a face list or a large face list. faceId array contains the faces created by [Face - Detect](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/detectwithurl), which will expire 24 hours after creation. A "faceListId" is created by [FaceList - Create](https://docs.microsoft.com/rest/api/cognitiveservices/face/facelist/create) containing persistedFaceIds that will not expire. And a "largeFaceListId" is created by [LargeFaceList - Create](https://docs.microsoft.com/rest/api/cognitiveservices/face/largefacelist/create) containing persistedFaceIds that will also not expire. Depending on the input the returned similar faces list contains faceIds or persistedFaceIds ranked by similarity. <br/>Find similar has two working modes, "matchPerson" and "matchFace". "matchPerson" is the default mode that it tries to find faces of the same person as possible by using internal same-person thresholds. It is useful to find a known person's other photos. Note that an empty list will be returned if no faces pass the internal thresholds. "matchFace" mode ignores same-person thresholds and returns ranked similar faces anyway, even the similarity is low. It can be used in the cases like searching celebrity-looking faces. <br/>The 'recognitionModel' associated with the query face's faceId should be the same as the 'recognitionModel' used by the target faceId array, face list or large face list. Parameters: body - request body for Find Similar.

func (Client) FindSimilarPreparer

func (client Client) FindSimilarPreparer(ctx context.Context, body FindSimilarRequest) (*http.Request, error)

FindSimilarPreparer prepares the FindSimilar request.

func (Client) FindSimilarResponder

func (client Client) FindSimilarResponder(resp *http.Response) (result ListSimilarFace, err error)

FindSimilarResponder handles the response to the FindSimilar request. The method always closes the http.Response Body.

func (Client) FindSimilarSender

func (client Client) FindSimilarSender(req *http.Request) (*http.Response, error)

FindSimilarSender sends the FindSimilar request. The method will close the http.Response Body if it receives an error.

func (Client) Group

func (client Client) Group(ctx context.Context, body GroupRequest) (result GroupResult, err error)

Group divide candidate faces into groups based on face similarity.<br /> * The output is one or more disjointed face groups and a messyGroup. A face group contains faces that have similar looking, often of the same person. Face groups are ranked by group size, i.e. number of faces. Notice that faces belonging to a same person might be split into several groups in the result. * MessyGroup is a special face group containing faces that cannot find any similar counterpart face from original faces. The messyGroup will not appear in the result if all faces found their counterparts. * Group API needs at least 2 candidate faces and 1000 at most. We suggest to try [Face - Verify](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/verifyfacetoface) when you only have 2 candidate faces. * The 'recognitionModel' associated with the query faces' faceIds should be the same. Parameters: body - request body for grouping.

func (Client) GroupPreparer

func (client Client) GroupPreparer(ctx context.Context, body GroupRequest) (*http.Request, error)

GroupPreparer prepares the Group request.

func (Client) GroupResponder

func (client Client) GroupResponder(resp *http.Response) (result GroupResult, err error)

GroupResponder handles the response to the Group request. The method always closes the http.Response Body.

func (Client) GroupSender

func (client Client) GroupSender(req *http.Request) (*http.Response, error)

GroupSender sends the Group request. The method will close the http.Response Body if it receives an error.

func (Client) Identify

func (client Client) Identify(ctx context.Context, body IdentifyRequest) (result ListIdentifyResult, err error)

Identify 1-to-many identification to find the closest matches of the specific query person face from a person group or large person group. <br/> For each face in the faceIds array, Face Identify will compute similarities between the query face and all the faces in the person group (given by personGroupId) or large person group (given by largePersonGroupId), and return candidate person(s) for that face ranked by similarity confidence. The person group/large person group should be trained to make it ready for identification. See more in [PersonGroup - Train](https://docs.microsoft.com/rest/api/cognitiveservices/face/persongroup/train) and [LargePersonGroup - Train](https://docs.microsoft.com/rest/api/cognitiveservices/face/largepersongroup/train). <br/>

Remarks:<br /> * The algorithm allows more than one face to be identified independently at the same request, but no more than 10 faces. * Each person in the person group/large person group could have more than one face, but no more than 248 faces. * Higher face image quality means better identification precision. Please consider high-quality faces: frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. * Number of candidates returned is restricted by maxNumOfCandidatesReturned and confidenceThreshold. If no person is identified, the returned candidates will be an empty array. * Try [Face - Find Similar](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/findsimilar) when you need to find similar faces from a face list/large face list instead of a person group/large person group. * The 'recognitionModel' associated with the query faces' faceIds should be the same as the 'recognitionModel' used by the target person group or large person group. Parameters: body - request body for identify operation.

func (Client) IdentifyPreparer

func (client Client) IdentifyPreparer(ctx context.Context, body IdentifyRequest) (*http.Request, error)

IdentifyPreparer prepares the Identify request.

func (Client) IdentifyResponder

func (client Client) IdentifyResponder(resp *http.Response) (result ListIdentifyResult, err error)

IdentifyResponder handles the response to the Identify request. The method always closes the http.Response Body.

func (Client) IdentifySender

func (client Client) IdentifySender(req *http.Request) (*http.Response, error)

IdentifySender sends the Identify request. The method will close the http.Response Body if it receives an error.

func (Client) VerifyFaceToFace

func (client Client) VerifyFaceToFace(ctx context.Context, body VerifyFaceToFaceRequest) (result VerifyResult, err error)

VerifyFaceToFace verify whether two faces belong to a same person or whether one face belongs to a person. <br/> Remarks:<br /> * Higher face image quality means better identification precision. Please consider high-quality faces: frontal, clear, and face size is 200x200 pixels (100 pixels between eyes) or bigger. * For the scenarios that are sensitive to accuracy please make your own judgment. * The 'recognitionModel' associated with the query faces' faceIds should be the same as the 'recognitionModel' used by the target face, person group or large person group. Parameters: body - request body for face to face verification.

func (Client) VerifyFaceToFacePreparer

func (client Client) VerifyFaceToFacePreparer(ctx context.Context, body VerifyFaceToFaceRequest) (*http.Request, error)

VerifyFaceToFacePreparer prepares the VerifyFaceToFace request.

func (Client) VerifyFaceToFaceResponder

func (client Client) VerifyFaceToFaceResponder(resp *http.Response) (result VerifyResult, err error)

VerifyFaceToFaceResponder handles the response to the VerifyFaceToFace request. The method always closes the http.Response Body.

func (Client) VerifyFaceToFaceSender

func (client Client) VerifyFaceToFaceSender(req *http.Request) (*http.Response, error)

VerifyFaceToFaceSender sends the VerifyFaceToFace request. The method will close the http.Response Body if it receives an error.

func (Client) VerifyFaceToPerson

func (client Client) VerifyFaceToPerson(ctx context.Context, body VerifyFaceToPersonRequest) (result VerifyResult, err error)

VerifyFaceToPerson verify whether two faces belong to a same person. Compares a face Id with a Person Id Parameters: body - request body for face to person verification.

func (Client) VerifyFaceToPersonPreparer

func (client Client) VerifyFaceToPersonPreparer(ctx context.Context, body VerifyFaceToPersonRequest) (*http.Request, error)

VerifyFaceToPersonPreparer prepares the VerifyFaceToPerson request.

func (Client) VerifyFaceToPersonResponder

func (client Client) VerifyFaceToPersonResponder(resp *http.Response) (result VerifyResult, err error)

VerifyFaceToPersonResponder handles the response to the VerifyFaceToPerson request. The method always closes the http.Response Body.

func (Client) VerifyFaceToPersonSender

func (client Client) VerifyFaceToPersonSender(req *http.Request) (*http.Response, error)

VerifyFaceToPersonSender sends the VerifyFaceToPerson request. The method will close the http.Response Body if it receives an error.

type Coordinate

type Coordinate struct {
	// X - The horizontal component, in pixels.
	X *float64 `json:"x,omitempty"`
	// Y - The vertical component, in pixels.
	Y *float64 `json:"y,omitempty"`
}

Coordinate coordinates within an image

type DetectedFace

type DetectedFace struct {
	FaceID *uuid.UUID `json:"faceId,omitempty"`
	// RecognitionModel - Possible values include: 'Recognition01', 'Recognition02', 'Recognition03'
	RecognitionModel RecognitionModel `json:"recognitionModel,omitempty"`
	FaceRectangle    *Rectangle       `json:"faceRectangle,omitempty"`
	FaceLandmarks    *Landmarks       `json:"faceLandmarks,omitempty"`
	FaceAttributes   *Attributes      `json:"faceAttributes,omitempty"`
}

DetectedFace detected Face object.

type DetectionModel

type DetectionModel string

DetectionModel enumerates the values for detection model.

const (
	// Detection01 ...
	Detection01 DetectionModel = "detection_01"
	// Detection02 ...
	Detection02 DetectionModel = "detection_02"
)

func PossibleDetectionModelValues

func PossibleDetectionModelValues() []DetectionModel

PossibleDetectionModelValues returns an array of possible values for the DetectionModel const type.

type Emotion

type Emotion struct {
	Anger     *float64 `json:"anger,omitempty"`
	Contempt  *float64 `json:"contempt,omitempty"`
	Disgust   *float64 `json:"disgust,omitempty"`
	Fear      *float64 `json:"fear,omitempty"`
	Happiness *float64 `json:"happiness,omitempty"`
	Neutral   *float64 `json:"neutral,omitempty"`
	Sadness   *float64 `json:"sadness,omitempty"`
	Surprise  *float64 `json:"surprise,omitempty"`
}

Emotion properties describing facial emotion in form of confidence ranging from 0 to 1.

type Error

type Error struct {
	Code    *string `json:"code,omitempty"`
	Message *string `json:"message,omitempty"`
}

Error error body.

type Exposure

type Exposure struct {
	// ExposureLevel - An enum value indicating level of exposure. Possible values include: 'UnderExposure', 'GoodExposure', 'OverExposure'
	ExposureLevel ExposureLevel `json:"exposureLevel,omitempty"`
	// Value - A number indicating level of exposure level ranging from 0 to 1. [0, 0.25) is under exposure. [0.25, 0.75) is good exposure. [0.75, 1] is over exposure.
	Value *float64 `json:"value,omitempty"`
}

Exposure properties describing exposure level of the image.

type ExposureLevel

type ExposureLevel string

ExposureLevel enumerates the values for exposure level.

const (
	// GoodExposure ...
	GoodExposure ExposureLevel = "GoodExposure"
	// OverExposure ...
	OverExposure ExposureLevel = "OverExposure"
	// UnderExposure ...
	UnderExposure ExposureLevel = "UnderExposure"
)

func PossibleExposureLevelValues

func PossibleExposureLevelValues() []ExposureLevel

PossibleExposureLevelValues returns an array of possible values for the ExposureLevel const type.

type FacialHair

type FacialHair struct {
	Moustache *float64 `json:"moustache,omitempty"`
	Beard     *float64 `json:"beard,omitempty"`
	Sideburns *float64 `json:"sideburns,omitempty"`
}

FacialHair properties describing facial hair attributes.

type FindSimilarMatchMode

type FindSimilarMatchMode string

FindSimilarMatchMode enumerates the values for find similar match mode.

const (
	// MatchFace ...
	MatchFace FindSimilarMatchMode = "matchFace"
	// MatchPerson ...
	MatchPerson FindSimilarMatchMode = "matchPerson"
)

func PossibleFindSimilarMatchModeValues

func PossibleFindSimilarMatchModeValues() []FindSimilarMatchMode

PossibleFindSimilarMatchModeValues returns an array of possible values for the FindSimilarMatchMode const type.

type FindSimilarRequest

type FindSimilarRequest struct {
	// FaceID - FaceId of the query face. User needs to call Face - Detect first to get a valid faceId. Note that this faceId is not persisted and will expire 24 hours after the detection call
	FaceID *uuid.UUID `json:"faceId,omitempty"`
	// FaceListID - An existing user-specified unique candidate face list, created in Face List - Create a Face List. Face list contains a set of persistedFaceIds which are persisted and will never expire. Parameter faceListId, largeFaceListId and faceIds should not be provided at the same time.
	FaceListID *string `json:"faceListId,omitempty"`
	// LargeFaceListID - An existing user-specified unique candidate large face list, created in LargeFaceList - Create. Large face list contains a set of persistedFaceIds which are persisted and will never expire. Parameter faceListId, largeFaceListId and faceIds should not be provided at the same time.
	LargeFaceListID *string `json:"largeFaceListId,omitempty"`
	// FaceIds - An array of candidate faceIds. All of them are created by Face - Detect and the faceIds will expire 24 hours after the detection call. The number of faceIds is limited to 1000. Parameter faceListId, largeFaceListId and faceIds should not be provided at the same time.
	FaceIds *[]uuid.UUID `json:"faceIds,omitempty"`
	// MaxNumOfCandidatesReturned - The number of top similar faces returned. The valid range is [1, 1000].
	MaxNumOfCandidatesReturned *int32 `json:"maxNumOfCandidatesReturned,omitempty"`
	// Mode - Similar face searching mode. It can be "matchPerson" or "matchFace". Possible values include: 'MatchPerson', 'MatchFace'
	Mode FindSimilarMatchMode `json:"mode,omitempty"`
}

FindSimilarRequest request body for find similar operation.

type Gender

type Gender string

Gender enumerates the values for gender.

const (
	// Female ...
	Female Gender = "female"
	// Male ...
	Male Gender = "male"
)

func PossibleGenderValues

func PossibleGenderValues() []Gender

PossibleGenderValues returns an array of possible values for the Gender const type.

type GlassesType

type GlassesType string

GlassesType enumerates the values for glasses type.

const (
	// NoGlasses ...
	NoGlasses GlassesType = "noGlasses"
	// ReadingGlasses ...
	ReadingGlasses GlassesType = "readingGlasses"
	// Sunglasses ...
	Sunglasses GlassesType = "sunglasses"
	// SwimmingGoggles ...
	SwimmingGoggles GlassesType = "swimmingGoggles"
)

func PossibleGlassesTypeValues

func PossibleGlassesTypeValues() []GlassesType

PossibleGlassesTypeValues returns an array of possible values for the GlassesType const type.

type GroupRequest

type GroupRequest struct {
	// FaceIds - Array of candidate faceId created by Face - Detect. The maximum is 1000 faces
	FaceIds *[]uuid.UUID `json:"faceIds,omitempty"`
}

GroupRequest request body for group request.

type GroupResult

type GroupResult struct {
	autorest.Response `json:"-"`
	// Groups - A partition of the original faces based on face similarity. Groups are ranked by number of faces
	Groups *[][]uuid.UUID `json:"groups,omitempty"`
	// MessyGroup - Face ids array of faces that cannot find any similar faces from original faces.
	MessyGroup *[]uuid.UUID `json:"messyGroup,omitempty"`
}

GroupResult an array of face groups based on face similarity.

type Hair

type Hair struct {
	// Bald - A number describing confidence level of whether the person is bald.
	Bald *float64 `json:"bald,omitempty"`
	// Invisible - A boolean value describing whether the hair is visible in the image.
	Invisible *bool `json:"invisible,omitempty"`
	// HairColor - An array of candidate colors and confidence level in the presence of each.
	HairColor *[]HairColor `json:"hairColor,omitempty"`
}

Hair properties describing hair attributes.

type HairColor

type HairColor struct {
	// Color - Name of the hair color. Possible values include: 'Unknown', 'White', 'Gray', 'Blond', 'Brown', 'Red', 'Black', 'Other'
	Color HairColorType `json:"color,omitempty"`
	// Confidence - Confidence level of the color
	Confidence *float64 `json:"confidence,omitempty"`
}

HairColor hair color and associated confidence

type HairColorType

type HairColorType string

HairColorType enumerates the values for hair color type.

const (
	// Black ...
	Black HairColorType = "black"
	// Blond ...
	Blond HairColorType = "blond"
	// Brown ...
	Brown HairColorType = "brown"
	// Gray ...
	Gray HairColorType = "gray"
	// Other ...
	Other HairColorType = "other"
	// Red ...
	Red HairColorType = "red"
	// Unknown ...
	Unknown HairColorType = "unknown"
	// White ...
	White HairColorType = "white"
)

func PossibleHairColorTypeValues

func PossibleHairColorTypeValues() []HairColorType

PossibleHairColorTypeValues returns an array of possible values for the HairColorType const type.

type HeadPose

type HeadPose struct {
	Roll  *float64 `json:"roll,omitempty"`
	Yaw   *float64 `json:"yaw,omitempty"`
	Pitch *float64 `json:"pitch,omitempty"`
}

HeadPose properties indicating head pose of the face.

type IdentifyCandidate

type IdentifyCandidate struct {
	// PersonID - Id of candidate
	PersonID *uuid.UUID `json:"personId,omitempty"`
	// Confidence - Confidence threshold of identification, used to judge whether one face belong to one person. The range of confidenceThreshold is [0, 1] (default specified by algorithm).
	Confidence *float64 `json:"confidence,omitempty"`
}

IdentifyCandidate all possible faces that may qualify.

type IdentifyRequest

type IdentifyRequest struct {
	// FaceIds - Array of query faces faceIds, created by the Face - Detect. Each of the faces are identified independently. The valid number of faceIds is between [1, 10].
	FaceIds *[]uuid.UUID `json:"faceIds,omitempty"`
	// PersonGroupID - PersonGroupId of the target person group, created by PersonGroup - Create. Parameter personGroupId and largePersonGroupId should not be provided at the same time.
	PersonGroupID *string `json:"personGroupId,omitempty"`
	// LargePersonGroupID - LargePersonGroupId of the target large person group, created by LargePersonGroup - Create. Parameter personGroupId and largePersonGroupId should not be provided at the same time.
	LargePersonGroupID *string `json:"largePersonGroupId,omitempty"`
	// MaxNumOfCandidatesReturned - The range of maxNumOfCandidatesReturned is between 1 and 5 (default is 1).
	MaxNumOfCandidatesReturned *int32 `json:"maxNumOfCandidatesReturned,omitempty"`
	// ConfidenceThreshold - Confidence threshold of identification, used to judge whether one face belong to one person. The range of confidenceThreshold is [0, 1] (default specified by algorithm).
	ConfidenceThreshold *float64 `json:"confidenceThreshold,omitempty"`
}

IdentifyRequest request body for identify face operation.

type IdentifyResult

type IdentifyResult struct {
	// FaceID - FaceId of the query face
	FaceID *uuid.UUID `json:"faceId,omitempty"`
	// Candidates - Identified person candidates for that face (ranked by confidence). Array size should be no larger than input maxNumOfCandidatesReturned. If no person is identified, will return an empty array.
	Candidates *[]IdentifyCandidate `json:"candidates,omitempty"`
}

IdentifyResult response body for identify face operation.

type ImageURL

type ImageURL struct {
	// URL - Publicly reachable URL of an image
	URL *string `json:"url,omitempty"`
}

ImageURL ...

type Landmarks

type Landmarks struct {
	PupilLeft           *Coordinate `json:"pupilLeft,omitempty"`
	PupilRight          *Coordinate `json:"pupilRight,omitempty"`
	NoseTip             *Coordinate `json:"noseTip,omitempty"`
	MouthLeft           *Coordinate `json:"mouthLeft,omitempty"`
	MouthRight          *Coordinate `json:"mouthRight,omitempty"`
	EyebrowLeftOuter    *Coordinate `json:"eyebrowLeftOuter,omitempty"`
	EyebrowLeftInner    *Coordinate `json:"eyebrowLeftInner,omitempty"`
	EyeLeftOuter        *Coordinate `json:"eyeLeftOuter,omitempty"`
	EyeLeftTop          *Coordinate `json:"eyeLeftTop,omitempty"`
	EyeLeftBottom       *Coordinate `json:"eyeLeftBottom,omitempty"`
	EyeLeftInner        *Coordinate `json:"eyeLeftInner,omitempty"`
	EyebrowRightInner   *Coordinate `json:"eyebrowRightInner,omitempty"`
	EyebrowRightOuter   *Coordinate `json:"eyebrowRightOuter,omitempty"`
	EyeRightInner       *Coordinate `json:"eyeRightInner,omitempty"`
	EyeRightTop         *Coordinate `json:"eyeRightTop,omitempty"`
	EyeRightBottom      *Coordinate `json:"eyeRightBottom,omitempty"`
	EyeRightOuter       *Coordinate `json:"eyeRightOuter,omitempty"`
	NoseRootLeft        *Coordinate `json:"noseRootLeft,omitempty"`
	NoseRootRight       *Coordinate `json:"noseRootRight,omitempty"`
	NoseLeftAlarTop     *Coordinate `json:"noseLeftAlarTop,omitempty"`
	NoseRightAlarTop    *Coordinate `json:"noseRightAlarTop,omitempty"`
	NoseLeftAlarOutTip  *Coordinate `json:"noseLeftAlarOutTip,omitempty"`
	NoseRightAlarOutTip *Coordinate `json:"noseRightAlarOutTip,omitempty"`
	UpperLipTop         *Coordinate `json:"upperLipTop,omitempty"`
	UpperLipBottom      *Coordinate `json:"upperLipBottom,omitempty"`
	UnderLipTop         *Coordinate `json:"underLipTop,omitempty"`
	UnderLipBottom      *Coordinate `json:"underLipBottom,omitempty"`
}

Landmarks a collection of 27-point face landmarks pointing to the important positions of face components.

type LargeFaceList

type LargeFaceList struct {
	autorest.Response `json:"-"`
	// LargeFaceListID - LargeFaceListId of the target large face list.
	LargeFaceListID *string `json:"largeFaceListId,omitempty"`
	// RecognitionModel - Possible values include: 'Recognition01', 'Recognition02', 'Recognition03'
	RecognitionModel RecognitionModel `json:"recognitionModel,omitempty"`
	// Name - User defined name, maximum length is 128.
	Name *string `json:"name,omitempty"`
	// UserData - User specified data. Length should not exceed 16KB.
	UserData *string `json:"userData,omitempty"`
}

LargeFaceList large face list object.

type LargeFaceListClient

type LargeFaceListClient struct {
	BaseClient
}

LargeFaceListClient is the an API for face detection, verification, and identification.

func NewLargeFaceListClient

func NewLargeFaceListClient(endpoint string) LargeFaceListClient

NewLargeFaceListClient creates an instance of the LargeFaceListClient client.

func (LargeFaceListClient) AddFaceFromStream

func (client LargeFaceListClient) AddFaceFromStream(ctx context.Context, largeFaceListID string, imageParameter io.ReadCloser, userData string, targetFace []int32, detectionModel DetectionModel) (result PersistedFace, err error)

AddFaceFromStream add a face to a specified large face list, up to 1,000,000 faces. <br /> 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/cognitiveservices/face/largefacelist/deleteface) or [LargeFaceList - Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/largefacelist/delete) is called. <br /> Note persistedFaceId is different from faceId generated by [Face - Detect](https://docs.microsoft.com/rest/api/cognitiveservices/face/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/cognitiveservices/face/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) | Model | Recommended use-case(s) | | ---------- | -------- | | 'detection_01': | The default detection model for [LargeFaceList - Add Face](https://docs.microsoft.com/rest/api/cognitiveservices/face/largefacelist/addfacefromurl). Recommend for near frontal face detection. For scenarios with exceptionally large angle (head-pose) faces, occluded faces or wrong image orientation, the faces in such cases may not be detected. | | 'detection_02': | Detection model released in 2019 May with improved accuracy especially on small, side and blurry faces. |

Quota: * Free-tier subscription quota: 1,000 faces per large face list. * S0-tier subscription quota: 1,000,000 faces per large face list. Parameters: largeFaceListID - id referencing a particular large face list. imageParameter - an image stream. userData - user-specified data about the face for any purpose. The maximum length is 1KB. targetFace - 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. detectionModel - 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.

func (LargeFaceListClient) AddFaceFromStreamPreparer

func (client LargeFaceListClient) AddFaceFromStreamPreparer(ctx context.Context, largeFaceListID string, imageParameter io.ReadCloser, userData string, targetFace []int32, detectionModel DetectionModel) (*http.Request, error)

AddFaceFromStreamPreparer prepares the AddFaceFromStream request.

func (LargeFaceListClient) AddFaceFromStreamResponder

func (client LargeFaceListClient) AddFaceFromStreamResponder(resp *http.Response) (result PersistedFace, err error)

AddFaceFromStreamResponder handles the response to the AddFaceFromStream request. The method always closes the http.Response Body.

func (LargeFaceListClient) AddFaceFromStreamSender

func (client LargeFaceListClient) AddFaceFromStreamSender(req *http.Request) (*http.Response, error)

AddFaceFromStreamSender sends the AddFaceFromStream request. The method will close the http.Response Body if it receives an error.

func (LargeFaceListClient) AddFaceFromURL

func (client LargeFaceListClient) AddFaceFromURL(ctx context.Context, largeFaceListID string, imageURL ImageURL, userData string, targetFace []int32, detectionModel DetectionModel) (result PersistedFace, err error)

AddFaceFromURL add a face to a specified large face list, up to 1,000,000 faces. <br /> 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/cognitiveservices/face/largefacelist/deleteface) or [LargeFaceList - Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/largefacelist/delete) is called. <br /> Note persistedFaceId is different from faceId generated by [Face - Detect](https://docs.microsoft.com/rest/api/cognitiveservices/face/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/cognitiveservices/face/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) | Model | Recommended use-case(s) | | ---------- | -------- | | 'detection_01': | The default detection model for [LargeFaceList - Add Face](https://docs.microsoft.com/rest/api/cognitiveservices/face/largefacelist/addfacefromurl). Recommend for near frontal face detection. For scenarios with exceptionally large angle (head-pose) faces, occluded faces or wrong image orientation, the faces in such cases may not be detected. | | 'detection_02': | Detection model released in 2019 May with improved accuracy especially on small, side and blurry faces. |

Quota: * Free-tier subscription quota: 1,000 faces per large face list. * S0-tier subscription quota: 1,000,000 faces per large face list. Parameters: largeFaceListID - id referencing a particular large face list. imageURL - a JSON document with a URL pointing to the image that is to be analyzed. userData - user-specified data about the face for any purpose. The maximum length is 1KB. targetFace - 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. detectionModel - 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.

func (LargeFaceListClient) AddFaceFromURLPreparer

func (client LargeFaceListClient) AddFaceFromURLPreparer(ctx context.Context, largeFaceListID string, imageURL ImageURL, userData string, targetFace []int32, detectionModel DetectionModel) (*http.Request, error)

AddFaceFromURLPreparer prepares the AddFaceFromURL request.

func (LargeFaceListClient) AddFaceFromURLResponder

func (client LargeFaceListClient) AddFaceFromURLResponder(resp *http.Response) (result PersistedFace, err error)

AddFaceFromURLResponder handles the response to the AddFaceFromURL request. The method always closes the http.Response Body.

func (LargeFaceListClient) AddFaceFromURLSender

func (client LargeFaceListClient) AddFaceFromURLSender(req *http.Request) (*http.Response, error)

AddFaceFromURLSender sends the AddFaceFromURL request. The method will close the http.Response Body if it receives an error.

func (LargeFaceListClient) Create

func (client LargeFaceListClient) Create(ctx context.Context, largeFaceListID string, body MetaDataContract) (result autorest.Response, err error)

Create create an empty large face list with user-specified largeFaceListId, name, an optional userData and recognitionModel. <br /> 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/cognitiveservices/face/face/findsimilar). <br /> After creation, user should use [LargeFaceList Face - Add](https://docs.microsoft.com/rest/api/cognitiveservices/face/largefacelist/addfacefromurl) to import the faces and [LargeFaceList - Train](https://docs.microsoft.com/rest/api/cognitiveservices/face/largefacelist/train) to make it ready for [Face - Find Similar](https://docs.microsoft.com/rest/api/cognitiveservices/face/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/cognitiveservices/face/largefacelist/delete) is called. <br /> 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/cognitiveservices/face/persongroup) / LargePersonGroup(https://docs.microsoft.com/rest/api/cognitiveservices/face/largepersongroup) and [Face - Identify](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/identify). <br/>'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. * 'recognition_01': The default recognition model for [LargeFaceList- Create](https://docs.microsoft.com/rest/api/cognitiveservices/face/largefacelist/create). All those large face lists created before 2019 March are bonded with this recognition model. * 'recognition_02': Recognition model released in 2019 March. * 'recognition_03': Recognition model released in 2020 May. 'recognition_03' is recommended since its overall accuracy is improved compared with 'recognition_01' and 'recognition_02'.

Large face list quota: * Free-tier subscription quota: 64 large face lists. * S0-tier subscription quota: 1,000,000 large face lists. Parameters: largeFaceListID - id referencing a particular large face list. body - request body for creating a large face list.

func (LargeFaceListClient) CreatePreparer

func (client LargeFaceListClient) CreatePreparer(ctx context.Context, largeFaceListID string, body MetaDataContract) (*http.Request, error)

CreatePreparer prepares the Create request.

func (LargeFaceListClient) CreateResponder

func (client LargeFaceListClient) CreateResponder(resp *http.Response) (result autorest.Response, err error)

CreateResponder handles the response to the Create request. The method always closes the http.Response Body.

func (LargeFaceListClient) CreateSender

func (client LargeFaceListClient) CreateSender(req *http.Request) (*http.Response, error)

CreateSender sends the Create request. The method will close the http.Response Body if it receives an error.

func (LargeFaceListClient) Delete

func (client LargeFaceListClient) Delete(ctx context.Context, largeFaceListID string) (result autorest.Response, err error)

Delete delete a specified large face list. Parameters: largeFaceListID - id referencing a particular large face list.

func (LargeFaceListClient) DeleteFace

func (client LargeFaceListClient) DeleteFace(ctx context.Context, largeFaceListID string, persistedFaceID uuid.UUID) (result autorest.Response, err error)

DeleteFace delete a face from a large face list by specified largeFaceListId and persistedFaceId. <br /> Adding/deleting faces to/from a same large face list are processed sequentially and to/from different large face lists are in parallel. Parameters: largeFaceListID - id referencing a particular large face list. persistedFaceID - id referencing a particular persistedFaceId of an existing face.

func (LargeFaceListClient) DeleteFacePreparer

func (client LargeFaceListClient) DeleteFacePreparer(ctx context.Context, largeFaceListID string, persistedFaceID uuid.UUID) (*http.Request, error)

DeleteFacePreparer prepares the DeleteFace request.

func (LargeFaceListClient) DeleteFaceResponder

func (client LargeFaceListClient) DeleteFaceResponder(resp *http.Response) (result autorest.Response, err error)

DeleteFaceResponder handles the response to the DeleteFace request. The method always closes the http.Response Body.

func (LargeFaceListClient) DeleteFaceSender

func (client LargeFaceListClient) DeleteFaceSender(req *http.Request) (*http.Response, error)

DeleteFaceSender sends the DeleteFace request. The method will close the http.Response Body if it receives an error.

func (LargeFaceListClient) DeletePreparer

func (client LargeFaceListClient) DeletePreparer(ctx context.Context, largeFaceListID string) (*http.Request, error)

DeletePreparer prepares the Delete request.

func (LargeFaceListClient) DeleteResponder

func (client LargeFaceListClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error)

DeleteResponder handles the response to the Delete request. The method always closes the http.Response Body.

func (LargeFaceListClient) DeleteSender

func (client LargeFaceListClient) DeleteSender(req *http.Request) (*http.Response, error)

DeleteSender sends the Delete request. The method will close the http.Response Body if it receives an error.

func (LargeFaceListClient) Get

func (client LargeFaceListClient) Get(ctx context.Context, largeFaceListID string, returnRecognitionModel *bool) (result LargeFaceList, err error)

Get retrieve a large face list’s largeFaceListId, name, userData and recognitionModel. Parameters: largeFaceListID - id referencing a particular large face list. returnRecognitionModel - a value indicating whether the operation should return 'recognitionModel' in response.

func (LargeFaceListClient) GetFace

func (client LargeFaceListClient) GetFace(ctx context.Context, largeFaceListID string, persistedFaceID uuid.UUID) (result PersistedFace, err error)

GetFace retrieve information about a persisted face (specified by persistedFaceId and its belonging largeFaceListId). Parameters: largeFaceListID - id referencing a particular large face list. persistedFaceID - id referencing a particular persistedFaceId of an existing face.

func (LargeFaceListClient) GetFacePreparer

func (client LargeFaceListClient) GetFacePreparer(ctx context.Context, largeFaceListID string, persistedFaceID uuid.UUID) (*http.Request, error)

GetFacePreparer prepares the GetFace request.

func (LargeFaceListClient) GetFaceResponder

func (client LargeFaceListClient) GetFaceResponder(resp *http.Response) (result PersistedFace, err error)

GetFaceResponder handles the response to the GetFace request. The method always closes the http.Response Body.

func (LargeFaceListClient) GetFaceSender

func (client LargeFaceListClient) GetFaceSender(req *http.Request) (*http.Response, error)

GetFaceSender sends the GetFace request. The method will close the http.Response Body if it receives an error.

func (LargeFaceListClient) GetPreparer

func (client LargeFaceListClient) GetPreparer(ctx context.Context, largeFaceListID string, returnRecognitionModel *bool) (*http.Request, error)

GetPreparer prepares the Get request.

func (LargeFaceListClient) GetResponder

func (client LargeFaceListClient) GetResponder(resp *http.Response) (result LargeFaceList, err error)

GetResponder handles the response to the Get request. The method always closes the http.Response Body.

func (LargeFaceListClient) GetSender

func (client LargeFaceListClient) GetSender(req *http.Request) (*http.Response, error)

GetSender sends the Get request. The method will close the http.Response Body if it receives an error.

func (LargeFaceListClient) GetTrainingStatus

func (client LargeFaceListClient) GetTrainingStatus(ctx context.Context, largeFaceListID string) (result TrainingStatus, err error)

GetTrainingStatus retrieve the training status of a large face list (completed or ongoing). Parameters: largeFaceListID - id referencing a particular large face list.

func (LargeFaceListClient) GetTrainingStatusPreparer

func (client LargeFaceListClient) GetTrainingStatusPreparer(ctx context.Context, largeFaceListID string) (*http.Request, error)

GetTrainingStatusPreparer prepares the GetTrainingStatus request.

func (LargeFaceListClient) GetTrainingStatusResponder

func (client LargeFaceListClient) GetTrainingStatusResponder(resp *http.Response) (result TrainingStatus, err error)

GetTrainingStatusResponder handles the response to the GetTrainingStatus request. The method always closes the http.Response Body.

func (LargeFaceListClient) GetTrainingStatusSender

func (client LargeFaceListClient) GetTrainingStatusSender(req *http.Request) (*http.Response, error)

GetTrainingStatusSender sends the GetTrainingStatus request. The method will close the http.Response Body if it receives an error.

func (LargeFaceListClient) List

func (client LargeFaceListClient) List(ctx context.Context, returnRecognitionModel *bool) (result ListLargeFaceList, err error)

List list large face lists’ information of largeFaceListId, name, userData and recognitionModel. <br /> To get face information inside largeFaceList use [LargeFaceList Face - Get](https://docs.microsoft.com/rest/api/cognitiveservices/face/largefacelist/getface)<br /> * 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. <br /> For example, total 5 large person lists: "list1", ..., "list5". <br /> "start=&top=" will return all 5 lists. <br /> "start=&top=2" will return "list1", "list2". <br /> "start=list2&top=3" will return "list3", "list4", "list5". Parameters: returnRecognitionModel - a value indicating whether the operation should return 'recognitionModel' in response.

func (LargeFaceListClient) ListFaces

func (client LargeFaceListClient) ListFaces(ctx context.Context, largeFaceListID string, start string, top *int32) (result ListPersistedFace, err error)

ListFaces list all faces in a large face list, and retrieve face information (including userData and persistedFaceIds of registered faces of the face). Parameters: largeFaceListID - id referencing a particular large face list. start - starting face id to return (used to list a range of faces). top - number of faces to return starting with the face id indicated by the 'start' parameter.

func (LargeFaceListClient) ListFacesPreparer

func (client LargeFaceListClient) ListFacesPreparer(ctx context.Context, largeFaceListID string, start string, top *int32) (*http.Request, error)

ListFacesPreparer prepares the ListFaces request.

func (LargeFaceListClient) ListFacesResponder

func (client LargeFaceListClient) ListFacesResponder(resp *http.Response) (result ListPersistedFace, err error)

ListFacesResponder handles the response to the ListFaces request. The method always closes the http.Response Body.

func (LargeFaceListClient) ListFacesSender

func (client LargeFaceListClient) ListFacesSender(req *http.Request) (*http.Response, error)

ListFacesSender sends the ListFaces request. The method will close the http.Response Body if it receives an error.

func (LargeFaceListClient) ListPreparer

func (client LargeFaceListClient) ListPreparer(ctx context.Context, returnRecognitionModel *bool) (*http.Request, error)

ListPreparer prepares the List request.

func (LargeFaceListClient) ListResponder

func (client LargeFaceListClient) ListResponder(resp *http.Response) (result ListLargeFaceList, err error)

ListResponder handles the response to the List request. The method always closes the http.Response Body.

func (LargeFaceListClient) ListSender

func (client LargeFaceListClient) ListSender(req *http.Request) (*http.Response, error)

ListSender sends the List request. The method will close the http.Response Body if it receives an error.

func (LargeFaceListClient) Train

func (client LargeFaceListClient) Train(ctx context.Context, largeFaceListID string) (result autorest.Response, err error)

Train queue a large face list training task, the training task may not be started immediately. Parameters: largeFaceListID - id referencing a particular large face list.

func (LargeFaceListClient) TrainPreparer

func (client LargeFaceListClient) TrainPreparer(ctx context.Context, largeFaceListID string) (*http.Request, error)

TrainPreparer prepares the Train request.

func (LargeFaceListClient) TrainResponder

func (client LargeFaceListClient) TrainResponder(resp *http.Response) (result autorest.Response, err error)

TrainResponder handles the response to the Train request. The method always closes the http.Response Body.

func (LargeFaceListClient) TrainSender

func (client LargeFaceListClient) TrainSender(req *http.Request) (*http.Response, error)

TrainSender sends the Train request. The method will close the http.Response Body if it receives an error.

func (LargeFaceListClient) Update

func (client LargeFaceListClient) Update(ctx context.Context, largeFaceListID string, body NameAndUserDataContract) (result autorest.Response, err error)

Update update information of a large face list. Parameters: largeFaceListID - id referencing a particular large face list. body - request body for updating a large face list.

func (LargeFaceListClient) UpdateFace

func (client LargeFaceListClient) UpdateFace(ctx context.Context, largeFaceListID string, persistedFaceID uuid.UUID, body UpdateFaceRequest) (result autorest.Response, err error)

UpdateFace update a persisted face's userData field. Parameters: largeFaceListID - id referencing a particular large face list. persistedFaceID - id referencing a particular persistedFaceId of an existing face. body - request body for updating persisted face.

func (LargeFaceListClient) UpdateFacePreparer

func (client LargeFaceListClient) UpdateFacePreparer(ctx context.Context, largeFaceListID string, persistedFaceID uuid.UUID, body UpdateFaceRequest) (*http.Request, error)

UpdateFacePreparer prepares the UpdateFace request.

func (LargeFaceListClient) UpdateFaceResponder

func (client LargeFaceListClient) UpdateFaceResponder(resp *http.Response) (result autorest.Response, err error)

UpdateFaceResponder handles the response to the UpdateFace request. The method always closes the http.Response Body.

func (LargeFaceListClient) UpdateFaceSender

func (client LargeFaceListClient) UpdateFaceSender(req *http.Request) (*http.Response, error)

UpdateFaceSender sends the UpdateFace request. The method will close the http.Response Body if it receives an error.

func (LargeFaceListClient) UpdatePreparer

func (client LargeFaceListClient) UpdatePreparer(ctx context.Context, largeFaceListID string, body NameAndUserDataContract) (*http.Request, error)

UpdatePreparer prepares the Update request.

func (LargeFaceListClient) UpdateResponder

func (client LargeFaceListClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error)

UpdateResponder handles the response to the Update request. The method always closes the http.Response Body.

func (LargeFaceListClient) UpdateSender

func (client LargeFaceListClient) UpdateSender(req *http.Request) (*http.Response, error)

UpdateSender sends the Update request. The method will close the http.Response Body if it receives an error.

type LargePersonGroup

type LargePersonGroup struct {
	autorest.Response `json:"-"`
	// LargePersonGroupID - LargePersonGroupId of the target large person groups
	LargePersonGroupID *string `json:"largePersonGroupId,omitempty"`
	// RecognitionModel - Possible values include: 'Recognition01', 'Recognition02', 'Recognition03'
	RecognitionModel RecognitionModel `json:"recognitionModel,omitempty"`
	// Name - User defined name, maximum length is 128.
	Name *string `json:"name,omitempty"`
	// UserData - User specified data. Length should not exceed 16KB.
	UserData *string `json:"userData,omitempty"`
}

LargePersonGroup large person group object.

type LargePersonGroupClient

type LargePersonGroupClient struct {
	BaseClient
}

LargePersonGroupClient is the an API for face detection, verification, and identification.

func NewLargePersonGroupClient

func NewLargePersonGroupClient(endpoint string) LargePersonGroupClient

NewLargePersonGroupClient creates an instance of the LargePersonGroupClient client.

func (LargePersonGroupClient) Create

func (client LargePersonGroupClient) Create(ctx context.Context, largePersonGroupID string, body MetaDataContract) (result autorest.Response, err error)

Create create a new large person group with user-specified largePersonGroupId, name, an optional userData and recognitionModel. <br /> A large person group is the container of the uploaded person data, including face recognition feature, and up to 1,000,000 people. <br /> After creation, use [LargePersonGroup Person - Create](https://docs.microsoft.com/rest/api/cognitiveservices/face/largepersongroupperson/create) to add person into the group, and call [LargePersonGroup - Train](https://docs.microsoft.com/rest/api/cognitiveservices/face/largepersongroup/train) to get this group ready for [Face - Identify](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/identify). <br /> 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/cognitiveservices/face/largepersongroupperson/delete) or [LargePersonGroup - Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/largepersongroup/delete) is called. <br/>'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. * 'recognition_01': The default recognition model for [LargePersonGroup - Create](https://docs.microsoft.com/rest/api/cognitiveservices/face/largepersongroup/create). All those large person groups created before 2019 March are bonded with this recognition model. * 'recognition_02': Recognition model released in 2019 March. * 'recognition_03': Recognition model released in 2020 May. 'recognition_03' is recommended since its overall accuracy is improved compared with 'recognition_01' and 'recognition_02'.

Large person group quota: * Free-tier subscription quota: 1,000 large person groups. * S0-tier subscription quota: 1,000,000 large person groups. Parameters: largePersonGroupID - id referencing a particular large person group. body - request body for creating new large person group.

func (LargePersonGroupClient) CreatePreparer

func (client LargePersonGroupClient) CreatePreparer(ctx context.Context, largePersonGroupID string, body MetaDataContract) (*http.Request, error)

CreatePreparer prepares the Create request.

func (LargePersonGroupClient) CreateResponder

func (client LargePersonGroupClient) CreateResponder(resp *http.Response) (result autorest.Response, err error)

CreateResponder handles the response to the Create request. The method always closes the http.Response Body.

func (LargePersonGroupClient) CreateSender

func (client LargePersonGroupClient) CreateSender(req *http.Request) (*http.Response, error)

CreateSender sends the Create request. The method will close the http.Response Body if it receives an error.

func (LargePersonGroupClient) Delete

func (client LargePersonGroupClient) Delete(ctx context.Context, largePersonGroupID string) (result autorest.Response, err error)

Delete delete an existing large person group. Persisted face features of all people in the large person group will also be deleted. Parameters: largePersonGroupID - id referencing a particular large person group.

func (LargePersonGroupClient) DeletePreparer

func (client LargePersonGroupClient) DeletePreparer(ctx context.Context, largePersonGroupID string) (*http.Request, error)

DeletePreparer prepares the Delete request.

func (LargePersonGroupClient) DeleteResponder

func (client LargePersonGroupClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error)

DeleteResponder handles the response to the Delete request. The method always closes the http.Response Body.

func (LargePersonGroupClient) DeleteSender

func (client LargePersonGroupClient) DeleteSender(req *http.Request) (*http.Response, error)

DeleteSender sends the Delete request. The method will close the http.Response Body if it receives an error.

func (LargePersonGroupClient) Get

func (client LargePersonGroupClient) Get(ctx context.Context, largePersonGroupID string, returnRecognitionModel *bool) (result LargePersonGroup, err error)

Get 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/cognitiveservices/face/largepersongroupperson/list) instead to retrieve person information under the large person group. Parameters: largePersonGroupID - id referencing a particular large person group. returnRecognitionModel - a value indicating whether the operation should return 'recognitionModel' in response.

func (LargePersonGroupClient) GetPreparer

func (client LargePersonGroupClient) GetPreparer(ctx context.Context, largePersonGroupID string, returnRecognitionModel *bool) (*http.Request, error)

GetPreparer prepares the Get request.

func (LargePersonGroupClient) GetResponder

func (client LargePersonGroupClient) GetResponder(resp *http.Response) (result LargePersonGroup, err error)

GetResponder handles the response to the Get request. The method always closes the http.Response Body.

func (LargePersonGroupClient) GetSender

func (client LargePersonGroupClient) GetSender(req *http.Request) (*http.Response, error)

GetSender sends the Get request. The method will close the http.Response Body if it receives an error.

func (LargePersonGroupClient) GetTrainingStatus

func (client LargePersonGroupClient) GetTrainingStatus(ctx context.Context, largePersonGroupID string) (result TrainingStatus, err error)

GetTrainingStatus retrieve the training status of a large person group (completed or ongoing). Parameters: largePersonGroupID - id referencing a particular large person group.

func (LargePersonGroupClient) GetTrainingStatusPreparer

func (client LargePersonGroupClient) GetTrainingStatusPreparer(ctx context.Context, largePersonGroupID string) (*http.Request, error)

GetTrainingStatusPreparer prepares the GetTrainingStatus request.

func (LargePersonGroupClient) GetTrainingStatusResponder

func (client LargePersonGroupClient) GetTrainingStatusResponder(resp *http.Response) (result TrainingStatus, err error)

GetTrainingStatusResponder handles the response to the GetTrainingStatus request. The method always closes the http.Response Body.

func (LargePersonGroupClient) GetTrainingStatusSender

func (client LargePersonGroupClient) GetTrainingStatusSender(req *http.Request) (*http.Response, error)

GetTrainingStatusSender sends the GetTrainingStatus request. The method will close the http.Response Body if it receives an error.

func (LargePersonGroupClient) List

func (client LargePersonGroupClient) List(ctx context.Context, start string, top *int32, returnRecognitionModel *bool) (result ListLargePersonGroup, err error)

List list all existing large person groups’ largePersonGroupId, name, userData and recognitionModel.<br /> * 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. <br /> For example, total 5 large person groups: "group1", ..., "group5". <br /> "start=&top=" will return all 5 groups. <br /> "start=&top=2" will return "group1", "group2". <br /> "start=group2&top=3" will return "group3", "group4", "group5". Parameters: start - list large person groups from the least largePersonGroupId greater than the "start". top - the number of large person groups to list. returnRecognitionModel - a value indicating whether the operation should return 'recognitionModel' in response.

func (LargePersonGroupClient) ListPreparer

func (client LargePersonGroupClient) ListPreparer(ctx context.Context, start string, top *int32, returnRecognitionModel *bool) (*http.Request, error)

ListPreparer prepares the List request.

func (LargePersonGroupClient) ListResponder

func (client LargePersonGroupClient) ListResponder(resp *http.Response) (result ListLargePersonGroup, err error)

ListResponder handles the response to the List request. The method always closes the http.Response Body.

func (LargePersonGroupClient) ListSender

func (client LargePersonGroupClient) ListSender(req *http.Request) (*http.Response, error)

ListSender sends the List request. The method will close the http.Response Body if it receives an error.

func (LargePersonGroupClient) Train

func (client LargePersonGroupClient) Train(ctx context.Context, largePersonGroupID string) (result autorest.Response, err error)

Train queue a large person group training task, the training task may not be started immediately. Parameters: largePersonGroupID - id referencing a particular large person group.

func (LargePersonGroupClient) TrainPreparer

func (client LargePersonGroupClient) TrainPreparer(ctx context.Context, largePersonGroupID string) (*http.Request, error)

TrainPreparer prepares the Train request.

func (LargePersonGroupClient) TrainResponder

func (client LargePersonGroupClient) TrainResponder(resp *http.Response) (result autorest.Response, err error)

TrainResponder handles the response to the Train request. The method always closes the http.Response Body.

func (LargePersonGroupClient) TrainSender

func (client LargePersonGroupClient) TrainSender(req *http.Request) (*http.Response, error)

TrainSender sends the Train request. The method will close the http.Response Body if it receives an error.

func (LargePersonGroupClient) Update

func (client LargePersonGroupClient) Update(ctx context.Context, largePersonGroupID string, body NameAndUserDataContract) (result autorest.Response, err error)

Update update an existing large person group's display name and userData. The properties which does not appear in request body will not be updated. Parameters: largePersonGroupID - id referencing a particular large person group. body - request body for updating large person group.

func (LargePersonGroupClient) UpdatePreparer

func (client LargePersonGroupClient) UpdatePreparer(ctx context.Context, largePersonGroupID string, body NameAndUserDataContract) (*http.Request, error)

UpdatePreparer prepares the Update request.

func (LargePersonGroupClient) UpdateResponder

func (client LargePersonGroupClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error)

UpdateResponder handles the response to the Update request. The method always closes the http.Response Body.

func (LargePersonGroupClient) UpdateSender

func (client LargePersonGroupClient) UpdateSender(req *http.Request) (*http.Response, error)

UpdateSender sends the Update request. The method will close the http.Response Body if it receives an error.

type LargePersonGroupPersonClient

type LargePersonGroupPersonClient struct {
	BaseClient
}

LargePersonGroupPersonClient is the an API for face detection, verification, and identification.

func NewLargePersonGroupPersonClient

func NewLargePersonGroupPersonClient(endpoint string) LargePersonGroupPersonClient

NewLargePersonGroupPersonClient creates an instance of the LargePersonGroupPersonClient client.

func (LargePersonGroupPersonClient) AddFaceFromStream

func (client LargePersonGroupPersonClient) AddFaceFromStream(ctx context.Context, largePersonGroupID string, personID uuid.UUID, imageParameter io.ReadCloser, userData string, targetFace []int32, detectionModel DetectionModel) (result PersistedFace, err error)

AddFaceFromStream 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/cognitiveservices/face/largepersongroupperson/deleteface), [LargePersonGroup Person - Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/largepersongroupperson/delete) or [LargePersonGroup - Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/largepersongroup/delete) is called. <br /> Note persistedFaceId is different from faceId generated by [Face - Detect](https://docs.microsoft.com/rest/api/cognitiveservices/face/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/cognitiveservices/face/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) | Model | Recommended use-case(s) | | ---------- | -------- | | 'detection_01': | The default detection model for [LargePersonGroup Person - Add Face](https://docs.microsoft.com/rest/api/cognitiveservices/face/largepersongroupperson/addfacefromurl). Recommend for near frontal face detection. For scenarios with exceptionally large angle (head-pose) faces, occluded faces or wrong image orientation, the faces in such cases may not be detected. | | 'detection_02': | Detection model released in 2019 May with improved accuracy especially on small, side and blurry faces. | Parameters: largePersonGroupID - id referencing a particular large person group. personID - id referencing a particular person. imageParameter - an image stream. userData - user-specified data about the face for any purpose. The maximum length is 1KB. targetFace - 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. detectionModel - 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.

func (LargePersonGroupPersonClient) AddFaceFromStreamPreparer

func (client LargePersonGroupPersonClient) AddFaceFromStreamPreparer(ctx context.Context, largePersonGroupID string, personID uuid.UUID, imageParameter io.ReadCloser, userData string, targetFace []int32, detectionModel DetectionModel) (*http.Request, error)

AddFaceFromStreamPreparer prepares the AddFaceFromStream request.

func (LargePersonGroupPersonClient) AddFaceFromStreamResponder

func (client LargePersonGroupPersonClient) AddFaceFromStreamResponder(resp *http.Response) (result PersistedFace, err error)

AddFaceFromStreamResponder handles the response to the AddFaceFromStream request. The method always closes the http.Response Body.

func (LargePersonGroupPersonClient) AddFaceFromStreamSender

func (client LargePersonGroupPersonClient) AddFaceFromStreamSender(req *http.Request) (*http.Response, error)

AddFaceFromStreamSender sends the AddFaceFromStream request. The method will close the http.Response Body if it receives an error.

func (LargePersonGroupPersonClient) AddFaceFromURL

func (client LargePersonGroupPersonClient) AddFaceFromURL(ctx context.Context, largePersonGroupID string, personID uuid.UUID, imageURL ImageURL, userData string, targetFace []int32, detectionModel DetectionModel) (result PersistedFace, err error)

AddFaceFromURL 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/cognitiveservices/face/largepersongroupperson/deleteface), [LargePersonGroup Person - Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/largepersongroupperson/delete) or [LargePersonGroup - Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/largepersongroup/delete) is called. <br /> Note persistedFaceId is different from faceId generated by [Face - Detect](https://docs.microsoft.com/rest/api/cognitiveservices/face/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/cognitiveservices/face/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) | Model | Recommended use-case(s) | | ---------- | -------- | | 'detection_01': | The default detection model for [LargePersonGroup Person - Add Face](https://docs.microsoft.com/rest/api/cognitiveservices/face/largepersongroupperson/addfacefromurl). Recommend for near frontal face detection. For scenarios with exceptionally large angle (head-pose) faces, occluded faces or wrong image orientation, the faces in such cases may not be detected. | | 'detection_02': | Detection model released in 2019 May with improved accuracy especially on small, side and blurry faces. | Parameters: largePersonGroupID - id referencing a particular large person group. personID - id referencing a particular person. imageURL - a JSON document with a URL pointing to the image that is to be analyzed. userData - user-specified data about the face for any purpose. The maximum length is 1KB. targetFace - 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. detectionModel - 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.

func (LargePersonGroupPersonClient) AddFaceFromURLPreparer

func (client LargePersonGroupPersonClient) AddFaceFromURLPreparer(ctx context.Context, largePersonGroupID string, personID uuid.UUID, imageURL ImageURL, userData string, targetFace []int32, detectionModel DetectionModel) (*http.Request, error)

AddFaceFromURLPreparer prepares the AddFaceFromURL request.

func (LargePersonGroupPersonClient) AddFaceFromURLResponder

func (client LargePersonGroupPersonClient) AddFaceFromURLResponder(resp *http.Response) (result PersistedFace, err error)

AddFaceFromURLResponder handles the response to the AddFaceFromURL request. The method always closes the http.Response Body.

func (LargePersonGroupPersonClient) AddFaceFromURLSender

func (client LargePersonGroupPersonClient) AddFaceFromURLSender(req *http.Request) (*http.Response, error)

AddFaceFromURLSender sends the AddFaceFromURL request. The method will close the http.Response Body if it receives an error.

func (LargePersonGroupPersonClient) Create

func (client LargePersonGroupPersonClient) Create(ctx context.Context, largePersonGroupID string, body NameAndUserDataContract) (result Person, err error)

Create create a new person in a specified large person group. Parameters: largePersonGroupID - id referencing a particular large person group. body - request body for creating new person.

func (LargePersonGroupPersonClient) CreatePreparer

func (client LargePersonGroupPersonClient) CreatePreparer(ctx context.Context, largePersonGroupID string, body NameAndUserDataContract) (*http.Request, error)

CreatePreparer prepares the Create request.

func (LargePersonGroupPersonClient) CreateResponder

func (client LargePersonGroupPersonClient) CreateResponder(resp *http.Response) (result Person, err error)

CreateResponder handles the response to the Create request. The method always closes the http.Response Body.

func (LargePersonGroupPersonClient) CreateSender

func (client LargePersonGroupPersonClient) CreateSender(req *http.Request) (*http.Response, error)

CreateSender sends the Create request. The method will close the http.Response Body if it receives an error.

func (LargePersonGroupPersonClient) Delete

func (client LargePersonGroupPersonClient) Delete(ctx context.Context, largePersonGroupID string, personID uuid.UUID) (result autorest.Response, err error)

Delete 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. Parameters: largePersonGroupID - id referencing a particular large person group. personID - id referencing a particular person.

func (LargePersonGroupPersonClient) DeleteFace

func (client LargePersonGroupPersonClient) DeleteFace(ctx context.Context, largePersonGroupID string, personID uuid.UUID, persistedFaceID uuid.UUID) (result autorest.Response, err error)

DeleteFace delete a face from a person in a large person group by specified largePersonGroupId, personId and persistedFaceId. <br /> Adding/deleting faces to/from a same person will be processed sequentially. Adding/deleting faces to/from different persons are processed in parallel. Parameters: largePersonGroupID - id referencing a particular large person group. personID - id referencing a particular person. persistedFaceID - id referencing a particular persistedFaceId of an existing face.

func (LargePersonGroupPersonClient) DeleteFacePreparer

func (client LargePersonGroupPersonClient) DeleteFacePreparer(ctx context.Context, largePersonGroupID string, personID uuid.UUID, persistedFaceID uuid.UUID) (*http.Request, error)

DeleteFacePreparer prepares the DeleteFace request.

func (LargePersonGroupPersonClient) DeleteFaceResponder

func (client LargePersonGroupPersonClient) DeleteFaceResponder(resp *http.Response) (result autorest.Response, err error)

DeleteFaceResponder handles the response to the DeleteFace request. The method always closes the http.Response Body.

func (LargePersonGroupPersonClient) DeleteFaceSender

func (client LargePersonGroupPersonClient) DeleteFaceSender(req *http.Request) (*http.Response, error)

DeleteFaceSender sends the DeleteFace request. The method will close the http.Response Body if it receives an error.

func (LargePersonGroupPersonClient) DeletePreparer

func (client LargePersonGroupPersonClient) DeletePreparer(ctx context.Context, largePersonGroupID string, personID uuid.UUID) (*http.Request, error)

DeletePreparer prepares the Delete request.

func (LargePersonGroupPersonClient) DeleteResponder

func (client LargePersonGroupPersonClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error)

DeleteResponder handles the response to the Delete request. The method always closes the http.Response Body.

func (LargePersonGroupPersonClient) DeleteSender

func (client LargePersonGroupPersonClient) DeleteSender(req *http.Request) (*http.Response, error)

DeleteSender sends the Delete request. The method will close the http.Response Body if it receives an error.

func (LargePersonGroupPersonClient) Get

func (client LargePersonGroupPersonClient) Get(ctx context.Context, largePersonGroupID string, personID uuid.UUID) (result Person, err error)

Get retrieve a person's name and userData, and the persisted faceIds representing the registered person face feature. Parameters: largePersonGroupID - id referencing a particular large person group. personID - id referencing a particular person.

func (LargePersonGroupPersonClient) GetFace

func (client LargePersonGroupPersonClient) GetFace(ctx context.Context, largePersonGroupID string, personID uuid.UUID, persistedFaceID uuid.UUID) (result PersistedFace, err error)

GetFace retrieve information about a persisted face (specified by persistedFaceId, personId and its belonging largePersonGroupId). Parameters: largePersonGroupID - id referencing a particular large person group. personID - id referencing a particular person. persistedFaceID - id referencing a particular persistedFaceId of an existing face.

func (LargePersonGroupPersonClient) GetFacePreparer

func (client LargePersonGroupPersonClient) GetFacePreparer(ctx context.Context, largePersonGroupID string, personID uuid.UUID, persistedFaceID uuid.UUID) (*http.Request, error)

GetFacePreparer prepares the GetFace request.

func (LargePersonGroupPersonClient) GetFaceResponder

func (client LargePersonGroupPersonClient) GetFaceResponder(resp *http.Response) (result PersistedFace, err error)

GetFaceResponder handles the response to the GetFace request. The method always closes the http.Response Body.

func (LargePersonGroupPersonClient) GetFaceSender

func (client LargePersonGroupPersonClient) GetFaceSender(req *http.Request) (*http.Response, error)

GetFaceSender sends the GetFace request. The method will close the http.Response Body if it receives an error.

func (LargePersonGroupPersonClient) GetPreparer

func (client LargePersonGroupPersonClient) GetPreparer(ctx context.Context, largePersonGroupID string, personID uuid.UUID) (*http.Request, error)

GetPreparer prepares the Get request.

func (LargePersonGroupPersonClient) GetResponder

func (client LargePersonGroupPersonClient) GetResponder(resp *http.Response) (result Person, err error)

GetResponder handles the response to the Get request. The method always closes the http.Response Body.

func (LargePersonGroupPersonClient) GetSender

func (client LargePersonGroupPersonClient) GetSender(req *http.Request) (*http.Response, error)

GetSender sends the Get request. The method will close the http.Response Body if it receives an error.

func (LargePersonGroupPersonClient) List

func (client LargePersonGroupPersonClient) List(ctx context.Context, largePersonGroupID string, start string, top *int32) (result ListPerson, err error)

List list all persons in a large person group, and retrieve person information (including personId, name, userData and persistedFaceIds of registered faces of the person). Parameters: largePersonGroupID - id referencing a particular large person group. start - starting person id to return (used to list a range of persons). top - number of persons to return starting with the person id indicated by the 'start' parameter.

func (LargePersonGroupPersonClient) ListPreparer

func (client LargePersonGroupPersonClient) ListPreparer(ctx context.Context, largePersonGroupID string, start string, top *int32) (*http.Request, error)

ListPreparer prepares the List request.

func (LargePersonGroupPersonClient) ListResponder

func (client LargePersonGroupPersonClient) ListResponder(resp *http.Response) (result ListPerson, err error)

ListResponder handles the response to the List request. The method always closes the http.Response Body.

func (LargePersonGroupPersonClient) ListSender

func (client LargePersonGroupPersonClient) ListSender(req *http.Request) (*http.Response, error)

ListSender sends the List request. The method will close the http.Response Body if it receives an error.

func (LargePersonGroupPersonClient) Update

func (client LargePersonGroupPersonClient) Update(ctx context.Context, largePersonGroupID string, personID uuid.UUID, body NameAndUserDataContract) (result autorest.Response, err error)

Update update name or userData of a person. Parameters: largePersonGroupID - id referencing a particular large person group. personID - id referencing a particular person. body - request body for person update operation.

func (LargePersonGroupPersonClient) UpdateFace

func (client LargePersonGroupPersonClient) UpdateFace(ctx context.Context, largePersonGroupID string, personID uuid.UUID, persistedFaceID uuid.UUID, body UpdateFaceRequest) (result autorest.Response, err error)

UpdateFace update a person persisted face's userData field. Parameters: largePersonGroupID - id referencing a particular large person group. personID - id referencing a particular person. persistedFaceID - id referencing a particular persistedFaceId of an existing face. body - request body for updating persisted face.

func (LargePersonGroupPersonClient) UpdateFacePreparer

func (client LargePersonGroupPersonClient) UpdateFacePreparer(ctx context.Context, largePersonGroupID string, personID uuid.UUID, persistedFaceID uuid.UUID, body UpdateFaceRequest) (*http.Request, error)

UpdateFacePreparer prepares the UpdateFace request.

func (LargePersonGroupPersonClient) UpdateFaceResponder

func (client LargePersonGroupPersonClient) UpdateFaceResponder(resp *http.Response) (result autorest.Response, err error)

UpdateFaceResponder handles the response to the UpdateFace request. The method always closes the http.Response Body.

func (LargePersonGroupPersonClient) UpdateFaceSender

func (client LargePersonGroupPersonClient) UpdateFaceSender(req *http.Request) (*http.Response, error)

UpdateFaceSender sends the UpdateFace request. The method will close the http.Response Body if it receives an error.

func (LargePersonGroupPersonClient) UpdatePreparer

func (client LargePersonGroupPersonClient) UpdatePreparer(ctx context.Context, largePersonGroupID string, personID uuid.UUID, body NameAndUserDataContract) (*http.Request, error)

UpdatePreparer prepares the Update request.

func (LargePersonGroupPersonClient) UpdateResponder

func (client LargePersonGroupPersonClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error)

UpdateResponder handles the response to the Update request. The method always closes the http.Response Body.

func (LargePersonGroupPersonClient) UpdateSender

func (client LargePersonGroupPersonClient) UpdateSender(req *http.Request) (*http.Response, error)

UpdateSender sends the Update request. The method will close the http.Response Body if it receives an error.

type List

type List struct {
	autorest.Response `json:"-"`
	// FaceListID - FaceListId of the target face list.
	FaceListID *string `json:"faceListId,omitempty"`
	// PersistedFaces - Persisted faces within the face list.
	PersistedFaces *[]PersistedFace `json:"persistedFaces,omitempty"`
	// RecognitionModel - Possible values include: 'Recognition01', 'Recognition02', 'Recognition03'
	RecognitionModel RecognitionModel `json:"recognitionModel,omitempty"`
	// Name - User defined name, maximum length is 128.
	Name *string `json:"name,omitempty"`
	// UserData - User specified data. Length should not exceed 16KB.
	UserData *string `json:"userData,omitempty"`
}

List face list object.

type ListClient

type ListClient struct {
	BaseClient
}

ListClient is the an API for face detection, verification, and identification.

func NewListClient

func NewListClient(endpoint string) ListClient

NewListClient creates an instance of the ListClient client.

func (ListClient) AddFaceFromStream

func (client ListClient) AddFaceFromStream(ctx context.Context, faceListID string, imageParameter io.ReadCloser, userData string, targetFace []int32, detectionModel DetectionModel) (result PersistedFace, err error)

AddFaceFromStream add a face to a specified face list, up to 1,000 faces. <br /> 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 [FaceList - Delete Face](https://docs.microsoft.com/rest/api/cognitiveservices/face/facelist/deleteface) or [FaceList - Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/facelist/delete) is called. <br /> Note persistedFaceId is different from faceId generated by [Face - Detect](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/detectwithurl). * Higher face image quality means better detection and 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/cognitiveservices/face/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) | Model | Recommended use-case(s) | | ---------- | -------- | | 'detection_01': | The default detection model for [FaceList - Add Face](https://docs.microsoft.com/rest/api/cognitiveservices/face/facelist/addfacefromurl). Recommend for near frontal face detection. For scenarios with exceptionally large angle (head-pose) faces, occluded faces or wrong image orientation, the faces in such cases may not be detected. | | 'detection_02': | Detection model released in 2019 May with improved accuracy especially on small, side and blurry faces. | Parameters: faceListID - id referencing a particular face list. imageParameter - an image stream. userData - user-specified data about the face for any purpose. The maximum length is 1KB. targetFace - 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. detectionModel - 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.

func (ListClient) AddFaceFromStreamPreparer

func (client ListClient) AddFaceFromStreamPreparer(ctx context.Context, faceListID string, imageParameter io.ReadCloser, userData string, targetFace []int32, detectionModel DetectionModel) (*http.Request, error)

AddFaceFromStreamPreparer prepares the AddFaceFromStream request.

func (ListClient) AddFaceFromStreamResponder

func (client ListClient) AddFaceFromStreamResponder(resp *http.Response) (result PersistedFace, err error)

AddFaceFromStreamResponder handles the response to the AddFaceFromStream request. The method always closes the http.Response Body.

func (ListClient) AddFaceFromStreamSender

func (client ListClient) AddFaceFromStreamSender(req *http.Request) (*http.Response, error)

AddFaceFromStreamSender sends the AddFaceFromStream request. The method will close the http.Response Body if it receives an error.

func (ListClient) AddFaceFromURL

func (client ListClient) AddFaceFromURL(ctx context.Context, faceListID string, imageURL ImageURL, userData string, targetFace []int32, detectionModel DetectionModel) (result PersistedFace, err error)

AddFaceFromURL add a face to a specified face list, up to 1,000 faces. <br /> 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 [FaceList - Delete Face](https://docs.microsoft.com/rest/api/cognitiveservices/face/facelist/deleteface) or [FaceList - Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/facelist/delete) is called. <br /> Note persistedFaceId is different from faceId generated by [Face - Detect](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/detectwithurl). * Higher face image quality means better detection and 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/cognitiveservices/face/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) | Model | Recommended use-case(s) | | ---------- | -------- | | 'detection_01': | The default detection model for [FaceList - Add Face](https://docs.microsoft.com/rest/api/cognitiveservices/face/facelist/addfacefromurl). Recommend for near frontal face detection. For scenarios with exceptionally large angle (head-pose) faces, occluded faces or wrong image orientation, the faces in such cases may not be detected. | | 'detection_02': | Detection model released in 2019 May with improved accuracy especially on small, side and blurry faces. | Parameters: faceListID - id referencing a particular face list. imageURL - a JSON document with a URL pointing to the image that is to be analyzed. userData - user-specified data about the face for any purpose. The maximum length is 1KB. targetFace - 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. detectionModel - 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.

func (ListClient) AddFaceFromURLPreparer

func (client ListClient) AddFaceFromURLPreparer(ctx context.Context, faceListID string, imageURL ImageURL, userData string, targetFace []int32, detectionModel DetectionModel) (*http.Request, error)

AddFaceFromURLPreparer prepares the AddFaceFromURL request.

func (ListClient) AddFaceFromURLResponder

func (client ListClient) AddFaceFromURLResponder(resp *http.Response) (result PersistedFace, err error)

AddFaceFromURLResponder handles the response to the AddFaceFromURL request. The method always closes the http.Response Body.

func (ListClient) AddFaceFromURLSender

func (client ListClient) AddFaceFromURLSender(req *http.Request) (*http.Response, error)

AddFaceFromURLSender sends the AddFaceFromURL request. The method will close the http.Response Body if it receives an error.

func (ListClient) Create

func (client ListClient) Create(ctx context.Context, faceListID string, body MetaDataContract) (result autorest.Response, err error)

Create create an empty face list with user-specified faceListId, name, an optional userData and recognitionModel. Up to 64 face lists are allowed in one subscription. <br /> Face list is a list of faces, up to 1,000 faces, and used by [Face - Find Similar](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/findsimilar). <br /> After creation, user should use [FaceList - Add Face](https://docs.microsoft.com/rest/api/cognitiveservices/face/facelist/addfacefromurl) to import the faces. No image will be stored. Only the extracted face features are stored on server until [FaceList - Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/facelist/delete) is called. <br /> 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/cognitiveservices/face/persongroup) / LargePersonGroup(https://docs.microsoft.com/rest/api/cognitiveservices/face/largepersongroup) and [Face - Identify](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/identify). <br /> Please consider LargeFaceList(https://docs.microsoft.com/rest/api/cognitiveservices/face/largefacelist) when the face number is large. It can support up to 1,000,000 faces. <br />'recognitionModel' should be specified to associate with this 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 face list will use the recognition model that's already associated with the collection. Existing face features in a face list can't be updated to features extracted by another version of recognition model. * 'recognition_01': The default recognition model for [FaceList- Create](https://docs.microsoft.com/rest/api/cognitiveservices/face/facelist/create). All those face lists created before 2019 March are bonded with this recognition model. * 'recognition_02': Recognition model released in 2019 March. * 'recognition_03': Recognition model released in 2020 May. 'recognition_03' is recommended since its overall accuracy is improved compared with 'recognition_01' and 'recognition_02'. Parameters: faceListID - id referencing a particular face list. body - request body for creating a face list.

func (ListClient) CreatePreparer

func (client ListClient) CreatePreparer(ctx context.Context, faceListID string, body MetaDataContract) (*http.Request, error)

CreatePreparer prepares the Create request.

func (ListClient) CreateResponder

func (client ListClient) CreateResponder(resp *http.Response) (result autorest.Response, err error)

CreateResponder handles the response to the Create request. The method always closes the http.Response Body.

func (ListClient) CreateSender

func (client ListClient) CreateSender(req *http.Request) (*http.Response, error)

CreateSender sends the Create request. The method will close the http.Response Body if it receives an error.

func (ListClient) Delete

func (client ListClient) Delete(ctx context.Context, faceListID string) (result autorest.Response, err error)

Delete delete a specified face list. Parameters: faceListID - id referencing a particular face list.

func (ListClient) DeleteFace

func (client ListClient) DeleteFace(ctx context.Context, faceListID string, persistedFaceID uuid.UUID) (result autorest.Response, err error)

DeleteFace delete a face from a face list by specified faceListId and persistedFaceId. <br /> Adding/deleting faces to/from a same face list are processed sequentially and to/from different face lists are in parallel. Parameters: faceListID - id referencing a particular face list. persistedFaceID - id referencing a particular persistedFaceId of an existing face.

func (ListClient) DeleteFacePreparer

func (client ListClient) DeleteFacePreparer(ctx context.Context, faceListID string, persistedFaceID uuid.UUID) (*http.Request, error)

DeleteFacePreparer prepares the DeleteFace request.

func (ListClient) DeleteFaceResponder

func (client ListClient) DeleteFaceResponder(resp *http.Response) (result autorest.Response, err error)

DeleteFaceResponder handles the response to the DeleteFace request. The method always closes the http.Response Body.

func (ListClient) DeleteFaceSender

func (client ListClient) DeleteFaceSender(req *http.Request) (*http.Response, error)

DeleteFaceSender sends the DeleteFace request. The method will close the http.Response Body if it receives an error.

func (ListClient) DeletePreparer

func (client ListClient) DeletePreparer(ctx context.Context, faceListID string) (*http.Request, error)

DeletePreparer prepares the Delete request.

func (ListClient) DeleteResponder

func (client ListClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error)

DeleteResponder handles the response to the Delete request. The method always closes the http.Response Body.

func (ListClient) DeleteSender

func (client ListClient) DeleteSender(req *http.Request) (*http.Response, error)

DeleteSender sends the Delete request. The method will close the http.Response Body if it receives an error.

func (ListClient) Get

func (client ListClient) Get(ctx context.Context, faceListID string, returnRecognitionModel *bool) (result List, err error)

Get retrieve a face list’s faceListId, name, userData, recognitionModel and faces in the face list. Parameters: faceListID - id referencing a particular face list. returnRecognitionModel - a value indicating whether the operation should return 'recognitionModel' in response.

func (ListClient) GetPreparer

func (client ListClient) GetPreparer(ctx context.Context, faceListID string, returnRecognitionModel *bool) (*http.Request, error)

GetPreparer prepares the Get request.

func (ListClient) GetResponder

func (client ListClient) GetResponder(resp *http.Response) (result List, err error)

GetResponder handles the response to the Get request. The method always closes the http.Response Body.

func (ListClient) GetSender

func (client ListClient) GetSender(req *http.Request) (*http.Response, error)

GetSender sends the Get request. The method will close the http.Response Body if it receives an error.

func (ListClient) List

func (client ListClient) List(ctx context.Context, returnRecognitionModel *bool) (result ListList, err error)

List list face lists’ faceListId, name, userData and recognitionModel. <br /> To get face information inside faceList use [FaceList - Get](https://docs.microsoft.com/rest/api/cognitiveservices/face/facelist/get) Parameters: returnRecognitionModel - a value indicating whether the operation should return 'recognitionModel' in response.

func (ListClient) ListPreparer

func (client ListClient) ListPreparer(ctx context.Context, returnRecognitionModel *bool) (*http.Request, error)

ListPreparer prepares the List request.

func (ListClient) ListResponder

func (client ListClient) ListResponder(resp *http.Response) (result ListList, err error)

ListResponder handles the response to the List request. The method always closes the http.Response Body.

func (ListClient) ListSender

func (client ListClient) ListSender(req *http.Request) (*http.Response, error)

ListSender sends the List request. The method will close the http.Response Body if it receives an error.

func (ListClient) Update

func (client ListClient) Update(ctx context.Context, faceListID string, body NameAndUserDataContract) (result autorest.Response, err error)

Update update information of a face list. Parameters: faceListID - id referencing a particular face list. body - request body for updating a face list.

func (ListClient) UpdatePreparer

func (client ListClient) UpdatePreparer(ctx context.Context, faceListID string, body NameAndUserDataContract) (*http.Request, error)

UpdatePreparer prepares the Update request.

func (ListClient) UpdateResponder

func (client ListClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error)

UpdateResponder handles the response to the Update request. The method always closes the http.Response Body.

func (ListClient) UpdateSender

func (client ListClient) UpdateSender(req *http.Request) (*http.Response, error)

UpdateSender sends the Update request. The method will close the http.Response Body if it receives an error.

type ListDetectedFace

type ListDetectedFace struct {
	autorest.Response `json:"-"`
	Value             *[]DetectedFace `json:"value,omitempty"`
}

ListDetectedFace ...

type ListIdentifyResult

type ListIdentifyResult struct {
	autorest.Response `json:"-"`
	Value             *[]IdentifyResult `json:"value,omitempty"`
}

ListIdentifyResult ...

type ListLargeFaceList

type ListLargeFaceList struct {
	autorest.Response `json:"-"`
	Value             *[]LargeFaceList `json:"value,omitempty"`
}

ListLargeFaceList ...

type ListLargePersonGroup

type ListLargePersonGroup struct {
	autorest.Response `json:"-"`
	Value             *[]LargePersonGroup `json:"value,omitempty"`
}

ListLargePersonGroup ...

type ListList

type ListList struct {
	autorest.Response `json:"-"`
	Value             *[]List `json:"value,omitempty"`
}

ListList ...

type ListPersistedFace

type ListPersistedFace struct {
	autorest.Response `json:"-"`
	Value             *[]PersistedFace `json:"value,omitempty"`
}

ListPersistedFace ...

type ListPerson

type ListPerson struct {
	autorest.Response `json:"-"`
	Value             *[]Person `json:"value,omitempty"`
}

ListPerson ...

type ListPersonGroup

type ListPersonGroup struct {
	autorest.Response `json:"-"`
	Value             *[]PersonGroup `json:"value,omitempty"`
}

ListPersonGroup ...

type ListSimilarFace

type ListSimilarFace struct {
	autorest.Response `json:"-"`
	Value             *[]SimilarFace `json:"value,omitempty"`
}

ListSimilarFace ...

type ListSnapshot

type ListSnapshot struct {
	autorest.Response `json:"-"`
	Value             *[]Snapshot `json:"value,omitempty"`
}

ListSnapshot ...

type Makeup

type Makeup struct {
	// EyeMakeup - A boolean value describing whether eye makeup is present on a face.
	EyeMakeup *bool `json:"eyeMakeup,omitempty"`
	// LipMakeup - A boolean value describing whether lip makeup is present on a face.
	LipMakeup *bool `json:"lipMakeup,omitempty"`
}

Makeup properties describing present makeups on a given face.

type MetaDataContract

type MetaDataContract struct {
	// RecognitionModel - Possible values include: 'Recognition01', 'Recognition02', 'Recognition03'
	RecognitionModel RecognitionModel `json:"recognitionModel,omitempty"`
	// Name - User defined name, maximum length is 128.
	Name *string `json:"name,omitempty"`
	// UserData - User specified data. Length should not exceed 16KB.
	UserData *string `json:"userData,omitempty"`
}

MetaDataContract a combination of user defined name and user specified data and recognition model name for largePersonGroup/personGroup, and largeFaceList/faceList.

type NameAndUserDataContract

type NameAndUserDataContract struct {
	// Name - User defined name, maximum length is 128.
	Name *string `json:"name,omitempty"`
	// UserData - User specified data. Length should not exceed 16KB.
	UserData *string `json:"userData,omitempty"`
}

NameAndUserDataContract a combination of user defined name and user specified data for the person, largePersonGroup/personGroup, and largeFaceList/faceList.

type Noise

type Noise struct {
	// NoiseLevel - An enum value indicating level of noise. Possible values include: 'NoiseLevelLow', 'NoiseLevelMedium', 'NoiseLevelHigh'
	NoiseLevel NoiseLevel `json:"noiseLevel,omitempty"`
	// Value - A number indicating level of noise level ranging from 0 to 1. [0, 0.25) is under exposure. [0.25, 0.75) is good exposure. [0.75, 1] is over exposure. [0, 0.3) is low noise level. [0.3, 0.7) is medium noise level. [0.7, 1] is high noise level.
	Value *float64 `json:"value,omitempty"`
}

Noise properties describing noise level of the image.

type NoiseLevel

type NoiseLevel string

NoiseLevel enumerates the values for noise level.

const (
	// NoiseLevelHigh ...
	NoiseLevelHigh NoiseLevel = "High"
	// NoiseLevelLow ...
	NoiseLevelLow NoiseLevel = "Low"
	// NoiseLevelMedium ...
	NoiseLevelMedium NoiseLevel = "Medium"
)

func PossibleNoiseLevelValues

func PossibleNoiseLevelValues() []NoiseLevel

PossibleNoiseLevelValues returns an array of possible values for the NoiseLevel const type.

type Occlusion

type Occlusion struct {
	// ForeheadOccluded - A boolean value indicating whether forehead is occluded.
	ForeheadOccluded *bool `json:"foreheadOccluded,omitempty"`
	// EyeOccluded - A boolean value indicating whether eyes are occluded.
	EyeOccluded *bool `json:"eyeOccluded,omitempty"`
	// MouthOccluded - A boolean value indicating whether the mouth is occluded.
	MouthOccluded *bool `json:"mouthOccluded,omitempty"`
}

Occlusion properties describing occlusions on a given face.

type OperationStatus

type OperationStatus struct {
	autorest.Response `json:"-"`
	// Status - Operation status: notstarted, running, succeeded, failed. If the operation is requested and waiting to perform, the status is notstarted. If the operation is ongoing in backend, the status is running. Status succeeded means the operation is completed successfully, specifically for snapshot taking operation, it illustrates the snapshot is well taken and ready to apply, and for snapshot applying operation, it presents the target object has finished creating by the snapshot and ready to be used. Status failed is often caused by editing the source object while taking the snapshot or editing the target object while applying the snapshot before completion, see the field "message" to check the failure reason. Possible values include: 'Notstarted', 'Running', 'Succeeded', 'Failed'
	Status OperationStatusType `json:"status,omitempty"`
	// CreatedTime - A combined UTC date and time string that describes the time when the operation (take or apply a snapshot) is requested. E.g. 2018-12-25T11:41:02.2331413Z.
	CreatedTime *date.Time `json:"createdTime,omitempty"`
	// LastActionTime - A combined UTC date and time string that describes the last time the operation (take or apply a snapshot) is actively migrating data. The lastActionTime will keep increasing until the operation finishes. E.g. 2018-12-25T11:51:27.8705696Z.
	LastActionTime *date.Time `json:"lastActionTime,omitempty"`
	// ResourceLocation - When the operation succeeds successfully, for snapshot taking operation the snapshot id will be included in this field, and for snapshot applying operation, the path to get the target object will be returned in this field.
	ResourceLocation *string `json:"resourceLocation,omitempty"`
	// Message - Show failure message when operation fails (omitted when operation succeeds).
	Message *string `json:"message,omitempty"`
}

OperationStatus operation status object. Operation refers to the asynchronous backend task including taking a snapshot and applying a snapshot.

type OperationStatusType

type OperationStatusType string

OperationStatusType enumerates the values for operation status type.

const (
	// Failed ...
	Failed OperationStatusType = "failed"
	// Notstarted ...
	Notstarted OperationStatusType = "notstarted"
	// Running ...
	Running OperationStatusType = "running"
	// Succeeded ...
	Succeeded OperationStatusType = "succeeded"
)

func PossibleOperationStatusTypeValues

func PossibleOperationStatusTypeValues() []OperationStatusType

PossibleOperationStatusTypeValues returns an array of possible values for the OperationStatusType const type.

type PersistedFace

type PersistedFace struct {
	autorest.Response `json:"-"`
	// PersistedFaceID - The persistedFaceId of the target face, which is persisted and will not expire. Different from faceId created by Face - Detect and will expire in 24 hours after the detection call.
	PersistedFaceID *uuid.UUID `json:"persistedFaceId,omitempty"`
	// UserData - User-provided data attached to the face. The size limit is 1KB.
	UserData *string `json:"userData,omitempty"`
}

PersistedFace personFace object.

type Person

type Person struct {
	autorest.Response `json:"-"`
	// PersonID - PersonId of the target face list.
	PersonID *uuid.UUID `json:"personId,omitempty"`
	// PersistedFaceIds - PersistedFaceIds of registered faces in the person. These persistedFaceIds are returned from Person - Add a Person Face, and will not expire.
	PersistedFaceIds *[]uuid.UUID `json:"persistedFaceIds,omitempty"`
	// Name - User defined name, maximum length is 128.
	Name *string `json:"name,omitempty"`
	// UserData - User specified data. Length should not exceed 16KB.
	UserData *string `json:"userData,omitempty"`
}

Person person object.

type PersonGroup

type PersonGroup struct {
	autorest.Response `json:"-"`
	// PersonGroupID - PersonGroupId of the target person group.
	PersonGroupID *string `json:"personGroupId,omitempty"`
	// RecognitionModel - Possible values include: 'Recognition01', 'Recognition02', 'Recognition03'
	RecognitionModel RecognitionModel `json:"recognitionModel,omitempty"`
	// Name - User defined name, maximum length is 128.
	Name *string `json:"name,omitempty"`
	// UserData - User specified data. Length should not exceed 16KB.
	UserData *string `json:"userData,omitempty"`
}

PersonGroup person group object.

type PersonGroupClient

type PersonGroupClient struct {
	BaseClient
}

PersonGroupClient is the an API for face detection, verification, and identification.

func NewPersonGroupClient

func NewPersonGroupClient(endpoint string) PersonGroupClient

NewPersonGroupClient creates an instance of the PersonGroupClient client.

func (PersonGroupClient) Create

func (client PersonGroupClient) Create(ctx context.Context, personGroupID string, body MetaDataContract) (result autorest.Response, err error)

Create create a new person group with specified personGroupId, name, user-provided userData and recognitionModel. <br /> A person group is the container of the uploaded person data, including face recognition features. <br /> After creation, use [PersonGroup Person - Create](https://docs.microsoft.com/rest/api/cognitiveservices/face/persongroupperson/create) to add persons into the group, and then call [PersonGroup - Train](https://docs.microsoft.com/rest/api/cognitiveservices/face/persongroup/train) to get this group ready for [Face - Identify](https://docs.microsoft.com/rest/api/cognitiveservices/face/face/identify). <br /> No image will be stored. Only the person's extracted face features and userData will be stored on server until [PersonGroup Person - Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/persongroupperson/delete) or [PersonGroup - Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/persongroup/delete) is called. <br/>'recognitionModel' should be specified to associate with this 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 person group will use the recognition model that's already associated with the collection. Existing face features in a person group can't be updated to features extracted by another version of recognition model. * 'recognition_01': The default recognition model for [PersonGroup - Create](https://docs.microsoft.com/rest/api/cognitiveservices/face/persongroup/create). All those person groups created before 2019 March are bonded with this recognition model. * 'recognition_02': Recognition model released in 2019 March. * 'recognition_03': Recognition model released in 2020 May. 'recognition_03' is recommended since its overall accuracy is improved compared with 'recognition_01' and 'recognition_02'.

Person group quota: * Free-tier subscription quota: 1,000 person groups. Each holds up to 1,000 persons. * S0-tier subscription quota: 1,000,000 person groups. Each holds up to 10,000 persons. * to handle larger scale face identification problem, please consider using LargePersonGroup(https://docs.microsoft.com/rest/api/cognitiveservices/face/largepersongroup). Parameters: personGroupID - id referencing a particular person group. body - request body for creating new person group.

func (PersonGroupClient) CreatePreparer

func (client PersonGroupClient) CreatePreparer(ctx context.Context, personGroupID string, body MetaDataContract) (*http.Request, error)

CreatePreparer prepares the Create request.

func (PersonGroupClient) CreateResponder

func (client PersonGroupClient) CreateResponder(resp *http.Response) (result autorest.Response, err error)

CreateResponder handles the response to the Create request. The method always closes the http.Response Body.

func (PersonGroupClient) CreateSender

func (client PersonGroupClient) CreateSender(req *http.Request) (*http.Response, error)

CreateSender sends the Create request. The method will close the http.Response Body if it receives an error.

func (PersonGroupClient) Delete

func (client PersonGroupClient) Delete(ctx context.Context, personGroupID string) (result autorest.Response, err error)

Delete delete an existing person group. Persisted face features of all people in the person group will also be deleted. Parameters: personGroupID - id referencing a particular person group.

func (PersonGroupClient) DeletePreparer

func (client PersonGroupClient) DeletePreparer(ctx context.Context, personGroupID string) (*http.Request, error)

DeletePreparer prepares the Delete request.

func (PersonGroupClient) DeleteResponder

func (client PersonGroupClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error)

DeleteResponder handles the response to the Delete request. The method always closes the http.Response Body.

func (PersonGroupClient) DeleteSender

func (client PersonGroupClient) DeleteSender(req *http.Request) (*http.Response, error)

DeleteSender sends the Delete request. The method will close the http.Response Body if it receives an error.

func (PersonGroupClient) Get

func (client PersonGroupClient) Get(ctx context.Context, personGroupID string, returnRecognitionModel *bool) (result PersonGroup, err error)

Get retrieve person group name, userData and recognitionModel. To get person information under this personGroup, use [PersonGroup Person - List](https://docs.microsoft.com/rest/api/cognitiveservices/face/persongroupperson/list). Parameters: personGroupID - id referencing a particular person group. returnRecognitionModel - a value indicating whether the operation should return 'recognitionModel' in response.

func (PersonGroupClient) GetPreparer

func (client PersonGroupClient) GetPreparer(ctx context.Context, personGroupID string, returnRecognitionModel *bool) (*http.Request, error)

GetPreparer prepares the Get request.

func (PersonGroupClient) GetResponder

func (client PersonGroupClient) GetResponder(resp *http.Response) (result PersonGroup, err error)

GetResponder handles the response to the Get request. The method always closes the http.Response Body.

func (PersonGroupClient) GetSender

func (client PersonGroupClient) GetSender(req *http.Request) (*http.Response, error)

GetSender sends the Get request. The method will close the http.Response Body if it receives an error.

func (PersonGroupClient) GetTrainingStatus

func (client PersonGroupClient) GetTrainingStatus(ctx context.Context, personGroupID string) (result TrainingStatus, err error)

GetTrainingStatus retrieve the training status of a person group (completed or ongoing). Parameters: personGroupID - id referencing a particular person group.

func (PersonGroupClient) GetTrainingStatusPreparer

func (client PersonGroupClient) GetTrainingStatusPreparer(ctx context.Context, personGroupID string) (*http.Request, error)

GetTrainingStatusPreparer prepares the GetTrainingStatus request.

func (PersonGroupClient) GetTrainingStatusResponder

func (client PersonGroupClient) GetTrainingStatusResponder(resp *http.Response) (result TrainingStatus, err error)

GetTrainingStatusResponder handles the response to the GetTrainingStatus request. The method always closes the http.Response Body.

func (PersonGroupClient) GetTrainingStatusSender

func (client PersonGroupClient) GetTrainingStatusSender(req *http.Request) (*http.Response, error)

GetTrainingStatusSender sends the GetTrainingStatus request. The method will close the http.Response Body if it receives an error.

func (PersonGroupClient) List

func (client PersonGroupClient) List(ctx context.Context, start string, top *int32, returnRecognitionModel *bool) (result ListPersonGroup, err error)

List list person groups’ personGroupId, name, userData and recognitionModel.<br /> * Person groups are stored in alphabetical order of personGroupId. * "start" parameter (string, optional) is a user-provided personGroupId 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. <br /> For example, total 5 person groups: "group1", ..., "group5". <br /> "start=&top=" will return all 5 groups. <br /> "start=&top=2" will return "group1", "group2". <br /> "start=group2&top=3" will return "group3", "group4", "group5". Parameters: start - list person groups from the least personGroupId greater than the "start". top - the number of person groups to list. returnRecognitionModel - a value indicating whether the operation should return 'recognitionModel' in response.

func (PersonGroupClient) ListPreparer

func (client PersonGroupClient) ListPreparer(ctx context.Context, start string, top *int32, returnRecognitionModel *bool) (*http.Request, error)

ListPreparer prepares the List request.

func (PersonGroupClient) ListResponder

func (client PersonGroupClient) ListResponder(resp *http.Response) (result ListPersonGroup, err error)

ListResponder handles the response to the List request. The method always closes the http.Response Body.

func (PersonGroupClient) ListSender

func (client PersonGroupClient) ListSender(req *http.Request) (*http.Response, error)

ListSender sends the List request. The method will close the http.Response Body if it receives an error.

func (PersonGroupClient) Train

func (client PersonGroupClient) Train(ctx context.Context, personGroupID string) (result autorest.Response, err error)

Train queue a person group training task, the training task may not be started immediately. Parameters: personGroupID - id referencing a particular person group.

func (PersonGroupClient) TrainPreparer

func (client PersonGroupClient) TrainPreparer(ctx context.Context, personGroupID string) (*http.Request, error)

TrainPreparer prepares the Train request.

func (PersonGroupClient) TrainResponder

func (client PersonGroupClient) TrainResponder(resp *http.Response) (result autorest.Response, err error)

TrainResponder handles the response to the Train request. The method always closes the http.Response Body.

func (PersonGroupClient) TrainSender

func (client PersonGroupClient) TrainSender(req *http.Request) (*http.Response, error)

TrainSender sends the Train request. The method will close the http.Response Body if it receives an error.

func (PersonGroupClient) Update

func (client PersonGroupClient) Update(ctx context.Context, personGroupID string, body NameAndUserDataContract) (result autorest.Response, err error)

Update update an existing person group's display name and userData. The properties which does not appear in request body will not be updated. Parameters: personGroupID - id referencing a particular person group. body - request body for updating person group.

func (PersonGroupClient) UpdatePreparer

func (client PersonGroupClient) UpdatePreparer(ctx context.Context, personGroupID string, body NameAndUserDataContract) (*http.Request, error)

UpdatePreparer prepares the Update request.

func (PersonGroupClient) UpdateResponder

func (client PersonGroupClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error)

UpdateResponder handles the response to the Update request. The method always closes the http.Response Body.

func (PersonGroupClient) UpdateSender

func (client PersonGroupClient) UpdateSender(req *http.Request) (*http.Response, error)

UpdateSender sends the Update request. The method will close the http.Response Body if it receives an error.

type PersonGroupPersonClient

type PersonGroupPersonClient struct {
	BaseClient
}

PersonGroupPersonClient is the an API for face detection, verification, and identification.

func NewPersonGroupPersonClient

func NewPersonGroupPersonClient(endpoint string) PersonGroupPersonClient

NewPersonGroupPersonClient creates an instance of the PersonGroupPersonClient client.

func (PersonGroupPersonClient) AddFaceFromStream

func (client PersonGroupPersonClient) AddFaceFromStream(ctx context.Context, personGroupID string, personID uuid.UUID, imageParameter io.ReadCloser, userData string, targetFace []int32, detectionModel DetectionModel) (result PersistedFace, err error)

AddFaceFromStream add a face to a person into a 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 [PersonGroup PersonFace - Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/persongroupperson/deleteface), [PersonGroup Person - Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/persongroupperson/delete) or [PersonGroup - Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/persongroup/delete) is called. <br /> Note persistedFaceId is different from faceId generated by [Face - Detect](https://docs.microsoft.com/rest/api/cognitiveservices/face/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/cognitiveservices/face/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) | Model | Recommended use-case(s) | | ---------- | -------- | | 'detection_01': | The default detection model for [PersonGroup Person - Add Face](https://docs.microsoft.com/rest/api/cognitiveservices/face/persongroupperson/addfacefromurl). Recommend for near frontal face detection. For scenarios with exceptionally large angle (head-pose) faces, occluded faces or wrong image orientation, the faces in such cases may not be detected. | | 'detection_02': | Detection model released in 2019 May with improved accuracy especially on small, side and blurry faces. | Parameters: personGroupID - id referencing a particular person group. personID - id referencing a particular person. imageParameter - an image stream. userData - user-specified data about the face for any purpose. The maximum length is 1KB. targetFace - 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. detectionModel - 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.

func (PersonGroupPersonClient) AddFaceFromStreamPreparer

func (client PersonGroupPersonClient) AddFaceFromStreamPreparer(ctx context.Context, personGroupID string, personID uuid.UUID, imageParameter io.ReadCloser, userData string, targetFace []int32, detectionModel DetectionModel) (*http.Request, error)

AddFaceFromStreamPreparer prepares the AddFaceFromStream request.

func (PersonGroupPersonClient) AddFaceFromStreamResponder

func (client PersonGroupPersonClient) AddFaceFromStreamResponder(resp *http.Response) (result PersistedFace, err error)

AddFaceFromStreamResponder handles the response to the AddFaceFromStream request. The method always closes the http.Response Body.

func (PersonGroupPersonClient) AddFaceFromStreamSender

func (client PersonGroupPersonClient) AddFaceFromStreamSender(req *http.Request) (*http.Response, error)

AddFaceFromStreamSender sends the AddFaceFromStream request. The method will close the http.Response Body if it receives an error.

func (PersonGroupPersonClient) AddFaceFromURL

func (client PersonGroupPersonClient) AddFaceFromURL(ctx context.Context, personGroupID string, personID uuid.UUID, imageURL ImageURL, userData string, targetFace []int32, detectionModel DetectionModel) (result PersistedFace, err error)

AddFaceFromURL add a face to a person into a 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 [PersonGroup PersonFace - Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/persongroupperson/deleteface), [PersonGroup Person - Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/persongroupperson/delete) or [PersonGroup - Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/persongroup/delete) is called. <br /> Note persistedFaceId is different from faceId generated by [Face - Detect](https://docs.microsoft.com/rest/api/cognitiveservices/face/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/cognitiveservices/face/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) | Model | Recommended use-case(s) | | ---------- | -------- | | 'detection_01': | The default detection model for [PersonGroup Person - Add Face](https://docs.microsoft.com/rest/api/cognitiveservices/face/persongroupperson/addfacefromurl). Recommend for near frontal face detection. For scenarios with exceptionally large angle (head-pose) faces, occluded faces or wrong image orientation, the faces in such cases may not be detected. | | 'detection_02': | Detection model released in 2019 May with improved accuracy especially on small, side and blurry faces. | Parameters: personGroupID - id referencing a particular person group. personID - id referencing a particular person. imageURL - a JSON document with a URL pointing to the image that is to be analyzed. userData - user-specified data about the face for any purpose. The maximum length is 1KB. targetFace - 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. detectionModel - 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.

func (PersonGroupPersonClient) AddFaceFromURLPreparer

func (client PersonGroupPersonClient) AddFaceFromURLPreparer(ctx context.Context, personGroupID string, personID uuid.UUID, imageURL ImageURL, userData string, targetFace []int32, detectionModel DetectionModel) (*http.Request, error)

AddFaceFromURLPreparer prepares the AddFaceFromURL request.

func (PersonGroupPersonClient) AddFaceFromURLResponder

func (client PersonGroupPersonClient) AddFaceFromURLResponder(resp *http.Response) (result PersistedFace, err error)

AddFaceFromURLResponder handles the response to the AddFaceFromURL request. The method always closes the http.Response Body.

func (PersonGroupPersonClient) AddFaceFromURLSender

func (client PersonGroupPersonClient) AddFaceFromURLSender(req *http.Request) (*http.Response, error)

AddFaceFromURLSender sends the AddFaceFromURL request. The method will close the http.Response Body if it receives an error.

func (PersonGroupPersonClient) Create

func (client PersonGroupPersonClient) Create(ctx context.Context, personGroupID string, body NameAndUserDataContract) (result Person, err error)

Create create a new person in a specified person group. Parameters: personGroupID - id referencing a particular person group. body - request body for creating new person.

func (PersonGroupPersonClient) CreatePreparer

func (client PersonGroupPersonClient) CreatePreparer(ctx context.Context, personGroupID string, body NameAndUserDataContract) (*http.Request, error)

CreatePreparer prepares the Create request.

func (PersonGroupPersonClient) CreateResponder

func (client PersonGroupPersonClient) CreateResponder(resp *http.Response) (result Person, err error)

CreateResponder handles the response to the Create request. The method always closes the http.Response Body.

func (PersonGroupPersonClient) CreateSender

func (client PersonGroupPersonClient) CreateSender(req *http.Request) (*http.Response, error)

CreateSender sends the Create request. The method will close the http.Response Body if it receives an error.

func (PersonGroupPersonClient) Delete

func (client PersonGroupPersonClient) Delete(ctx context.Context, personGroupID string, personID uuid.UUID) (result autorest.Response, err error)

Delete delete an existing person from a person group. The persistedFaceId, userData, person name and face feature in the person entry will all be deleted. Parameters: personGroupID - id referencing a particular person group. personID - id referencing a particular person.

func (PersonGroupPersonClient) DeleteFace

func (client PersonGroupPersonClient) DeleteFace(ctx context.Context, personGroupID string, personID uuid.UUID, persistedFaceID uuid.UUID) (result autorest.Response, err error)

DeleteFace delete a face from a person in a person group by specified personGroupId, personId and persistedFaceId. <br /> Adding/deleting faces to/from a same person will be processed sequentially. Adding/deleting faces to/from different persons are processed in parallel. Parameters: personGroupID - id referencing a particular person group. personID - id referencing a particular person. persistedFaceID - id referencing a particular persistedFaceId of an existing face.

func (PersonGroupPersonClient) DeleteFacePreparer

func (client PersonGroupPersonClient) DeleteFacePreparer(ctx context.Context, personGroupID string, personID uuid.UUID, persistedFaceID uuid.UUID) (*http.Request, error)

DeleteFacePreparer prepares the DeleteFace request.

func (PersonGroupPersonClient) DeleteFaceResponder

func (client PersonGroupPersonClient) DeleteFaceResponder(resp *http.Response) (result autorest.Response, err error)

DeleteFaceResponder handles the response to the DeleteFace request. The method always closes the http.Response Body.

func (PersonGroupPersonClient) DeleteFaceSender

func (client PersonGroupPersonClient) DeleteFaceSender(req *http.Request) (*http.Response, error)

DeleteFaceSender sends the DeleteFace request. The method will close the http.Response Body if it receives an error.

func (PersonGroupPersonClient) DeletePreparer

func (client PersonGroupPersonClient) DeletePreparer(ctx context.Context, personGroupID string, personID uuid.UUID) (*http.Request, error)

DeletePreparer prepares the Delete request.

func (PersonGroupPersonClient) DeleteResponder

func (client PersonGroupPersonClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error)

DeleteResponder handles the response to the Delete request. The method always closes the http.Response Body.

func (PersonGroupPersonClient) DeleteSender

func (client PersonGroupPersonClient) DeleteSender(req *http.Request) (*http.Response, error)

DeleteSender sends the Delete request. The method will close the http.Response Body if it receives an error.

func (PersonGroupPersonClient) Get

func (client PersonGroupPersonClient) Get(ctx context.Context, personGroupID string, personID uuid.UUID) (result Person, err error)

Get retrieve a person's information, including registered persisted faces, name and userData. Parameters: personGroupID - id referencing a particular person group. personID - id referencing a particular person.

func (PersonGroupPersonClient) GetFace

func (client PersonGroupPersonClient) GetFace(ctx context.Context, personGroupID string, personID uuid.UUID, persistedFaceID uuid.UUID) (result PersistedFace, err error)

GetFace retrieve information about a persisted face (specified by persistedFaceId, personId and its belonging personGroupId). Parameters: personGroupID - id referencing a particular person group. personID - id referencing a particular person. persistedFaceID - id referencing a particular persistedFaceId of an existing face.

func (PersonGroupPersonClient) GetFacePreparer

func (client PersonGroupPersonClient) GetFacePreparer(ctx context.Context, personGroupID string, personID uuid.UUID, persistedFaceID uuid.UUID) (*http.Request, error)

GetFacePreparer prepares the GetFace request.

func (PersonGroupPersonClient) GetFaceResponder

func (client PersonGroupPersonClient) GetFaceResponder(resp *http.Response) (result PersistedFace, err error)

GetFaceResponder handles the response to the GetFace request. The method always closes the http.Response Body.

func (PersonGroupPersonClient) GetFaceSender

func (client PersonGroupPersonClient) GetFaceSender(req *http.Request) (*http.Response, error)

GetFaceSender sends the GetFace request. The method will close the http.Response Body if it receives an error.

func (PersonGroupPersonClient) GetPreparer

func (client PersonGroupPersonClient) GetPreparer(ctx context.Context, personGroupID string, personID uuid.UUID) (*http.Request, error)

GetPreparer prepares the Get request.

func (PersonGroupPersonClient) GetResponder

func (client PersonGroupPersonClient) GetResponder(resp *http.Response) (result Person, err error)

GetResponder handles the response to the Get request. The method always closes the http.Response Body.

func (PersonGroupPersonClient) GetSender

func (client PersonGroupPersonClient) GetSender(req *http.Request) (*http.Response, error)

GetSender sends the Get request. The method will close the http.Response Body if it receives an error.

func (PersonGroupPersonClient) List

func (client PersonGroupPersonClient) List(ctx context.Context, personGroupID string, start string, top *int32) (result ListPerson, err error)

List list all persons in a person group, and retrieve person information (including personId, name, userData and persistedFaceIds of registered faces of the person). Parameters: personGroupID - id referencing a particular person group. start - starting person id to return (used to list a range of persons). top - number of persons to return starting with the person id indicated by the 'start' parameter.

func (PersonGroupPersonClient) ListPreparer

func (client PersonGroupPersonClient) ListPreparer(ctx context.Context, personGroupID string, start string, top *int32) (*http.Request, error)

ListPreparer prepares the List request.

func (PersonGroupPersonClient) ListResponder

func (client PersonGroupPersonClient) ListResponder(resp *http.Response) (result ListPerson, err error)

ListResponder handles the response to the List request. The method always closes the http.Response Body.

func (PersonGroupPersonClient) ListSender

func (client PersonGroupPersonClient) ListSender(req *http.Request) (*http.Response, error)

ListSender sends the List request. The method will close the http.Response Body if it receives an error.

func (PersonGroupPersonClient) Update

func (client PersonGroupPersonClient) Update(ctx context.Context, personGroupID string, personID uuid.UUID, body NameAndUserDataContract) (result autorest.Response, err error)

Update update name or userData of a person. Parameters: personGroupID - id referencing a particular person group. personID - id referencing a particular person. body - request body for person update operation.

func (PersonGroupPersonClient) UpdateFace

func (client PersonGroupPersonClient) UpdateFace(ctx context.Context, personGroupID string, personID uuid.UUID, persistedFaceID uuid.UUID, body UpdateFaceRequest) (result autorest.Response, err error)

UpdateFace add a face to a person into a 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 [PersonGroup PersonFace - Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/persongroupperson/deleteface), [PersonGroup Person - Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/persongroupperson/delete) or [PersonGroup - Delete](https://docs.microsoft.com/rest/api/cognitiveservices/face/persongroup/delete) is called. <br /> Note persistedFaceId is different from faceId generated by [Face - Detect](https://docs.microsoft.com/rest/api/cognitiveservices/face/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/cognitiveservices/face/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. Parameters: personGroupID - id referencing a particular person group. personID - id referencing a particular person. persistedFaceID - id referencing a particular persistedFaceId of an existing face. body - request body for updating persisted face.

func (PersonGroupPersonClient) UpdateFacePreparer

func (client PersonGroupPersonClient) UpdateFacePreparer(ctx context.Context, personGroupID string, personID uuid.UUID, persistedFaceID uuid.UUID, body UpdateFaceRequest) (*http.Request, error)

UpdateFacePreparer prepares the UpdateFace request.

func (PersonGroupPersonClient) UpdateFaceResponder

func (client PersonGroupPersonClient) UpdateFaceResponder(resp *http.Response) (result autorest.Response, err error)

UpdateFaceResponder handles the response to the UpdateFace request. The method always closes the http.Response Body.

func (PersonGroupPersonClient) UpdateFaceSender

func (client PersonGroupPersonClient) UpdateFaceSender(req *http.Request) (*http.Response, error)

UpdateFaceSender sends the UpdateFace request. The method will close the http.Response Body if it receives an error.

func (PersonGroupPersonClient) UpdatePreparer

func (client PersonGroupPersonClient) UpdatePreparer(ctx context.Context, personGroupID string, personID uuid.UUID, body NameAndUserDataContract) (*http.Request, error)

UpdatePreparer prepares the Update request.

func (PersonGroupPersonClient) UpdateResponder

func (client PersonGroupPersonClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error)

UpdateResponder handles the response to the Update request. The method always closes the http.Response Body.

func (PersonGroupPersonClient) UpdateSender

func (client PersonGroupPersonClient) UpdateSender(req *http.Request) (*http.Response, error)

UpdateSender sends the Update request. The method will close the http.Response Body if it receives an error.

type RecognitionModel

type RecognitionModel string

RecognitionModel enumerates the values for recognition model.

const (
	// Recognition01 ...
	Recognition01 RecognitionModel = "recognition_01"
	// Recognition02 ...
	Recognition02 RecognitionModel = "recognition_02"
	// Recognition03 ...
	Recognition03 RecognitionModel = "recognition_03"
)

func PossibleRecognitionModelValues

func PossibleRecognitionModelValues() []RecognitionModel

PossibleRecognitionModelValues returns an array of possible values for the RecognitionModel const type.

type Rectangle

type Rectangle struct {
	// Width - The width of the rectangle, in pixels.
	Width *int32 `json:"width,omitempty"`
	// Height - The height of the rectangle, in pixels.
	Height *int32 `json:"height,omitempty"`
	// Left - The distance from the left edge if the image to the left edge of the rectangle, in pixels.
	Left *int32 `json:"left,omitempty"`
	// Top - The distance from the top edge if the image to the top edge of the rectangle, in pixels.
	Top *int32 `json:"top,omitempty"`
}

Rectangle a rectangle within which a face can be found

type SimilarFace

type SimilarFace struct {
	// FaceID - FaceId of candidate face when find by faceIds. faceId is created by Face - Detect and will expire 24 hours after the detection call
	FaceID *uuid.UUID `json:"faceId,omitempty"`
	// PersistedFaceID - PersistedFaceId of candidate face when find by faceListId. persistedFaceId in face list is persisted and will not expire. As showed in below response
	PersistedFaceID *uuid.UUID `json:"persistedFaceId,omitempty"`
	// Confidence - Similarity confidence of the candidate face. The higher confidence, the more similar. Range between [0,1].
	Confidence *float64 `json:"confidence,omitempty"`
}

SimilarFace response body for find similar face operation.

type Snapshot

type Snapshot struct {
	autorest.Response `json:"-"`
	// ID - Snapshot id.
	ID *uuid.UUID `json:"id,omitempty"`
	// Account - Azure Cognitive Service Face account id of the subscriber who created the snapshot by Snapshot - Take.
	Account *string `json:"account,omitempty"`
	// Type - Type of the source object in the snapshot, specified by the subscriber who created the snapshot when calling Snapshot - Take. Currently FaceList, PersonGroup, LargeFaceList and LargePersonGroup are supported. Possible values include: 'SnapshotObjectTypeFaceList', 'SnapshotObjectTypeLargeFaceList', 'SnapshotObjectTypeLargePersonGroup', 'SnapshotObjectTypePersonGroup'
	Type SnapshotObjectType `json:"type,omitempty"`
	// ApplyScope - Array of the target Face subscription ids for the snapshot, specified by the user who created the snapshot when calling Snapshot - Take. For each snapshot, only subscriptions included in the applyScope of Snapshot - Take can apply it.
	ApplyScope *[]uuid.UUID `json:"applyScope,omitempty"`
	// UserData - User specified data about the snapshot for any purpose. Length should not exceed 16KB.
	UserData *string `json:"userData,omitempty"`
	// CreatedTime - A combined UTC date and time string that describes the created time of the snapshot. E.g. 2018-12-25T11:41:02.2331413Z.
	CreatedTime *date.Time `json:"createdTime,omitempty"`
	// LastUpdateTime - A combined UTC date and time string that describes the last time when the snapshot was created or updated by Snapshot - Update. E.g. 2018-12-25T11:51:27.8705696Z.
	LastUpdateTime *date.Time `json:"lastUpdateTime,omitempty"`
}

Snapshot snapshot object.

type SnapshotApplyMode

type SnapshotApplyMode string

SnapshotApplyMode enumerates the values for snapshot apply mode.

const (
	// CreateNew ...
	CreateNew SnapshotApplyMode = "CreateNew"
)

func PossibleSnapshotApplyModeValues

func PossibleSnapshotApplyModeValues() []SnapshotApplyMode

PossibleSnapshotApplyModeValues returns an array of possible values for the SnapshotApplyMode const type.

type SnapshotClient

type SnapshotClient struct {
	BaseClient
}

SnapshotClient is the an API for face detection, verification, and identification.

func NewSnapshotClient

func NewSnapshotClient(endpoint string) SnapshotClient

NewSnapshotClient creates an instance of the SnapshotClient client.

func (SnapshotClient) Apply

func (client SnapshotClient) Apply(ctx context.Context, snapshotID uuid.UUID, body ApplySnapshotRequest) (result autorest.Response, err error)

Apply submit an operation to apply a snapshot to current subscription. For each snapshot, only subscriptions included in the applyScope of Snapshot - Take can apply it.<br /> The snapshot interfaces are for users to backup and restore their face data from one face subscription to another, inside same region or across regions. The workflow contains two phases, user first calls Snapshot - Take to create a copy of the source object and store it as a snapshot, then calls Snapshot - Apply to paste the snapshot to target subscription. The snapshots are stored in a centralized location (per Azure instance), so that they can be applied cross accounts and regions.<br /> Applying snapshot is an asynchronous operation. An operation id can be obtained from the "Operation-Location" field in response header, to be used in OperationStatus - Get for tracking the progress of applying the snapshot. The target object id will be included in the "resourceLocation" field in OperationStatus - Get response when the operation status is "succeeded".<br /> Snapshot applying time depends on the number of person and face entries in the snapshot object. It could be in seconds, or up to 1 hour for 1,000,000 persons with multiple faces.<br /> Snapshots will be automatically expired and cleaned in 48 hours after it is created by Snapshot - Take. So the target subscription is required to apply the snapshot in 48 hours since its creation.<br /> Applying a snapshot will not block any other operations against the target object, however it is not recommended because the correctness cannot be guaranteed during snapshot applying. After snapshot applying is completed, all operations towards the target object can work as normal. Snapshot also includes the training results of the source object, which means target subscription the snapshot applied to does not need re-train the target object before calling Identify/FindSimilar.<br /> One snapshot can be applied multiple times in parallel, while currently only CreateNew apply mode is supported, which means the apply operation will fail if target subscription already contains an object of same type and using the same objectId. Users can specify the "objectId" in request body to avoid such conflicts.<br /> * Free-tier subscription quota: 100 apply operations per month. * S0-tier subscription quota: 100 apply operations per day. Parameters: snapshotID - id referencing a particular snapshot. body - request body for applying a snapshot.

func (SnapshotClient) ApplyPreparer

func (client SnapshotClient) ApplyPreparer(ctx context.Context, snapshotID uuid.UUID, body ApplySnapshotRequest) (*http.Request, error)

ApplyPreparer prepares the Apply request.

func (SnapshotClient) ApplyResponder

func (client SnapshotClient) ApplyResponder(resp *http.Response) (result autorest.Response, err error)

ApplyResponder handles the response to the Apply request. The method always closes the http.Response Body.

func (SnapshotClient) ApplySender

func (client SnapshotClient) ApplySender(req *http.Request) (*http.Response, error)

ApplySender sends the Apply request. The method will close the http.Response Body if it receives an error.

func (SnapshotClient) Delete

func (client SnapshotClient) Delete(ctx context.Context, snapshotID uuid.UUID) (result autorest.Response, err error)

Delete delete an existing snapshot according to the snapshotId. All object data and information in the snapshot will also be deleted. Only the source subscription who took the snapshot can delete the snapshot. If the user does not delete a snapshot with this API, the snapshot will still be automatically deleted in 48 hours after creation. Parameters: snapshotID - id referencing a particular snapshot.

func (SnapshotClient) DeletePreparer

func (client SnapshotClient) DeletePreparer(ctx context.Context, snapshotID uuid.UUID) (*http.Request, error)

DeletePreparer prepares the Delete request.

func (SnapshotClient) DeleteResponder

func (client SnapshotClient) DeleteResponder(resp *http.Response) (result autorest.Response, err error)

DeleteResponder handles the response to the Delete request. The method always closes the http.Response Body.

func (SnapshotClient) DeleteSender

func (client SnapshotClient) DeleteSender(req *http.Request) (*http.Response, error)

DeleteSender sends the Delete request. The method will close the http.Response Body if it receives an error.

func (SnapshotClient) Get

func (client SnapshotClient) Get(ctx context.Context, snapshotID uuid.UUID) (result Snapshot, err error)

Get retrieve information about a snapshot. Snapshot is only accessible to the source subscription who took it, and target subscriptions included in the applyScope in Snapshot - Take. Parameters: snapshotID - id referencing a particular snapshot.

func (SnapshotClient) GetOperationStatus

func (client SnapshotClient) GetOperationStatus(ctx context.Context, operationID uuid.UUID) (result OperationStatus, err error)

GetOperationStatus retrieve the status of a take/apply snapshot operation. Parameters: operationID - id referencing a particular take/apply snapshot operation.

func (SnapshotClient) GetOperationStatusPreparer

func (client SnapshotClient) GetOperationStatusPreparer(ctx context.Context, operationID uuid.UUID) (*http.Request, error)

GetOperationStatusPreparer prepares the GetOperationStatus request.

func (SnapshotClient) GetOperationStatusResponder

func (client SnapshotClient) GetOperationStatusResponder(resp *http.Response) (result OperationStatus, err error)

GetOperationStatusResponder handles the response to the GetOperationStatus request. The method always closes the http.Response Body.

func (SnapshotClient) GetOperationStatusSender

func (client SnapshotClient) GetOperationStatusSender(req *http.Request) (*http.Response, error)

GetOperationStatusSender sends the GetOperationStatus request. The method will close the http.Response Body if it receives an error.

func (SnapshotClient) GetPreparer

func (client SnapshotClient) GetPreparer(ctx context.Context, snapshotID uuid.UUID) (*http.Request, error)

GetPreparer prepares the Get request.

func (SnapshotClient) GetResponder

func (client SnapshotClient) GetResponder(resp *http.Response) (result Snapshot, err error)

GetResponder handles the response to the Get request. The method always closes the http.Response Body.

func (SnapshotClient) GetSender

func (client SnapshotClient) GetSender(req *http.Request) (*http.Response, error)

GetSender sends the Get request. The method will close the http.Response Body if it receives an error.

func (SnapshotClient) List

func (client SnapshotClient) List(ctx context.Context, typeParameter SnapshotObjectType, applyScope []uuid.UUID) (result ListSnapshot, err error)

List list all accessible snapshots with related information, including snapshots that were taken by the user, or snapshots to be applied to the user (subscription id was included in the applyScope in Snapshot - Take). Parameters: typeParameter - user specified object type as a search filter. applyScope - user specified snapshot apply scopes as a search filter. ApplyScope is an array of the target Azure subscription ids for the snapshot, specified by the user who created the snapshot by Snapshot - Take.

func (SnapshotClient) ListPreparer

func (client SnapshotClient) ListPreparer(ctx context.Context, typeParameter SnapshotObjectType, applyScope []uuid.UUID) (*http.Request, error)

ListPreparer prepares the List request.

func (SnapshotClient) ListResponder

func (client SnapshotClient) ListResponder(resp *http.Response) (result ListSnapshot, err error)

ListResponder handles the response to the List request. The method always closes the http.Response Body.

func (SnapshotClient) ListSender

func (client SnapshotClient) ListSender(req *http.Request) (*http.Response, error)

ListSender sends the List request. The method will close the http.Response Body if it receives an error.

func (SnapshotClient) Take

func (client SnapshotClient) Take(ctx context.Context, body TakeSnapshotRequest) (result autorest.Response, err error)

Take submit an operation to take a snapshot of face list, large face list, person group or large person group, with user-specified snapshot type, source object id, apply scope and an optional user data.<br /> The snapshot interfaces are for users to backup and restore their face data from one face subscription to another, inside same region or across regions. The workflow contains two phases, user first calls Snapshot - Take to create a copy of the source object and store it as a snapshot, then calls Snapshot - Apply to paste the snapshot to target subscription. The snapshots are stored in a centralized location (per Azure instance), so that they can be applied cross accounts and regions.<br /> Taking snapshot is an asynchronous operation. An operation id can be obtained from the "Operation-Location" field in response header, to be used in OperationStatus - Get for tracking the progress of creating the snapshot. The snapshot id will be included in the "resourceLocation" field in OperationStatus - Get response when the operation status is "succeeded".<br /> Snapshot taking time depends on the number of person and face entries in the source object. It could be in seconds, or up to several hours for 1,000,000 persons with multiple faces.<br /> Snapshots will be automatically expired and cleaned in 48 hours after it is created by Snapshot - Take. User can delete the snapshot using Snapshot - Delete by themselves any time before expiration.<br /> Taking snapshot for a certain object will not block any other operations against the object. All read-only operations (Get/List and Identify/FindSimilar/Verify) can be conducted as usual. For all writable operations, including Add/Update/Delete the source object or its persons/faces and Train, they are not blocked but not recommended because writable updates may not be reflected on the snapshot during its taking. After snapshot taking is completed, all readable and writable operations can work as normal. Snapshot will also include the training results of the source object, which means target subscription the snapshot applied to does not need re-train the target object before calling Identify/FindSimilar.<br /> * Free-tier subscription quota: 100 take operations per month. * S0-tier subscription quota: 100 take operations per day. Parameters: body - request body for taking a snapshot.

func (SnapshotClient) TakePreparer

func (client SnapshotClient) TakePreparer(ctx context.Context, body TakeSnapshotRequest) (*http.Request, error)

TakePreparer prepares the Take request.

func (SnapshotClient) TakeResponder

func (client SnapshotClient) TakeResponder(resp *http.Response) (result autorest.Response, err error)

TakeResponder handles the response to the Take request. The method always closes the http.Response Body.

func (SnapshotClient) TakeSender

func (client SnapshotClient) TakeSender(req *http.Request) (*http.Response, error)

TakeSender sends the Take request. The method will close the http.Response Body if it receives an error.

func (SnapshotClient) Update

func (client SnapshotClient) Update(ctx context.Context, snapshotID uuid.UUID, body UpdateSnapshotRequest) (result autorest.Response, err error)

Update update the information of a snapshot. Only the source subscription who took the snapshot can update the snapshot. Parameters: snapshotID - id referencing a particular snapshot. body - request body for updating a snapshot.

func (SnapshotClient) UpdatePreparer

func (client SnapshotClient) UpdatePreparer(ctx context.Context, snapshotID uuid.UUID, body UpdateSnapshotRequest) (*http.Request, error)

UpdatePreparer prepares the Update request.

func (SnapshotClient) UpdateResponder

func (client SnapshotClient) UpdateResponder(resp *http.Response) (result autorest.Response, err error)

UpdateResponder handles the response to the Update request. The method always closes the http.Response Body.

func (SnapshotClient) UpdateSender

func (client SnapshotClient) UpdateSender(req *http.Request) (*http.Response, error)

UpdateSender sends the Update request. The method will close the http.Response Body if it receives an error.

type SnapshotObjectType

type SnapshotObjectType string

SnapshotObjectType enumerates the values for snapshot object type.

const (
	// SnapshotObjectTypeFaceList ...
	SnapshotObjectTypeFaceList SnapshotObjectType = "FaceList"
	// SnapshotObjectTypeLargeFaceList ...
	SnapshotObjectTypeLargeFaceList SnapshotObjectType = "LargeFaceList"
	// SnapshotObjectTypeLargePersonGroup ...
	SnapshotObjectTypeLargePersonGroup SnapshotObjectType = "LargePersonGroup"
	// SnapshotObjectTypePersonGroup ...
	SnapshotObjectTypePersonGroup SnapshotObjectType = "PersonGroup"
)

func PossibleSnapshotObjectTypeValues

func PossibleSnapshotObjectTypeValues() []SnapshotObjectType

PossibleSnapshotObjectTypeValues returns an array of possible values for the SnapshotObjectType const type.

type TakeSnapshotRequest

type TakeSnapshotRequest struct {
	// Type - User specified type for the source object to take snapshot from. Currently FaceList, PersonGroup, LargeFaceList and LargePersonGroup are supported. Possible values include: 'SnapshotObjectTypeFaceList', 'SnapshotObjectTypeLargeFaceList', 'SnapshotObjectTypeLargePersonGroup', 'SnapshotObjectTypePersonGroup'
	Type SnapshotObjectType `json:"type,omitempty"`
	// ObjectID - User specified source object id to take snapshot from.
	ObjectID *string `json:"objectId,omitempty"`
	// ApplyScope - User specified array of target Face subscription ids for the snapshot. For each snapshot, only subscriptions included in the applyScope of Snapshot - Take can apply it.
	ApplyScope *[]uuid.UUID `json:"applyScope,omitempty"`
	// UserData - User specified data about the snapshot for any purpose. Length should not exceed 16KB.
	UserData *string `json:"userData,omitempty"`
}

TakeSnapshotRequest request body for taking snapshot operation.

type TrainingStatus

type TrainingStatus struct {
	autorest.Response `json:"-"`
	// Status - 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. Possible values include: 'TrainingStatusTypeNonstarted', 'TrainingStatusTypeRunning', 'TrainingStatusTypeSucceeded', 'TrainingStatusTypeFailed'
	Status TrainingStatusType `json:"status,omitempty"`
	// Created - A combined UTC date and time string that describes the created time of the person group, large person group or large face list.
	Created *date.Time `json:"createdDateTime,omitempty"`
	// LastAction - 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.
	LastAction *date.Time `json:"lastActionDateTime,omitempty"`
	// LastSuccessfulTraining - 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.
	LastSuccessfulTraining *date.Time `json:"lastSuccessfulTrainingDateTime,omitempty"`
	// Message - Show failure message when training failed (omitted when training succeed).
	Message *string `json:"message,omitempty"`
}

TrainingStatus training status object.

type TrainingStatusType

type TrainingStatusType string

TrainingStatusType enumerates the values for training status type.

const (
	// TrainingStatusTypeFailed ...
	TrainingStatusTypeFailed TrainingStatusType = "failed"
	// TrainingStatusTypeNonstarted ...
	TrainingStatusTypeNonstarted TrainingStatusType = "nonstarted"
	// TrainingStatusTypeRunning ...
	TrainingStatusTypeRunning TrainingStatusType = "running"
	// TrainingStatusTypeSucceeded ...
	TrainingStatusTypeSucceeded TrainingStatusType = "succeeded"
)

func PossibleTrainingStatusTypeValues

func PossibleTrainingStatusTypeValues() []TrainingStatusType

PossibleTrainingStatusTypeValues returns an array of possible values for the TrainingStatusType const type.

type UpdateFaceRequest

type UpdateFaceRequest struct {
	// UserData - User-provided data attached to the face. The size limit is 1KB.
	UserData *string `json:"userData,omitempty"`
}

UpdateFaceRequest request to update face data.

type UpdateSnapshotRequest

type UpdateSnapshotRequest struct {
	// ApplyScope - Array of the target Face subscription ids for the snapshot, specified by the user who created the snapshot when calling Snapshot - Take. For each snapshot, only subscriptions included in the applyScope of Snapshot - Take can apply it.
	ApplyScope *[]uuid.UUID `json:"applyScope,omitempty"`
	// UserData - User specified data about the snapshot for any purpose. Length should not exceed 16KB.
	UserData *string `json:"userData,omitempty"`
}

UpdateSnapshotRequest request body for updating a snapshot, with a combination of user defined apply scope and user specified data.

type VerifyFaceToFaceRequest

type VerifyFaceToFaceRequest struct {
	// FaceID1 - FaceId of the first face, comes from Face - Detect
	FaceID1 *uuid.UUID `json:"faceId1,omitempty"`
	// FaceID2 - FaceId of the second face, comes from Face - Detect
	FaceID2 *uuid.UUID `json:"faceId2,omitempty"`
}

VerifyFaceToFaceRequest request body for face to face verification.

type VerifyFaceToPersonRequest

type VerifyFaceToPersonRequest struct {
	// FaceID - FaceId of the face, comes from Face - Detect
	FaceID *uuid.UUID `json:"faceId,omitempty"`
	// PersonGroupID - Using existing personGroupId and personId for fast loading a specified person. personGroupId is created in PersonGroup - Create. Parameter personGroupId and largePersonGroupId should not be provided at the same time.
	PersonGroupID *string `json:"personGroupId,omitempty"`
	// LargePersonGroupID - Using existing largePersonGroupId and personId for fast loading a specified person. largePersonGroupId is created in LargePersonGroup - Create. Parameter personGroupId and largePersonGroupId should not be provided at the same time.
	LargePersonGroupID *string `json:"largePersonGroupId,omitempty"`
	// PersonID - Specify a certain person in a person group or a large person group. personId is created in PersonGroup Person - Create or LargePersonGroup Person - Create.
	PersonID *uuid.UUID `json:"personId,omitempty"`
}

VerifyFaceToPersonRequest request body for face to person verification.

type VerifyResult

type VerifyResult struct {
	autorest.Response `json:"-"`
	// IsIdentical - True if the two faces belong to the same person or the face belongs to the person, otherwise false.
	IsIdentical *bool `json:"isIdentical,omitempty"`
	// Confidence - A number indicates the similarity confidence of whether two faces belong to the same person, or whether the face belongs to the person. By default, isIdentical is set to True if similarity confidence is greater than or equal to 0.5. This is useful for advanced users to override "isIdentical" and fine-tune the result on their own data.
	Confidence *float64 `json:"confidence,omitempty"`
}

VerifyResult result of the verify operation.

Directories

Path Synopsis

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL