face

package
v12.4.0-beta+incompatible Latest Latest
Warning

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

Go to latest
Published: Feb 3, 2018 License: Apache-2.0 Imports: 7 Imported by: 0

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 AccessoryItem

type AccessoryItem struct {
	// Type - Description of an accessory
	Type       *string  `json:"type,omitempty"`
	Confidence *float64 `json:"confidence,omitempty"`
}

AccessoryItem accessory item and corresponding confidence level.

type AttributeTypes

type AttributeTypes string

AttributeTypes enumerates the values for attribute types.

const (
	// AttributeTypesAccessories ...
	AttributeTypesAccessories AttributeTypes = "accessories"
	// AttributeTypesAge ...
	AttributeTypesAge AttributeTypes = "age"
	// AttributeTypesBlur ...
	AttributeTypesBlur AttributeTypes = "blur"
	// AttributeTypesEmotion ...
	AttributeTypesEmotion AttributeTypes = "emotion"
	// AttributeTypesExposure ...
	AttributeTypesExposure AttributeTypes = "exposure"
	// AttributeTypesFacialHair ...
	AttributeTypesFacialHair AttributeTypes = "facialHair"
	// AttributeTypesGender ...
	AttributeTypesGender AttributeTypes = "gender"
	// AttributeTypesGlasses ...
	AttributeTypesGlasses AttributeTypes = "glasses"
	// AttributeTypesHair ...
	AttributeTypesHair AttributeTypes = "hair"
	// AttributeTypesHeadPose ...
	AttributeTypesHeadPose AttributeTypes = "headPose"
	// AttributeTypesMakeup ...
	AttributeTypesMakeup AttributeTypes = "makeup"
	// AttributeTypesNoise ...
	AttributeTypesNoise AttributeTypes = "noise"
	// AttributeTypesOcclusion ...
	AttributeTypesOcclusion AttributeTypes = "occlusion"
	// AttributeTypesSmile ...
	AttributeTypesSmile AttributeTypes = "smile"
)

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', 'Genderless'
	Gender Gender `json:"gender,omitempty"`
	// Smile - Smile intensity, a number between [0,1]
	Smile      *float64              `json:"smile,omitempty"`
	FacialHair *FacialHairProperties `json:"facialHair,omitempty"`
	// Glasses - Glasses type if any of the face. Possible values include: 'NoGlasses', 'ReadingGlasses', 'Sunglasses', 'SwimmingGoggles'
	Glasses     GlassesTypes         `json:"glasses,omitempty"`
	HeadPose    *HeadPoseProperties  `json:"headPose,omitempty"`
	Emotion     *EmotionProperties   `json:"emotion,omitempty"`
	Hair        *HairProperties      `json:"hair,omitempty"`
	Makeup      *MakeupProperties    `json:"makeup,omitempty"`
	Occlusion   *OcclusionProperties `json:"occlusion,omitempty"`
	Accessories *[]AccessoryItem     `json:"accessories,omitempty"`
	Blur        *BlurProperties      `json:"blur,omitempty"`
	Exposure    *ExposureProperties  `json:"exposure,omitempty"`
	Noise       *NoiseProperties     `json:"noise,omitempty"`
}

Attributes face Attributes

type AzureRegions

type AzureRegions string

AzureRegions enumerates the values for azure regions.

const (
	// Australiaeast ...
	Australiaeast AzureRegions = "australiaeast"
	// Brazilsouth ...
	Brazilsouth AzureRegions = "brazilsouth"
	// Eastasia ...
	Eastasia AzureRegions = "eastasia"
	// Eastus ...
	Eastus AzureRegions = "eastus"
	// Eastus2 ...
	Eastus2 AzureRegions = "eastus2"
	// Northeurope ...
	Northeurope AzureRegions = "northeurope"
	// Southcentralus ...
	Southcentralus AzureRegions = "southcentralus"
	// Southeastasia ...
	Southeastasia AzureRegions = "southeastasia"
	// Westcentralus ...
	Westcentralus AzureRegions = "westcentralus"
	// Westeurope ...
	Westeurope AzureRegions = "westeurope"
	// Westus ...
	Westus AzureRegions = "westus"
	// Westus2 ...
	Westus2 AzureRegions = "westus2"
)

