Documentation ¶
Overview ¶
Package facebox provides a client for accessing Facebox services.
Index ¶
- type Client
- func (c *Client) Check(image io.Reader) ([]Face, error)
- func (c *Client) CheckBase64(data string) ([]Face, error)
- func (c *Client) CheckBase64WithFaceprint(data string) ([]Face, error)
- func (c *Client) CheckFaceprints(faceprints []string) ([]Face, error)
- func (c *Client) CheckURL(imageURL *url.URL) ([]Face, error)
- func (c *Client) CompareFaceprints(target string, faceprintCandidates []string) ([]float64, error)
- func (c *Client) Info() (*boxutil.Info, error)
- func (c *Client) OpenState() (io.ReadCloser, error)
- func (c *Client) PostState(r io.Reader) error
- func (c *Client) PostStateURL(stateURL *url.URL) error
- func (c *Client) Remove(id string) error
- func (c *Client) Rename(id, name string) error
- func (c *Client) RenameAll(oldName, newName string) error
- func (c *Client) Similar(image io.Reader) ([]Similar, error)
- func (c *Client) SimilarBase64(data string) ([]Similar, error)
- func (c *Client) SimilarID(id string) ([]Similar, error)
- func (c *Client) SimilarURL(imageURL *url.URL) ([]Similar, error)
- func (c *Client) Similars(image io.Reader, limit int) ([]SimilarFace, error)
- func (c *Client) SimilarsBase64(data string, limit int) ([]SimilarFace, error)
- func (c *Client) SimilarsURL(imageURL *url.URL, limit int) ([]SimilarFace, error)
- func (c *Client) Teach(image io.Reader, id, name string) error
- func (c *Client) TeachBase64(data, id, name string) error
- func (c *Client) TeachFaceprint(faceprint, id, name string) error
- func (c *Client) TeachURL(imageURL *url.URL, id, name string) error
- type Face
- type Rect
- type Similar
- type SimilarFace
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
This section is empty.
Types ¶
type Client ¶
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 (*Client) CheckBase64 ¶
CheckBase64 checks the Base64 encoded image for faces.
func (*Client) CheckBase64WithFaceprint ¶ added in v0.3.1
CheckBase64WithFaceprint checks the Base64 encoded image for faces and the object returned including the faceprints
func (*Client) CheckFaceprints ¶ added in v0.3.1
CheckFaceprints checks the list of faceprints to see if they match any known faces.
func (*Client) CompareFaceprints ¶ added in v0.3.1
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) OpenState ¶
func (c *Client) OpenState() (io.ReadCloser, error)
OpenState opens the state file for reading. Clients must call Close.
func (*Client) PostStateURL ¶
PostStateURL tells facebox to download the state file specified by the URL.
func (*Client) Similar ¶
Similar checks the image in the io.Reader for similar faces. Deprecated: use Similars to support multiple faces.
func (*Client) SimilarBase64 ¶
SimilarBase64 checks the Base64 encoded image for similar faces. Deprecated: use SimilarsBase64 to support multiple faces.
func (*Client) SimilarURL ¶
SimilarURL checks the image at the specified URL for similar faces. Deprecated: use SimilarsURL to support multiple faces.
func (*Client) Similars ¶ added in v0.3.1
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 ¶ added in v0.3.1
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 ¶ added in v0.3.1
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 ¶
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 ¶
TeachBase64 teaches facebox the face in the Base64 encoded image. See Teach for more information.
func (*Client) TeachFaceprint ¶ added in v0.3.1
TeachFaceprint teaches facebox the face that is represented by the faceprint as a parameter. See Teach for more information.
type Face ¶
type Face struct { Rect Rect ID string Name string Matched bool Confidence float64 Faceprint string }
Face represents a face in an image.
type SimilarFace ¶ added in v0.3.1
SimilarFace describes a face with similatiries.