face

package
v11.1.1-beta+incompatible Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2017 License: Apache-2.0 Imports: 6 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 is error information returned by the API

type Attributes

type Attributes struct {
	Age        *float64              `json:"age,omitempty"`
	Gender     Gender                `json:"gender,omitempty"`
	Smile      *float64              `json:"smile,omitempty"`
	Glasses    Glasses               `json:"glasses,omitempty"`
	FacialHair *FacialHairProperties `json:"facialHair,omitempty"`
	HeadPose   *HeadPoseProperties   `json:"headPose,omitempty"`
	Emotion    *EmotionProperties    `json:"emotion,omitempty"`
}

Attributes is face Attributes

type AzureRegions

type AzureRegions string

AzureRegions enumerates the values for azure regions.

const (
	// Eastus2 specifies the eastus 2 state for azure regions.
	Eastus2 AzureRegions = "eastus2"
	// Southeastasia specifies the southeastasia state for azure regions.
	Southeastasia AzureRegions = "southeastasia"
	// Westcentralus specifies the westcentralus state for azure regions.
	Westcentralus AzureRegions = "westcentralus"
	// Westeurope specifies the westeurope state for azure regions.
	Westeurope AzureRegions = "westeurope"
	// Westus specifies the westus state for azure regions.
	Westus AzureRegions = "westus"
)

type CreateFaceListRequest

type CreateFaceListRequest struct {
	Name     *string `json:"name,omitempty"`
	UserData *string `json:"userData,omitempty"`
}

CreateFaceListRequest is request to create a face list.

type CreatePersonGroupRequest

type CreatePersonGroupRequest struct {
	Name     *string `json:"name,omitempty"`
	UserData *string `json:"userData,omitempty"`
}

CreatePersonGroupRequest is request to create a person group.

type CreatePersonRequest

type CreatePersonRequest struct {
	Name     *string `json:"name,omitempty"`
	UserData *string `json:"userData,omitempty"`
}

CreatePersonRequest is request to create a person object.

type CreatePersonResult

type CreatePersonResult struct {
	autorest.Response `json:"-"`
	PersonID          *string `json:"personId,omitempty"`
}

CreatePersonResult is result of creating person.

type DetectedFace

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

DetectedFace is 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 is properties describing facial emotion.

type Error

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

Error is error body.

type FacialHairProperties

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

FacialHairProperties is properties describing facial hair attributes.

type FindSimilarRequest

type FindSimilarRequest struct {
	FaceID                     *string   `json:"faceId,omitempty"`
	FaceListID                 *string   `json:"faceListId,omitempty"`
	FaceIds                    *[]string `json:"faceIds,omitempty"`
	MaxNumOfCandidatesReturned *int32    `json:"maxNumOfCandidatesReturned,omitempty"`
	Mode                       Mode      `json:"mode,omitempty"`
}

FindSimilarRequest is request body for find similar operation.

type Gender

type Gender string

Gender enumerates the values for gender.

const (
	// Female specifies the female state for gender.
	Female Gender = "female"
	// Male specifies the male state for gender.
	Male Gender = "male"
)

type GetFaceListResult

type GetFaceListResult struct {
	autorest.Response `json:"-"`
	FaceListID        *string `json:"faceListId,omitempty"`
	Name              *string `json:"name,omitempty"`
	UserData          *string `json:"userData,omitempty"`
}

GetFaceListResult is result of the GetFaceList operation.

type Glasses

type Glasses string

Glasses enumerates the values for glasses.

const (
	// NoGlasses specifies the no glasses state for glasses.
	NoGlasses Glasses = "noGlasses"
	// ReadingGlasses specifies the reading glasses state for glasses.
	ReadingGlasses Glasses = "readingGlasses"
	// Sunglasses specifies the sunglasses state for glasses.
	Sunglasses Glasses = "sunglasses"
	// SwimmingGoggles specifies the swimming goggles state for glasses.
	SwimmingGoggles Glasses = "swimmingGoggles"
)