type BaseClient

type BaseClient struct {
	autorest.Client
	AzureRegion AzureRegions
}

BaseClient is the base client for Face.

func New

func New(azureRegion AzureRegions) BaseClient

New creates an instance of the BaseClient client.

func NewWithoutDefaults

func NewWithoutDefaults(azureRegion AzureRegions) BaseClient

NewWithoutDefaults creates an instance of the BaseClient client.

type BlurLevels

type BlurLevels string

BlurLevels enumerates the values for blur levels.

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

type BlurProperties

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

BlurProperties properties describing any presence of blur within the image.

type Client

type Client struct {
	BaseClient
}

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

func NewClient

func NewClient(azureRegion AzureRegions) Client

NewClient creates an instance of the Client client.

func (Client) Detect

func (client Client) Detect(ctx context.Context, imageURL ImageURL, returnFaceID *bool, returnFaceLandmarks *bool, returnFaceAttributes []AttributeTypes) (result ListDetectedFace, err error)

Detect detect human faces in an image and returns face locations, and optionally with faceIds, landmarks, and attributes.

imageURL is a JSON document with a URL pointing to the image that is to be analyzed. returnFaceID is a value indicating whether the operation should return faceIds of detected faces. returnFaceLandmarks is a value indicating whether the operation should return landmarks of the detected faces. returnFaceAttributes is 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.

func (Client) DetectInStream

func (client Client) DetectInStream(ctx context.Context, imageParameter io.ReadCloser, returnFaceID *bool, returnFaceLandmarks *bool, returnFaceAttributes []AttributeTypes) (result ListDetectedFace, err error)

DetectInStream detect human faces in an image and returns face locations, and optionally with faceIds, landmarks, and attributes.

imageParameter is an image stream. imageParameter will be closed upon successful return. Callers should ensure closure when receiving an error.returnFaceID is a value indicating whether the operation should return faceIds of detected faces. returnFaceLandmarks is a value indicating whether the operation should return landmarks of the detected faces. returnFaceAttributes is 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.

func (Client) DetectInStreamPreparer

func (client Client) DetectInStreamPreparer(ctx context.Context, imageParameter io.ReadCloser, returnFaceID *bool, returnFaceLandmarks *bool, returnFaceAttributes []AttributeTypes) (*http.Request, error)

DetectInStreamPreparer prepares the DetectInStream request.

func (Client) DetectInStreamResponder

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

DetectInStreamResponder handles the response to the DetectInStream request. The method always closes the http.Response Body.

func (Client) DetectInStreamSender

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

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

func (Client) DetectPreparer

func (client Client) DetectPreparer(ctx context.Context, imageURL ImageURL, returnFaceID *bool, returnFaceLandmarks *bool, returnFaceAttributes []AttributeTypes) (*http.Request, error)

DetectPreparer prepares the Detect request.

func (Client) DetectResponder

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

DetectResponder handles the response to the Detect request. The method always closes the http.Response Body.

func (Client) DetectSender

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

DetectSender sends the Detect 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 ListSimilarFaceResult, err error)

FindSimilar given query face's faceId, find the similar-looking faces from a faceId array or a faceListId.

body is 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 ListSimilarFaceResult, 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 GroupResponse, err error)

Group divide candidate faces into groups based on face similarity.

body is 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 GroupResponse, 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 ListIdentifyResultItem, err error)

Identify identify unknown faces from a person group.

body is 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 ListIdentifyResultItem, 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) Verify

func (client Client) Verify(ctx context.Context, body VerifyRequest) (result VerifyResult, err error)

Verify verify whether two faces belong to a same person or whether one face belongs to a person.

body is request body for verify operation.

func (Client) VerifyPreparer

func (client Client) VerifyPreparer(ctx context.Context, body VerifyRequest) (*http.Request, error)

VerifyPreparer prepares the Verify request.

func (Client) VerifyResponder

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

VerifyResponder handles the response to the Verify request. The method always closes the http.Response Body.

func (Client) VerifySender

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

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

func (Client) VerifyWithPersonGroup

