Version: v0.0.0-...-aacf62d Latest Latest

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

Go to latest
Published: Nov 19, 2015 License: Apache-2.0 Imports: 11 Imported by: 0



The supported input image formats includes JPEG, PNG, GIF(the first frame), BMP, and image file size should be no larger than 4MB. Input parameter face landmarks, head-poses, gender, and age are optional. You need to specify them in the URL to turn on the functions. Otherwise, only face rectangles will be returned. The detectable face size range is 36x36 to 4096x4096 pixels. The faces out of this range will not be detected. For each image, the maximum number of faces returned is 64 and the faces are ranked by face rectangle size in descending order. Some faces may not be detected for technical challenges, e.g. very large face angles (head-pose), large occlusion. Frontal and near-frontal faces have the best results. The attribute headPose's pitch value is reserved as 0.0 The attributes gender and age are still experimental and may not be very accurate for now. The face ID will expire 24 hours after detection.

Face - Verification Analyzes two faces and determine whether they are from the same person. Remarks: Verification works well for frontal and near-frontal faces. For the scenarios that are sensitive to accuracy please use with own judgment.



View Source
const (
	CodeOK               = "Ok"               // success
	CodeBadArgument      = "BadArgument"      // JSON parsing error.
	CodeInvalidURL       = "InvalidURL"       // Invalid image URL.
	CodeInvalidImage     = "InvalidImage"     // Decoding error or unsupported image format.
	CodeInvalidImageSize = "InvalidImageSize" //Image size is too small (smaller than a detectable face size of 36x36 pixels) or too big (larger than 4MB file limit).
View Source
const VerificationRUL = `https://api.projectoxford.ai/face/v0/verifications`


This section is empty.


This section is empty.


type Attributes

type Attributes struct {
	HeadPose HeadPose
	Gender   string
	Age      float64

type DetectResult

type DetectResult struct {
	FaceResults []Face

detect result

type Face

type Face struct {
	FaceId        string
	FaceRectangle FaceRectangle
	FaceLandmarks FaceLandmarks
	Attributes    Attributes

face detect result

type FaceDetection

type FaceDetection struct {
	URL                    string //if set, will use url, otherwise will use Reader
	Reader                 io.Reader
	OcpApimSubscriptionKey string //if set, will use this, otherwise will use Config.OcpApimSubscriptionKey

func (FaceDetection) Do

func (self FaceDetection) Do() (detectResult DetectResult, err error)

start to detect a photo

type FaceLandmarks

type FaceLandmarks struct {
	PupilLeft           util.Point
	PupilRight          util.Point
	NoseTip             util.Point
	MouthLeft           util.Point
	MouthRight          util.Point
	EyebrowLeftOuter    util.Point
	EyeLeftOuter        util.Point
	EyeLeftTop          util.Point
	EyeLeftBottom       util.Point
	EyeLeftInner        util.Point
	EyebrowRightInner   util.Point
	EyebrowRightOuter   util.Point
	EyeRightInner       util.Point
	EyeRightTop         util.Point
	EyeRightBottom      util.Point
	EyeRightOuter       util.Point
	NoseRootLeft        util.Point
	NoseRootRight       util.Point
	NoseLeftAlarTop     util.Point
	NoseRightAlarTop    util.Point
	NoseLeftAlarOutTip  util.Point
	NoseRightAlarOutTip util.Point
	UpperLipTop         util.Point
	UpperLipBottom      util.Point
	UnderLipTop         util.Point
	UnderLipBottom      util.Point

type FaceRectangle

type FaceRectangle struct {
	Top    int
	Left   int
	Width  int
	Height int

type FaceVerification

type FaceVerification struct {
	FaceIdOne              string
	FaceIdTwo              string
	OcpApimSubscriptionKey string //if set, will use this, otherwise will use Config.OcpApimSubscriptionKey

func (FaceVerification) Do

func (self FaceVerification) Do() (result VerificationResult, err error)

type HeadPose

type HeadPose struct {
	Pitch float64
	Roll  float64
	Yaw   float64

type VerificationResult

type VerificationResult struct {
	IsIdentical bool
	Confidence  float64

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
t or T : Toggle theme light dark auto
y or Y : Canonical URL