type GroupClient

type GroupClient struct {
	ManagementClient
}

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

func NewGroupClient

func NewGroupClient(subscriptionKey string, azureRegion AzureRegions) GroupClient

NewGroupClient creates an instance of the GroupClient client.

func (GroupClient) Detect

func (client GroupClient) Detect(imageURL ImageURL, returnFaceID *bool, returnFaceLandmarks *bool, returnFaceAttributes string) (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 (GroupClient) DetectInStream

func (client GroupClient) DetectInStream(imageParameter io.ReadCloser, returnFaceID *bool, returnFaceLandmarks *bool, returnFaceAttributes string) (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 (GroupClient) DetectInStreamPreparer

func (client GroupClient) DetectInStreamPreparer(imageParameter io.ReadCloser, returnFaceID *bool, returnFaceLandmarks *bool, returnFaceAttributes string) (*http.Request, error)

DetectInStreamPreparer prepares the DetectInStream request.

func (GroupClient) DetectInStreamResponder

func (client GroupClient) 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 (GroupClient) DetectInStreamSender

func (client GroupClient) 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 (GroupClient) DetectPreparer

func (client GroupClient) DetectPreparer(imageURL ImageURL, returnFaceID *bool, returnFaceLandmarks *bool, returnFaceAttributes string) (*http.Request, error)

DetectPreparer prepares the Detect request.

func (GroupClient) DetectResponder

func (client GroupClient) 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 (GroupClient) DetectSender

func (client GroupClient) 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 (GroupClient) FindSimilar

func (client GroupClient) FindSimilar(body FindSimilarRequest) (result ListSimilarFaceResult, err error)

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

func (GroupClient) FindSimilarPreparer

func (client GroupClient) FindSimilarPreparer(body FindSimilarRequest) (*http.Request, error)

FindSimilarPreparer prepares the FindSimilar request.

func (GroupClient) FindSimilarResponder

func (client GroupClient) 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 (GroupClient) FindSimilarSender

func (client GroupClient) 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 (GroupClient) Group

func (client GroupClient) Group(body GroupRequest) (result GroupResponse, err error)

Group divide candidate faces into groups based on face similarity.

func (GroupClient) GroupPreparer

func (client GroupClient) GroupPreparer(body GroupRequest) (*http.Request, error)

GroupPreparer prepares the Group request.

func (GroupClient) GroupResponder

func (client GroupClient) 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 (GroupClient) GroupSender

func (client GroupClient) 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 (GroupClient) Identify

func (client GroupClient) Identify(body IdentifyRequest) (result ListIdentifyResultItem, err error)

Identify identify unknown faces from a person group.

func (GroupClient) IdentifyPreparer

func (client GroupClient) IdentifyPreparer(body IdentifyRequest) (*http.Request, error)

IdentifyPreparer prepares the Identify request.

func (GroupClient) IdentifyResponder

func (client GroupClient) 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 (GroupClient) IdentifySender

func (client GroupClient) 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 (GroupClient) Verify

func (client GroupClient) Verify(body VerifyRequest) (result VerifyResult, err error)

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

func (GroupClient) VerifyPreparer

func (client GroupClient) VerifyPreparer(body VerifyRequest) (*http.Request, error)

VerifyPreparer prepares the Verify request.

func (GroupClient) VerifyResponder

func (client GroupClient) 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 (GroupClient) VerifySender

func (client GroupClient) 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.

type GroupRequest

type GroupRequest struct {
	FaceIds *[]string `json:"faceIds,omitempty"`
}

GroupRequest is request body for group request.

type GroupResponse

type GroupResponse struct {
	autorest.Response `json:"-"`
	Groups            *[][]string `json:"groups,omitempty"`
	MessyGroup        *[]string   `json:"messyGroup,omitempty"`
}

GroupResponse is an array of face groups based on face similarity.

type HeadPoseProperties

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

HeadPoseProperties is properties indicating head pose of the face.

type IdentifyRequest

type IdentifyRequest struct {
	PersonGroupID              *string   `json:"personGroupId,omitempty"`
	FaceIds                    *[]string `json:"faceIds,omitempty"`
	MaxNumOfCandidatesReturned *int32    `json:"maxNumOfCandidatesReturned,omitempty"`
	ConfidenceThreshold        *float64  `json:"confidenceThreshold,omitempty"`
}

IdentifyRequest is request body for identify face operation.

type IdentifyResultCandidate

type IdentifyResultCandidate struct {
	PersonID   *string  `json:"personId,omitempty"`
	Confidence *float64 `json:"confidence,omitempty"`
}

IdentifyResultCandidate is all possible faces that may qualify.

type IdentifyResultItem

type IdentifyResultItem struct {
	FaceID     *string                    `json:"faceId,omitempty"`
	Candidates *[]IdentifyResultCandidate `json:"candidates,omitempty"`
}

IdentifyResultItem is response body for identify face operation.

type ImageURL

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

ImageURL is

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 is a collection of 27-point face landmarks pointing to the important positions of face components.

type ListDetectedFace

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

ListDetectedFace is

type ListGetFaceListResult

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

ListGetFaceListResult is

type ListGroupClient

type ListGroupClient struct {
	ManagementClient
}

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

func NewListGroupClient

func NewListGroupClient(subscriptionKey string, azureRegion AzureRegions) ListGroupClient

NewListGroupClient creates an instance of the ListGroupClient client.

func (ListGroupClient) AddFace

func (client ListGroupClient) AddFace(faceListID string, userData string, targetFace string) (result autorest.Response, 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. 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 into the face list, 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 (ListGroupClient) AddFaceFromStream

func (client ListGroupClient) AddFaceFromStream(faceListID string, userData string, targetFace string) (result autorest.Response, 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. 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 into the face list, 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 (ListGroupClient) AddFaceFromStreamPreparer

func (client ListGroupClient) AddFaceFromStreamPreparer(faceListID string, userData string, targetFace string) (*http.Request, error)

AddFaceFromStreamPreparer prepares the AddFaceFromStream request.

func (ListGroupClient) AddFaceFromStreamResponder

func (client ListGroupClient) AddFaceFromStreamResponder(resp *http.Response) (result autorest.Response, err error)

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

func (ListGroupClient) AddFaceFromStreamSender

func (client ListGroupClient) 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 (ListGroupClient) AddFacePreparer

func (client ListGroupClient) AddFacePreparer(faceListID string, userData string, targetFace string) (*http.Request, error)

AddFacePreparer prepares the AddFace request.

func (ListGroupClient) AddFaceResponder

func (client ListGroupClient) AddFaceResponder(resp *http.Response) (result autorest.Response, err error)

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

func (ListGroupClient) AddFaceSender

func (client ListGroupClient) 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 (ListGroupClient) Create

func (client ListGroupClient) Create(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.

func (ListGroupClient) CreatePreparer

func (client ListGroupClient) CreatePreparer(faceListID string, body CreateFaceListRequest) (*http.Request, error)

CreatePreparer prepares the Create request.

func (ListGroupClient) CreateResponder

func (client ListGroupClient) 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 (ListGroupClient) CreateSender

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

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

func (client ListGroupClient) DeleteFace(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 (ListGroupClient) DeleteFacePreparer

func (client ListGroupClient) DeleteFacePreparer(faceListID string, persistedFaceID string) (*http.Request, error)

DeleteFacePreparer prepares the DeleteFace request.

func (ListGroupClient) DeleteFaceResponder

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

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

func (client ListGroupClient) DeletePreparer(faceListID string) (*http.Request, error)

DeletePreparer prepares the Delete request.

func (ListGroupClient) DeleteResponder

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

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

func (client ListGroupClient) Get(faceListID string) (result GetFaceListResult, err error)

Get retrieve a face list's information.

faceListID is id referencing a Face List.

func (ListGroupClient) GetPreparer

func (client ListGroupClient) GetPreparer(faceListID string) (*http.Request, error)

GetPreparer prepares the Get request.

func (ListGroupClient) GetResponder

func (client ListGroupClient) 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 (ListGroupClient) GetSender

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

func (client ListGroupClient) List() (result ListGetFaceListResult, err error)

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

func (ListGroupClient) ListPreparer

func (client ListGroupClient) ListPreparer() (*http.Request, error)

ListPreparer prepares the List request.

func (ListGroupClient) ListResponder

func (client ListGroupClient) 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 (ListGroupClient) ListSender

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

func (client ListGroupClient) Update(faceListID string, body CreateFaceListRequest) (result autorest.Response, err error)

Update update information of a face list.

faceListID is id referencing a Face List.

func (ListGroupClient) UpdatePreparer

func (client ListGroupClient) UpdatePreparer(faceListID string, body CreateFaceListRequest) (*http.Request, error)

UpdatePreparer prepares the Update request.

func (ListGroupClient) UpdateResponder

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

func (client ListGroupClient) 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 ListIdentifyResultItem

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

ListIdentifyResultItem is

type ListPersonGroupResult

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

ListPersonGroupResult is

type ListPersonResult

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

ListPersonResult is

type ListSimilarFaceResult

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

ListSimilarFaceResult is

type ManagementClient

type ManagementClient struct {
	autorest.Client
	SubscriptionKey string
	AzureRegion     AzureRegions
}

ManagementClient is the base client for Face.

func New

func New(subscriptionKey string, azureRegion AzureRegions) ManagementClient

New creates an instance of the ManagementClient client.

func NewWithoutDefaults

func NewWithoutDefaults(subscriptionKey string, azureRegion AzureRegions) ManagementClient

NewWithoutDefaults creates an instance of the ManagementClient client.

type Mode

type Mode string

Mode enumerates the values for mode.

const (
	// MatchFace specifies the match face state for mode.
	MatchFace Mode = "matchFace"
	// MatchPerson specifies the match person state for mode.
	MatchPerson Mode = "matchPerson"
)

type PersonClient

type PersonClient struct {
	ManagementClient
}

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

func NewPersonClient

func NewPersonClient(subscriptionKey string, azureRegion AzureRegions) PersonClient

NewPersonClient creates an instance of the PersonClient client.

func (PersonClient) AddFace

func (client PersonClient) AddFace(personGroupID string, personID string, userData string, targetFace string) (result autorest.Response, err error)

AddFace 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. 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) AddFaceFromStream

func (client PersonClient) AddFaceFromStream(personGroupID string, personID string, userData string, targetFace string) (result autorest.Response, err error)

AddFaceFromStream 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. 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) AddFaceFromStreamPreparer

func (client PersonClient) AddFaceFromStreamPreparer(personGroupID string, personID string, userData string, targetFace string) (*http.Request, error)

AddFaceFromStreamPreparer prepares the AddFaceFromStream request.

func (PersonClient) AddFaceFromStreamResponder

func (client PersonClient) AddFaceFromStreamResponder(resp *http.Response) (result autorest.Response, err error)

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

func (PersonClient) AddFaceFromStreamSender

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

func (client PersonClient) AddFacePreparer(personGroupID string, personID string, userData string, targetFace string) (*http.Request, error)

AddFacePreparer prepares the AddFace request.

func (PersonClient) AddFaceResponder

func (client PersonClient) AddFaceResponder(resp *http.Response) (result autorest.Response, err error)

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

func (PersonClient) AddFaceSender

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

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

func (PersonClient) CreatePreparer

func (client PersonClient) CreatePreparer(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(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(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(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(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(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(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(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(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(personGroupID string) (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.

func (PersonClient) ListPreparer

func (client PersonClient) ListPreparer(personGroupID string) (*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(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.

func (PersonClient) UpdateFace

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

func (PersonClient) UpdateFacePreparer

func (client PersonClient) UpdateFacePreparer(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(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   *string `json:"persistedFaceId,omitempty"`
	UserData          *string `json:"userData,omitempty"`
}

PersonFaceResult is personFace object.

type PersonGroupClient

type PersonGroupClient struct {
	ManagementClient
}

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

func NewPersonGroupClient

func NewPersonGroupClient(subscriptionKey string, azureRegion AzureRegions) PersonGroupClient

NewPersonGroupClient creates an instance of the PersonGroupClient client.

func (PersonGroupClient) Create

func (client PersonGroupClient) Create(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.

func (PersonGroupClient) CreatePreparer

func (client PersonGroupClient) CreatePreparer(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(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(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(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(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(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(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(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(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(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(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(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.

func (PersonGroupClient) UpdatePreparer

func (client PersonGroupClient) UpdatePreparer(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     *string `json:"personGroupId,omitempty"`
	Name              *string `json:"name,omitempty"`
	UserData          *string `json:"userData,omitempty"`
}

PersonGroupResult is person group object.

type PersonResult

type PersonResult struct {
	autorest.Response `json:"-"`
	PersonID          *string   `json:"personId,omitempty"`
	PersistedFaceIds  *[]string `json:"persistedFaceIds,omitempty"`
	Name              *string   `json:"name,omitempty"`
	UserData          *string   `json:"userData,omitempty"`
}

PersonResult is person object.

type Position

type Position struct {
	X *int32 `json:"x,omitempty"`
	Y *int32 `json:"y,omitempty"`
}

Position is coordinates within an image

type Rectangle

type Rectangle struct {
	Width  *int32 `json:"width,omitempty"`
	Height *int32 `json:"height,omitempty"`
	Left   *int32 `json:"left,omitempty"`
	Top    *int32 `json:"top,omitempty"`
}

Rectangle is a rectangle within which a face can be found

type SimilarFaceResult

type SimilarFaceResult struct {
	FaceID          *string  `json:"faceId,omitempty"`
	PersistedFaceID *string  `json:"persistedFaceId,omitempty"`
	Confidence      *float64 `json:"confidence,omitempty"`
}

SimilarFaceResult is response body for find similar face operation.

type Status

type Status string

Status enumerates the values for status.

const (
	// Failed specifies the failed state for status.
	Failed Status = "failed"
	// Nonstarted specifies the nonstarted state for status.
	Nonstarted Status = "nonstarted"
	// Running specifies the running state for status.
	Running Status = "running"
	// Succeeded specifies the succeeded state for status.
	Succeeded Status = "succeeded"
)

type TrainingStatus

type TrainingStatus struct {
	autorest.Response `json:"-"`
	Status            Status     `json:"status,omitempty"`
	Created           *date.Time `json:"createdDateTime,omitempty"`
	LastAction        *date.Time `json:"lastActionDateTime,omitempty"`
	Message           *string    `json:"message,omitempty"`
}

TrainingStatus is training status object.

type UpdatePersonFaceDataRequest

type UpdatePersonFaceDataRequest struct {
	UserData *string `json:"userData,omitempty"`
}

UpdatePersonFaceDataRequest is request to update person face data.

type VerifyRequest

type VerifyRequest struct {
	FaceID        *string `json:"faceId,omitempty"`
	PersonID      *string `json:"personId,omitempty"`
	PersonGroupID *string `json:"personGroupId,omitempty"`
}

VerifyRequest is request body for verify operation.

type VerifyResult

type VerifyResult struct {
	autorest.Response `json:"-"`
	IsIdentical       *bool    `json:"isIdentical,omitempty"`
	Confidence        *float64 `json:"confidence,omitempty"`
}

VerifyResult is result of the verify operation.

Jump to

Keyboard shortcuts

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