func (client Client) VerifyWithPersonGroup(ctx context.Context, body VerifyPersonGroupRequest) (result VerifyResult, err error)

VerifyWithPersonGroup verify whether two faces belong to a same person. Compares a face Id with a Person Id

body is request body for verifying two faces in a person group

func (Client) VerifyWithPersonGroupPreparer

func (client Client) VerifyWithPersonGroupPreparer(ctx context.Context, body VerifyPersonGroupRequest) (*http.Request, error)

VerifyWithPersonGroupPreparer prepares the VerifyWithPersonGroup request.

func (Client) VerifyWithPersonGroupResponder

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

VerifyWithPersonGroupResponder handles the response to the VerifyWithPersonGroup request. The method always closes the http.Response Body.

func (Client) VerifyWithPersonGroupSender

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

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

type ColorProperty

type ColorProperty struct {
	// Color - Name of the color.
	Color      *string  `json:"color,omitempty"`
	Confidence *float64 `json:"confidence,omitempty"`
}

ColorProperty hair color and associated confidence

type CreateFaceListRequest

type CreateFaceListRequest struct {
	// Name - Name of the face list, maximum length is 128.
	Name *string `json:"name,omitempty"`
	// UserData - Optional user defined data for the face list. Length should not exceed 16KB.
	UserData *string `json:"userData,omitempty"`
}

CreateFaceListRequest request to create a face list.

type CreatePersonGroupRequest

type CreatePersonGroupRequest struct {
	// Name - Person group display name. The maximum length is 128.
	Name *string `json:"name,omitempty"`
	// UserData - User-provided data attached to the person group. The size limit is 16KB.
	UserData *string `json:"userData,omitempty"`
}

CreatePersonGroupRequest request to create a person group.

type CreatePersonRequest

type CreatePersonRequest struct {
	// Name - Display name of the target person. The maximum length is 128.
	Name *string `json:"name,omitempty"`
	// UserData - Optional fields for user-provided data attached to a person. Size limit is 16KB.
	UserData *string `json:"userData,omitempty"`
}

CreatePersonRequest request to create a person object.

type CreatePersonResult

type CreatePersonResult struct {
	autorest.Response `json:"-"`
	// PersonID - personID of the new created person.
	PersonID *string `json:"personId,omitempty"`
}

CreatePersonResult result of creating person.

type DetectedFace

type DetectedFace struct {
	FaceID         *string     `json:"faceId,omitempty"`
	FaceRectangle  *Rectangle  `json:"faceRectangle,omitempty"`
	FaceLandmarks  *Landmarks  `json:"faceLandmarks,omitempty"`
	FaceAttributes *Attributes `json:"faceAttributes,omitempty"`
}

DetectedFace detected Face object.

type EmotionProperties

type EmotionProperties 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"`
}

EmotionProperties 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 ExposureLevels

type ExposureLevels string

ExposureLevels enumerates the values for exposure levels.

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

type ExposureProperties

type ExposureProperties struct {
	// ExposureLevel - An enum value indicating level of exposure. Possible values include: 'UnderExposure', 'GoodExposure', 'OverExposure'
	ExposureLevel ExposureLevels `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"`
}

ExposureProperties properties describing exposure level of the image.

type FacialHairProperties

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

FacialHairProperties properties describing facial hair attributes.

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 *string `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 and faceIds should not be provided at the same time
	FaceListID *string `json:"faceListId,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.
	FaceIds *[]string `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 MatchingMode `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"
	// Genderless ...
	Genderless Gender = "genderless"
	// Male ...
	Male Gender = "male"
)

type GetFaceListResult

type GetFaceListResult struct {
	autorest.Response `json:"-"`
	// FaceListID - faceListId of the target face list.
	FaceListID *string `json:"faceListId,omitempty"`
	// Name - Face list's display name, maximum length is 128.
	Name *string `json:"name,omitempty"`
	// UserData - User-provided data attached to this face list. Length should not exceed 16KB.
	UserData *string `json:"userData,omitempty"`
	// PersistedFaces - Persisted faces within the face list.
	PersistedFaces *[]PersonFaceResult `json:"persistedFaces,omitempty"`
}

