sdk-go: github.com/machinebox/sdk-go/facebox Index | Files

package facebox

import "github.com/machinebox/sdk-go/facebox"

Package facebox provides a client for accessing Facebox services.

Index

Package Files

facebox.go facebox_check.go facebox_faceprint.go facebox_rename.go facebox_similar.go facebox_state.go facebox_teach.go

type Client Uses

type Client struct {

    // HTTPClient is the http.Client that will be used to
    // make requests.
    HTTPClient *http.Client
    // contains filtered or unexported fields
}

Client is an HTTP client that can make requests to the box.

func New Uses

func New(addr string) *Client

New creates a new Client.

func (*Client) Check Uses

func (c *Client) Check(image io.Reader) ([]Face, error)

Check checks the image in the io.Reader for faces.

func (*Client) CheckBase64 Uses

func (c *Client) CheckBase64(data string) ([]Face, error)

CheckBase64 checks the Base64 encoded image for faces.

func (*Client) CheckBase64WithFaceprint Uses

func (c *Client) CheckBase64WithFaceprint(data string) ([]Face, error)

CheckBase64WithFaceprint checks the Base64 encoded image for faces and the object returned including the faceprints

func (*Client) CheckFaceprints Uses

func (c *Client) CheckFaceprints(faceprints []string) ([]Face, error)

CheckFaceprints checks the list of faceprints to see if they match any known faces.

func (*Client) CheckURL Uses

func (c *Client) CheckURL(imageURL *url.URL) ([]Face, error)

CheckURL checks the image at the specified URL for faces.

func (*Client) CompareFaceprints Uses

func (c *Client) CompareFaceprints(target string, faceprintCandidates []string) ([]float64, error)

CompareFaceprints returns the confidence of the comparsion between the target faceprint and each of faceprint of the slice of candidates and returns an array of confidence in the same order of the candidates

func (*Client) Info Uses

func (c *Client) Info() (*boxutil.Info, error)

Info gets the details about the box.

func (*Client) OpenState Uses

func (c *Client) OpenState() (io.ReadCloser, error)

OpenState opens the state file for reading. Clients must call Close.

func (*Client) PostState Uses

func (c *Client) PostState(r io.Reader) error

PostState uploads new state data.

func (*Client) PostStateURL Uses

func (c *Client) PostStateURL(stateURL *url.URL) error

PostStateURL tells facebox to download the state file specified by the URL.

func (*Client) Remove Uses

func (c *Client) Remove(id string) error

Remove makes facebox to forget a face

func (*Client) Rename Uses

func (c *Client) Rename(id, name string) error

Rename allows to change the name for a given face

func (*Client) RenameAll Uses

func (c *Client) RenameAll(oldName, newName string) error

RenameAll changes the name for all the faces that match a given name

func (*Client) Similar Uses

func (c *Client) Similar(image io.Reader) ([]Similar, error)

Similar checks the image in the io.Reader for similar faces. Deprecated: use Similars to support multiple faces.

func (*Client) SimilarBase64 Uses

func (c *Client) SimilarBase64(data string) ([]Similar, error)

SimilarBase64 checks the Base64 encoded image for similar faces. Deprecated: use SimilarsBase64 to support multiple faces.

func (*Client) SimilarID Uses

func (c *Client) SimilarID(id string) ([]Similar, error)

SimilarID returns similar faces based on the ID provided.

func (*Client) SimilarURL Uses

func (c *Client) SimilarURL(imageURL *url.URL) ([]Similar, error)

SimilarURL checks the image at the specified URL for similar faces. Deprecated: use SimilarsURL to support multiple faces.

func (*Client) Similars Uses

func (c *Client) Similars(image io.Reader, limit int) ([]SimilarFace, error)

Similars checks the image in the io.Reader for similar faces. Will look for a maximum of limit similar faces for each face.

func (*Client) SimilarsBase64 Uses

func (c *Client) SimilarsBase64(data string, limit int) ([]SimilarFace, error)

SimilarsBase64 checks the Base64 encoded image for similar faces. Will look for a maximum of limit similar faces for each face.

func (*Client) SimilarsURL Uses

func (c *Client) SimilarsURL(imageURL *url.URL, limit int) ([]SimilarFace, error)

SimilarsURL checks the image at the specified URL for similar faces. Will look for a maximum of limit similar faces for each face.

func (*Client) Teach Uses

func (c *Client) Teach(image io.Reader, id, name string) error

Teach teaches facebox the face in the io.Reader. The name should be the name of the person who owns the face. The id should be a unique identifier for the image, usually the filename.

func (*Client) TeachBase64 Uses

func (c *Client) TeachBase64(data, id, name string) error

TeachBase64 teaches facebox the face in the Base64 encoded image. See Teach for more information.

func (*Client) TeachFaceprint Uses

func (c *Client) TeachFaceprint(faceprint, id, name string) error

TeachFaceprint teaches facebox the face that is represented by the faceprint as a parameter. See Teach for more information.

func (*Client) TeachURL Uses

func (c *Client) TeachURL(imageURL *url.URL, id, name string) error

TeachURL teaches facebox the face in the image at the specified URL. See Teach for more information.

type ErrFacebox Uses

type ErrFacebox string

ErrFacebox represents an error from Facebox.

func (ErrFacebox) Error Uses

func (e ErrFacebox) Error() string

type Face Uses

type Face struct {
    Rect       Rect
    ID         string
    Name       string
    Matched    bool
    Confidence float64
    Faceprint  string
}

Face represents a face in an image.

type Rect Uses

type Rect struct {
    Top, Left     int
    Width, Height int
}

Rect represents the coordinates of a face within an image.

type Similar Uses

type Similar struct {
    ID         string
    Name       string
    Confidence float64
}

Similar represents a similar face.

type SimilarFace Uses

type SimilarFace struct {
    Rect         Rect      `json:"rect"`
    SimilarFaces []Similar `json:"similar_faces"`
}

SimilarFace describes a face with similatiries.

Package facebox imports 12 packages (graph) and is imported by 1 packages. Updated 2018-10-17. Refresh now. Tools for package owners.