face

package
v0.0.0-...-52824e0 Latest Latest
Warning

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

Go to latest
Published: Oct 10, 2016 License: MIT Imports: 6 Imported by: 0

Documentation

Index

Constants

View Source
const (
	URL string = "https://api.projectoxford.ai/face/v1.0"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type DetectOrder

type DetectOrder struct {
	FaceID         bool
	FaceLandmarks  bool
	FaceAttributes FaceAttributesOrder
}

func (DetectOrder) String

func (order DetectOrder) String() string

type Error

type Error struct {
	Code    string `json:"statusCode"`
	Message string `json:"message"`
}

type Face

type Face struct {
	BingKey       string
	LastRequestID string
}

func New

func New(key string) (*Face, error)

func (*Face) Detect

func (face *Face) Detect(url string, order DetectOrder) ([]FaceDetect, error)

type FaceAttributes

type FaceAttributes struct {
	Age        float32    `json:"age"`
	Gender     string     `json:"gender"`
	Smile      float32    `json:"smile"`
	FacialHair FacialHair `json:"facialhair"`
	Glasses    string     `json:"glasses"`
	HeadPose   HeadPose   `json:"headpose"`
}

type FaceAttributesOrder

type FaceAttributesOrder struct {
	Age        bool `name:"age"`
	Gender     bool `name:"gender"`
	HeadPose   bool `name:"headPose"`
	Smile      bool `name:"smile"`
	FacialHair bool `name:"facialHair"`
	Glasses    bool `name:"glasses"`
}

func (FaceAttributesOrder) String

func (order FaceAttributesOrder) String() (string, error)

type FaceDetect

type FaceDetect struct {
	FaceID         string         `json:"faceId"`
	FaceRectangle  Rectangle      `json:"faceRectangle"`
	FaceLandmarks  FaceLandmarks  `json:"faceLandmarks"`
	FaceAttributes FaceAttributes `json:"faceAttributes"`
}

type FaceLandmarks

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

type FacialHair

type FacialHair struct {
	Mustache  float32 `json:"mustache"`
	Beard     float32 `json:"beard"`
	SideBurns float32 `json:"sideburns"`
}

type HeadPose

type HeadPose struct {
	Roll  float32 `json:"roll"`
	Pitch float32 `json:"pitch"`
	Yaw   float32 `json:"yaw"`
}

type Position

type Position struct {
	X float32 `json:"x"`
	Y float32 `json:"y"`
}

type Rectangle

type Rectangle struct {
	Top    int `json:"top"`
	Left   int `json:"left"`
	Width  int `json:"width"`
	Height int `json:"height"`
}

Jump to

Keyboard shortcuts

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