GetFaceListResult result of the GetFaceList operation.

type GlassesTypes

type GlassesTypes string

GlassesTypes enumerates the values for glasses types.

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

type GroupRequest

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

GroupRequest request body for group request.

type GroupResponse

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

GroupResponse an array of face groups based on face similarity.

type HairProperties

type HairProperties 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 *[]ColorProperty `json:"hairColor,omitempty"`
}

HairProperties properties describing hair attributes.

type HeadPoseProperties

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

HeadPoseProperties properties indicating head pose of the face.

type IdentifyRequest

type IdentifyRequest struct {
	// PersonGroupID - personGroupId of the target person group, created by PersonGroups.Create
	PersonGroupID *string `json:"personGroupId,omitempty"`
	// FaceIds - Array of candidate faceId created by Face - Detect.
	FaceIds *[]string `json:"faceIds,omitempty"`
	// MaxNumOfCandidatesReturned - The number of top similar faces returned.
	MaxNumOfCandidatesReturned *int32   `json:"maxNumOfCandidatesReturned,omitempty"`
	ConfidenceThreshold        *float64 `json:"confidenceThreshold,omitempty"`
}

IdentifyRequest request body for identify face operation.

type IdentifyResultCandidate

type IdentifyResultCandidate struct {
	// PersonID - Id of candidate
	PersonID   *string  `json:"personId,omitempty"`
	Confidence *float64 `json:"confidence,omitempty"`
}

IdentifyResultCandidate all possible faces that may qualify.

type IdentifyResultItem

type IdentifyResultItem struct {
	// FaceID - faceId of the query face
	FaceID     *string                    `json:"faceId,omitempty"`
	Candidates *[]IdentifyResultCandidate `json:"candidates,omitempty"`
}

IdentifyResultItem response body for identify face operation.

type ImageURL

type ImageURL struct {
	URL *string `json:"url,omitempty"`
}

ImageURL ...

type Landmarks

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

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

type ListClient

type ListClient struct {
	BaseClient
}

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

func NewListClient

func NewListClient(azureRegion AzureRegions) ListClient

NewListClient creates an instance of the ListClient client.

func (ListClient) AddFace

func (client ListClient) AddFace(ctx context.Context, faceListID string, imageURL ImageURL, userData string, targetFace []int32) (result PersistedFaceResult, err error)

AddFace add a face to a face list. The input face is specified as an image with a targetFace rectangle. It returns a persistedFaceId representing the added face, and persistedFaceId will not expire.

faceListID is id referencing a Face List. imageURL is a JSON document with a URL pointing to the image that is to be analyzed. userData is user-specified data about the face list for any purpose. The maximum length is 1KB. targetFace is 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.

func (ListClient) AddFaceFromStream

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

AddFaceFromStream add a face to a face list. The input face is specified as an image with a targetFace rectangle. It returns a persistedFaceId representing the added face, and persistedFaceId will not expire.

faceListID is id referencing a Face List. imageParameter is an image stream. imageParameter will be closed upon successful return. Callers should ensure closure when receiving an error.userData is user-specified data about the face list for any purpose. The maximum length is 1KB. targetFace is 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.

func (ListClient) AddFaceFromStreamPreparer

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

AddFaceFromStreamPreparer prepares the AddFaceFromStream request.

func (ListClient) AddFaceFromStreamResponder

func (client ListClient) AddFaceFromStreamResponder(resp *http.Response) (result PersistedFaceResult, 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) AddFacePreparer

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

AddFacePreparer prepares the AddFace request.

func (ListClient) AddFaceResponder

func (client ListClient) AddFaceResponder(resp *http.Response) (result PersistedFaceResult, err error)

AddFaceResponder handles the response to the AddFace request. The method always closes the http.Response Body.

func (ListClient) AddFaceSender

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

AddFaceSender sends the AddFace 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 CreateFaceListRequest) (result autorest.Response, err error)

Create create an empty face list. Up to 64 face lists are allowed to exist in one subscription.

faceListID is id referencing a particular face list. body is request body for creating a face list.

func (ListClient) CreatePreparer

