wssface

package
v0.0.0-...-4020383 Latest Latest
Warning

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

Go to latest
Published: Jun 8, 2020 License: MIT Imports: 7 Imported by: 0

Documentation

Index

Constants

View Source
const (
	//FaceSubscriptionKey Azure Face Subscription env key
	FaceSubscriptionKey = "WSS_FACE_SUBSCRIPTION_KEY"
	//FaceEndpointKey Azure Face Endpoint env key
	FaceEndpointKey = "WSS_FACE_ENDPOINT"
)

Variables

This section is empty.

Functions

This section is empty.

Types

type Configuration

type Configuration struct {
	FaceSubscription string
	FaceEndpoint     string
}

Configuration structure for the Face service configuration

func BuildConfigurationFromEnvs

func BuildConfigurationFromEnvs() (*Configuration, error)

BuildConfigurationFromEnvs builds the configuration from env variables

func (*Configuration) IsValid

func (c *Configuration) IsValid() bool

IsValid Checks if the configuration is valid

type Emotion

type Emotion string

Emotion maps the Azure Face API result for emotion field

func (Emotion) Adjective

func (e Emotion) Adjective() string

Adjective returns the adjective corresponding to the emotion

type FaceDetails

type FaceDetails struct {
	Age       float64
	Sentiment Emotion
	Gender    string
}

FaceDetails Details about one face

type FaceResult

type FaceResult struct {
	Faces []FaceDetails
}

FaceResult result of the FaceAPI

type FaceServiceClient

type FaceServiceClient struct {
	// contains filtered or unexported fields
}

FaceServiceClient client for the Azure Face Service

func NewFaceServiceClient

func NewFaceServiceClient(conf *Configuration) *FaceServiceClient

NewFaceServiceClient FaceServiceClient constructor

func (*FaceServiceClient) InvokeFace

func (s *FaceServiceClient) InvokeFace(faceContext context.Context, photo io.ReadCloser) (*FaceResult, error)

InvokeFace invokes the Face APIs with the provided photo

Jump to

Keyboard shortcuts

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