func (client ListClient) CreatePreparer(ctx context.Context, faceListID string, body CreateFaceListRequest) (*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 an existing face list according to faceListId. Persisted face images in the face list will also be deleted.

faceListID is id referencing a Face List.

func (ListClient) DeleteFace

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

DeleteFace delete an existing face from a face list (given by a persisitedFaceId and a faceListId). Persisted image related to the face will also be deleted.

faceListID is faceListId of an existing face list. persistedFaceID is persistedFaceId of an existing face.

func (ListClient) DeleteFacePreparer

func (client ListClient) DeleteFacePreparer(ctx context.Context, faceListID string, persistedFaceID string) (*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) (result GetFaceListResult, err error)

Get retrieve a face list's information.

faceListID is id referencing a Face List.

func (ListClient) GetPreparer

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

GetPreparer prepares the Get request.

func (ListClient) GetResponder

func (client ListClient) GetResponder(resp *http.Response) (result GetFaceListResult, 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) (result ListGetFaceListResult, err error)

List retrieve information about all existing face lists. Only faceListId, name and userData will be returned.

func (ListClient) ListPreparer

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

ListPreparer prepares the List request.

func (ListClient) ListResponder

func (client ListClient) ListResponder(resp *http.Response) (result ListGetFaceListResult, 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 CreateFaceListRequest) (result autorest.Response, err error)

Update update information of a face list.

faceListID is id referencing a Face List. body is request body for updating a face list.

func (ListClient) UpdatePreparer

func (client ListClient) UpdatePreparer(ctx context.Context, faceListID string, body CreateFaceListRequest) (*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 ListGetFaceListResult

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

ListGetFaceListResult ...

type ListIdentifyResultItem

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

ListIdentifyResultItem ...

type ListPersonGroupResult

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

ListPersonGroupResult ...

type ListPersonResult

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

ListPersonResult ...

type ListSimilarFaceResult

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

ListSimilarFaceResult ...

type MakeupProperties

type MakeupProperties 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"`
}

MakeupProperties properties describing present makeups on a given face.

type MatchingMode

type MatchingMode string

MatchingMode enumerates the values for matching mode.

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

type NoiseLevels

type NoiseLevels string

NoiseLevels enumerates the values for noise levels.

const (
	// NoiseLevelsHigh ...
	NoiseLevelsHigh NoiseLevels = "High"
	// NoiseLevelsLow ...
	NoiseLevelsLow NoiseLevels = "Low"
	// NoiseLevelsMedium ...
	NoiseLevelsMedium NoiseLevels = "Medium"
)

type NoiseProperties

type NoiseProperties struct {
	// NoiseLevel - An enum value indicating level of noise. Possible values include: 'NoiseLevelsLow', 'NoiseLevelsMedium', 'NoiseLevelsHigh'
	NoiseLevel NoiseLevels `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"`
}

NoiseProperties properties describing noise level of the image.

type OcclusionProperties

type OcclusionProperties 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"`
}

OcclusionProperties properties describing occulusions on a given face.

type PersistedFaceResult

type PersistedFaceResult struct {
	autorest.Response `json:"-"`
	// 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 *string `json:"persistedFaceId,omitempty"`
}

PersistedFaceResult persisted face result.

type PersonClient

type PersonClient struct {
	BaseClient
}

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

func NewPersonClient

func NewPersonClient(azureRegion AzureRegions) PersonClient

NewPersonClient creates an instance of the PersonClient client.

func (PersonClient) AddPersonFace

func (client PersonClient) AddPersonFace(ctx context.Context, personGroupID string, personID string, imageURL ImageURL, userData string, targetFace []int32) (result PersistedFaceResult, err error)

AddPersonFace add a representative face to a person for identification. The input face is specified as an image with a targetFace rectangle.

personGroupID is specifying the person group containing the target person. personID is target person that the face is added to. imageURL is a JSON document with a URL pointing to the image that is to be analyzed. userData is user-specified data about the target face to add for any purpose. The maximum length is 1KB. targetFace is 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.

func (PersonClient) AddPersonFaceFromStream

func (client PersonClient) AddPersonFaceFromStream(ctx context.Context, personGroupID string, personID string, imageParameter io.ReadCloser, userData string, targetFace []int32) (result PersistedFaceResult, err error)

AddPersonFaceFromStream add a representative face to a person for identification. The input face is specified as an image with a targetFace rectangle.

personGroupID is specifying the person group containing the target person. personID is target person that the face is added to. imageParameter is an image stream. imageParameter will be closed upon successful return. Callers should ensure closure when receiving an error.userData is user-specified data about the target face to add for any purpose. The maximum length is 1KB. targetFace is 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.

func (PersonClient) AddPersonFaceFromStreamPreparer

func (client PersonClient) AddPersonFaceFromStreamPreparer(ctx context.Context, personGroupID string, personID string, imageParameter io.ReadCloser, userData string, targetFace []int32) (*http.Request, error)

AddPersonFaceFromStreamPreparer prepares the AddPersonFaceFromStream request.

func (PersonClient) AddPersonFaceFromStreamResponder

func (client PersonClient) AddPersonFaceFromStreamResponder(resp *http.Response) (result PersistedFaceResult, err error)

AddPersonFaceFromStreamResponder handles the response to the AddPersonFaceFromStream request. The method always closes the http.Response Body.

func (PersonClient) AddPersonFaceFromStreamSender

func (client PersonClient) AddPersonFaceFromStreamSender(req *http.Request) (*http.Response, error)

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

func (PersonClient) AddPersonFacePreparer

func (client PersonClient) AddPersonFacePreparer(ctx context.Context, personGroupID string, personID string, imageURL ImageURL, userData string, targetFace []int32) (*http.Request, error)

AddPersonFacePreparer prepares the AddPersonFace request.

func (PersonClient) AddPersonFaceResponder

func (client PersonClient) AddPersonFaceResponder(resp *http.Response) (result PersistedFaceResult, err error)

AddPersonFaceResponder handles the response to the AddPersonFace request. The method always closes the http.Response Body.

func (PersonClient) AddPersonFaceSender

func (client PersonClient) AddPersonFaceSender(req *http.Request) (*http.Response, error)

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

func (PersonClient) Create

func (client PersonClient) Create(ctx context.Context, personGroupID string, body CreatePersonRequest) (result CreatePersonResult, err error)

Create create a new person in a specified person group.

personGroupID is specifying the target person group to create the person. body is request body for creating new person.

func (PersonClient) CreatePreparer

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

CreatePreparer prepares the Create request.

func (PersonClient) CreateResponder

func (client PersonClient) CreateResponder(resp *http.Response) (result CreatePersonResult, err error)

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

func (PersonClient) CreateSender

func (client PersonClient) 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 (PersonClient) Delete

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

Delete delete an existing person from a person group. Persisted face images of the person will also be deleted.

personGroupID is specifying the person group containing the person. personID is the target personId to delete.

func (PersonClient) DeleteFace

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

DeleteFace delete a face from a person. Relative image for the persisted face will also be deleted.

personGroupID is specifying the person group containing the target person. personID is specifying the person that the target persisted face belong to. persistedFaceID is the persisted face to remove.

func (PersonClient) DeleteFacePreparer

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

DeleteFacePreparer prepares the DeleteFace request.

func (PersonClient) DeleteFaceResponder

func (client PersonClient) 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 (PersonClient) DeleteFaceSender

func (client PersonClient) 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 (PersonClient) DeletePreparer

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

DeletePreparer prepares the Delete request.

func (PersonClient) DeleteResponder

func (client PersonClient) 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 (PersonClient) DeleteSender

func (client PersonClient) 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 (PersonClient) Get

func (client PersonClient) Get(ctx context.Context, personGroupID string, personID string) (result PersonResult, err error)

Get retrieve a person's information, including registered persisted faces, name and userData.

personGroupID is specifying the person group containing the target person. personID is specifying the target person.

func (PersonClient) GetFace

func (client PersonClient) GetFace(ctx context.Context, personGroupID string, personID string, persistedFaceID string) (result PersonFaceResult, err error)

GetFace retrieve information about a persisted face (specified by persistedFaceId, personId and its belonging personGroupId).

personGroupID is specifying the person group containing the target person. personID is specifying the target person that the face belongs to. persistedFaceID is the persistedFaceId of the target persisted face of the person.

func (PersonClient) GetFacePreparer

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

GetFacePreparer prepares the GetFace request.

func (PersonClient) GetFaceResponder

func (client PersonClient) GetFaceResponder(resp *http.Response) (result PersonFaceResult, err error)

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

func (PersonClient) GetFaceSender

func (client PersonClient) 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 (PersonClient) GetPreparer

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

GetPreparer prepares the Get request.

func (PersonClient) GetResponder

func (client PersonClient) GetResponder(resp *http.Response) (result PersonResult, err error)

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

func (PersonClient) GetSender

func (client PersonClient) 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 (PersonClient) List

func (client PersonClient) List(ctx context.Context, personGroupID string, start string, top *int32) (result ListPersonResult, 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).

personGroupID is personGroupId of the target person group. start is starting person id to return (used to list a range of persons). top is number of persons to return starting with the person id indicated by the 'start' parameter.

func (PersonClient) ListPreparer

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

ListPreparer prepares the List request.

func (PersonClient) ListResponder

func (client PersonClient) ListResponder(resp *http.Response) (result ListPersonResult, err error)

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

func (PersonClient) ListSender

func (client PersonClient) 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 (PersonClient) Update

func (client PersonClient) Update(ctx context.Context, personGroupID string, personID string, body CreatePersonRequest) (result autorest.Response, err error)

Update update name or userData of a person.

personGroupID is specifying the person group containing the target person. personID is personId of the target person. body is request body for person update operation.

func (PersonClient) UpdateFace

func (client PersonClient) UpdateFace(ctx context.Context, personGroupID string, personID string, persistedFaceID string, body UpdatePersonFaceDataRequest) (result autorest.Response, err error)

UpdateFace update a person persisted face's userData field.

personGroupID is specifying the person group containing the target person. personID is personId of the target person. persistedFaceID is persistedFaceId of target face, which is persisted and will not expire. body is request body for updating persisted face.

func (PersonClient) UpdateFacePreparer

func (client PersonClient) UpdateFacePreparer(ctx context.Context, personGroupID string, personID string, persistedFaceID string, body UpdatePersonFaceDataRequest) (*http.Request, error)

UpdateFacePreparer prepares the UpdateFace request.

func (PersonClient) UpdateFaceResponder

func (client PersonClient) 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 (PersonClient) UpdateFaceSender

func (client PersonClient) 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 (PersonClient) UpdatePreparer

func (client PersonClient) UpdatePreparer(ctx context.Context, personGroupID string, personID string, body CreatePersonRequest) (*http.Request, error)

UpdatePreparer prepares the Update request.

func (PersonClient) UpdateResponder

func (client PersonClient) 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 (PersonClient) UpdateSender

func (client PersonClient) 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 PersonFaceResult

type PersonFaceResult 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 *string `json:"persistedFaceId,omitempty"`
	// UserData - User-provided data attached to the face. The size limit is 1KB.
	UserData *string `json:"userData,omitempty"`
}

PersonFaceResult personFace object.

type PersonGroupClient

type PersonGroupClient struct {
	BaseClient
}

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

func NewPersonGroupClient

func NewPersonGroupClient(azureRegion AzureRegions) PersonGroupClient

NewPersonGroupClient creates an instance of the PersonGroupClient client.

func (PersonGroupClient) Create

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

Create create a new person group with specified personGroupId, name and user-provided userData.

personGroupID is user-provided personGroupId as a string. body is request body for creating new person group.

func (PersonGroupClient) CreatePreparer

func (client PersonGroupClient) CreatePreparer(ctx context.Context, personGroupID string, body CreatePersonGroupRequest) (*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 images of all people in the person group will also be deleted.

personGroupID is the personGroupId of the person group to be deleted.

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) (result PersonGroupResult, err error)

Get retrieve the information of a person group, including its name and userData.

personGroupID is personGroupId of the target person group.

func (PersonGroupClient) GetPreparer

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

GetPreparer prepares the Get request.

func (PersonGroupClient) GetResponder

func (client PersonGroupClient) GetResponder(resp *http.Response) (result PersonGroupResult, 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).

personGroupID is personGroupId of target 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) (result ListPersonGroupResult, err error)

List list person groups and their information.

start is list person groups from the least personGroupId greater than the "start". top is the number of person groups to list.

func (PersonGroupClient) ListPreparer

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

ListPreparer prepares the List request.

func (PersonGroupClient) ListResponder

func (client PersonGroupClient) ListResponder(resp *http.Response) (result ListPersonGroupResult, 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.

personGroupID is target person group to be trained.

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 CreatePersonGroupRequest) (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.

personGroupID is personGroupId of the person group to be updated. body is request body for updating person group.

func (PersonGroupClient) UpdatePreparer

func (client PersonGroupClient) UpdatePreparer(ctx context.Context, personGroupID string, body CreatePersonGroupRequest) (*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 PersonGroupResult

type PersonGroupResult struct {
	autorest.Response `json:"-"`
	// PersonGroupID - personGroupId of the existing person groups.
	PersonGroupID *string `json:"personGroupId,omitempty"`
	// Name - Person group's display name, maximum length is 128.
	Name *string `json:"name,omitempty"`
	// UserData - User-provided data attached to this person group. Length should not exceed 16KB.
	UserData *string `json:"userData,omitempty"`
}

PersonGroupResult person group object.

type PersonResult

type PersonResult struct {
	autorest.Response `json:"-"`
	// PersonID - personId of the target face list.
	PersonID *string `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 *[]string `json:"persistedFaceIds,omitempty"`
	// Name - Person's display name, maximum length is 128.
	Name *string `json:"name,omitempty"`
	// UserData - User-provided data attached to this person. Length should not exceed 16KB.
	UserData *string `json:"userData,omitempty"`
}

PersonResult person object.

type Position

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

Position coordinates within an image

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 SimilarFaceResult

type SimilarFaceResult 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 *string `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 *string  `json:"persistedFaceId,omitempty"`
	Confidence      *float64 `json:"confidence,omitempty"`
}

SimilarFaceResult response body for find similar face 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 is ready for Face - Identify. Status failed is often caused by no person or no persisted face exist in the person group. Possible values include: 'Nonstarted', 'Running', 'Succeeded', 'Failed'
	Status TrainingStatusType `json:"status,omitempty"`
	// Created - A combined UTC date and time string that describes person group created time.
	Created *date.Time `json:"createdDateTime,omitempty"`
	// LastAction - Person group last modify time in the UTC, could be null value when the person group is not successfully trained.
	LastAction *date.Time `json:"lastActionDateTime,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 (
	// Failed ...
	Failed TrainingStatusType = "failed"
	// Nonstarted ...
	Nonstarted TrainingStatusType = "nonstarted"
	// Running ...
	Running TrainingStatusType = "running"
	// Succeeded ...
	Succeeded TrainingStatusType = "succeeded"
)

type UpdatePersonFaceDataRequest

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

UpdatePersonFaceDataRequest request to update person face data.

type VerifyPersonGroupRequest

type VerifyPersonGroupRequest struct {
	// FaceID - faceId the face, comes from Face - Detect
	FaceID *string `json:"faceId,omitempty"`
	// PersonID - Specify a certain person in a person group. personId is created in Persons.Create.
	PersonID *string `json:"personId,omitempty"`
	// PersonGroupID - Using existing personGroupId and personId for fast loading a specified person. personGroupId is created in Person Groups.Create.
	PersonGroupID *string `json:"personGroupId,omitempty"`
}

VerifyPersonGroupRequest request body for verify operation.

type VerifyRequest

type VerifyRequest struct {
	// FaceID1 - faceId of the first face, comes from Face - Detect
	FaceID1 *string `json:"faceId1,omitempty"`
	// FaceID2 - faceId of the second face, comes from Face - Detect
	FaceID2 *string `json:"faceId2,omitempty"`
}

VerifyRequest request body for verify operation.

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  *float64 `json:"confidence,omitempty"`
}

VerifyResult result of the verify operation.

Jump to

Keyboard shortcuts

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