machinebox

package
v0.1.0 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2019 License: Apache-2.0 Imports: 10 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

This section is empty.

Types

type CheckFaceprintRequest

type CheckFaceprintRequest struct {

	// Faceprints is a list of Faceprints to check.
	Faceprints []string `json:"faceprints"`
}

CheckFaceprintRequest is the request object for CheckFaceprint calls.

type CheckFaceprintResponse

type CheckFaceprintResponse struct {

	// Faces is a list of faces checked from Faceprints.
	Faces []FaceprintFace `json:"faces"`
	// Error is an error message if one occurred.
	Error string `json:"error"`
}

CheckFaceprintResponse is the response object for CheckFaceprint calls.

type CheckFileRequest

type CheckFileRequest struct {

	// File is the image to check for faces.
	File remototypes.File `json:"file"`
}

CheckFileRequest is the request object for CheckFile calls.

func (*CheckFileRequest) SetFile

func (s *CheckFileRequest) SetFile(ctx context.Context, filename string, r io.Reader) context.Context

SetFile sets the file for the File field.

type CheckFileResponse

type CheckFileResponse struct {

	// Faces is a list of faces that were found.
	Faces []Face `json:"faces"`
	// Error is an error message if one occurred.
	Error string `json:"error"`
}

CheckFileResponse is the response object for CheckFile calls.

type CheckURLRequest

type CheckURLRequest struct {

	// URL is the address of the image to check.
	URL string `json:"url"`
}

CheckURLRequest is the request object for CheckURL calls.

type CheckURLResponse

type CheckURLResponse struct {

	// Faces is a list of faces that were found.
	Faces []Face `json:"faces"`
	// Error is an error message if one occurred.
	Error string `json:"error"`
}

CheckURLResponse is the response object for CheckURL calls.

type Face

type Face struct {

	// ID is the identifier of the source that was matched.
	ID string `json:"id"`
	// Name is the name of the identified person.
	Name string `json:"name"`
	// Matched is whether the face was recognized or not.
	Matched bool `json:"matched"`
	// Faceprint is the Facebox Faceprint of this face.
	Faceprint string `json:"faceprint"`
	// Rect is where the face appears in the source image.
	Rect Rect `json:"rect"`
}

Face describes a face.

type FaceboxClient

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

FaceboxClient accesses remote Facebox services.

func NewFaceboxClient

func NewFaceboxClient(endpoint string, client *http.Client) *FaceboxClient

NewFaceboxClient makes a new FaceboxClient that will use the specified http.Client to make requests.

func (*FaceboxClient) CheckFaceprint

func (c *FaceboxClient) CheckFaceprint(ctx context.Context, request *CheckFaceprintRequest) (*CheckFaceprintResponse, error)

CheckFaceprint checks to see if a Faceprint matches any known faces.

func (*FaceboxClient) CheckFaceprintMulti

func (c *FaceboxClient) CheckFaceprintMulti(ctx context.Context, requests []*CheckFaceprintRequest) ([]*CheckFaceprintResponse, error)

func (*FaceboxClient) CheckFile

func (c *FaceboxClient) CheckFile(ctx context.Context, request *CheckFileRequest) (*CheckFileResponse, error)

CheckFile checks an image file for faces.

func (*FaceboxClient) CheckFileMulti

func (c *FaceboxClient) CheckFileMulti(ctx context.Context, requests []*CheckFileRequest) ([]*CheckFileResponse, error)

func (*FaceboxClient) CheckURL

func (c *FaceboxClient) CheckURL(ctx context.Context, request *CheckURLRequest) (*CheckURLResponse, error)

CheckURL checks a hosted image file for faces.

func (*FaceboxClient) CheckURLMulti

func (c *FaceboxClient) CheckURLMulti(ctx context.Context, requests []*CheckURLRequest) ([]*CheckURLResponse, error)

func (*FaceboxClient) FaceprintCompare

func (c *FaceboxClient) FaceprintCompare(ctx context.Context, request *FaceprintCompareRequest) (*FaceprintCompareResponse, error)

FaceprintCompare compares faceprints to a specified target describing similarity.

func (*FaceboxClient) FaceprintCompareMulti

func (c *FaceboxClient) FaceprintCompareMulti(ctx context.Context, requests []*FaceprintCompareRequest) ([]*FaceprintCompareResponse, error)

func (*FaceboxClient) GetState

func (c *FaceboxClient) GetState(ctx context.Context, request *GetStateRequest) (io.ReadCloser, error)

GetState gets the Facebox state file.

func (*FaceboxClient) PutState

func (c *FaceboxClient) PutState(ctx context.Context, request *PutStateRequest) (*PutStateResponse, error)

PutState sets the Facebox state file.

func (*FaceboxClient) PutStateMulti

func (c *FaceboxClient) PutStateMulti(ctx context.Context, requests []*PutStateRequest) ([]*PutStateResponse, error)

func (*FaceboxClient) RemoveID

func (c *FaceboxClient) RemoveID(ctx context.Context, request *RemoveIDRequest) (*RemoveIDResponse, error)

RemoveID removes a face with the specified ID.

func (*FaceboxClient) RemoveIDMulti

func (c *FaceboxClient) RemoveIDMulti(ctx context.Context, requests []*RemoveIDRequest) ([]*RemoveIDResponse, error)

func (*FaceboxClient) Rename

func (c *FaceboxClient) Rename(ctx context.Context, request *RenameRequest) (*RenameResponse, error)

Rename changes a person's name.

func (*FaceboxClient) RenameID

func (c *FaceboxClient) RenameID(ctx context.Context, request *RenameIDRequest) (*RenameIDResponse, error)

RenameID changes the name of a previously taught face, by ID.

func (*FaceboxClient) RenameIDMulti

func (c *FaceboxClient) RenameIDMulti(ctx context.Context, requests []*RenameIDRequest) ([]*RenameIDResponse, error)

func (*FaceboxClient) RenameMulti

func (c *FaceboxClient) RenameMulti(ctx context.Context, requests []*RenameRequest) ([]*RenameResponse, error)

func (*FaceboxClient) SimilarFile

func (c *FaceboxClient) SimilarFile(ctx context.Context, request *SimilarFileRequest) (*SimilarFileResponse, error)

SimilarFile checks for similar faces from the face in an image file.

func (*FaceboxClient) SimilarFileMulti

func (c *FaceboxClient) SimilarFileMulti(ctx context.Context, requests []*SimilarFileRequest) ([]*SimilarFileResponse, error)

func (*FaceboxClient) SimilarID

func (c *FaceboxClient) SimilarID(ctx context.Context, request *SimilarIDRequest) (*SimilarIDResponse, error)

SimilarID checks for similar faces by ID.

func (*FaceboxClient) SimilarIDMulti

func (c *FaceboxClient) SimilarIDMulti(ctx context.Context, requests []*SimilarIDRequest) ([]*SimilarIDResponse, error)

func (*FaceboxClient) SimilarURL

func (c *FaceboxClient) SimilarURL(ctx context.Context, request *SimilarURLRequest) (*SimilarURLResponse, error)

SimilarURL checks for similar faces in a hosted image file.

func (*FaceboxClient) SimilarURLMulti

func (c *FaceboxClient) SimilarURLMulti(ctx context.Context, requests []*SimilarURLRequest) ([]*SimilarURLResponse, error)

func (*FaceboxClient) TeachFaceprint

func (c *FaceboxClient) TeachFaceprint(ctx context.Context, request *TeachFaceprintRequest) (*TeachFaceprintResponse, error)

TeachFaceprint teaches Facebox about a face from a Faceprint.

func (*FaceboxClient) TeachFaceprintMulti

func (c *FaceboxClient) TeachFaceprintMulti(ctx context.Context, requests []*TeachFaceprintRequest) ([]*TeachFaceprintResponse, error)

func (*FaceboxClient) TeachFile

func (c *FaceboxClient) TeachFile(ctx context.Context, request *TeachFileRequest) (*TeachFileResponse, error)

TeachFile teaches Facebox a new face from an image file.

func (*FaceboxClient) TeachFileMulti

func (c *FaceboxClient) TeachFileMulti(ctx context.Context, requests []*TeachFileRequest) ([]*TeachFileResponse, error)

func (*FaceboxClient) TeachURL

func (c *FaceboxClient) TeachURL(ctx context.Context, request *TeachURLRequest) (*TeachURLResponse, error)

TeachURL teaches Facebox a new face from an image on the web.

func (*FaceboxClient) TeachURLMulti

func (c *FaceboxClient) TeachURLMulti(ctx context.Context, requests []*TeachURLRequest) ([]*TeachURLResponse, error)

type FaceprintCompareRequest

type FaceprintCompareRequest struct {

	// Target is the target Faceprint to which the Faceprints will be compared.
	Target string `json:"target"`
	// Faceprints is a list of Faceprints that will be compared to Target.
	Faceprints []string `json:"faceprints"`
}

FaceprintCompareRequest is the request object for FaceprintCompare calls.

type FaceprintCompareResponse

type FaceprintCompareResponse struct {

	// Confidences is a list of confidence values.
	// The order matches the order of FaceprintCompareRequest.Faceprints.
	Confidences []float64 `json:"confidences"`
	// Error is an error message if one occurred.
	Error string `json:"error"`
}

FaceprintCompareResponse is the response object for FaceprintCompare calls.

type FaceprintFace

type FaceprintFace struct {

	// Matched is whether the face was recognized or not.
	Matched bool `json:"matched"`
	// Confidence is a numerical value of how confident the AI
	// is that this is a match.
	Confidence float64 `json:"confidence"`
	// ID is the identifier of the source that matched.
	ID string `json:"id"`
	// Name is the name of the person recognized.
	Name string `json:"name"`
}

FaceprintFace is a face.

type GetStateRequest

type GetStateRequest struct {
}

GetStateRequest is the request object for GetState calls.

type PutStateRequest

type PutStateRequest struct {

	// StateFile is the Facebox state file to set.
	StateFile remototypes.File `json:"state_file"`
}

PutStateRequest is the request object for PutState calls.

func (*PutStateRequest) SetStateFile

func (s *PutStateRequest) SetStateFile(ctx context.Context, filename string, r io.Reader) context.Context

SetStateFile sets the file for the StateFile field.

type PutStateResponse

type PutStateResponse struct {

	// Error is an error message if one occurred.
	Error string `json:"error"`
}

PutStateResponse is the response object for PutState calls.

type Rect

type Rect struct {

	// Top is the starting Y coordinate.
	Top int `json:"top"`
	// Left is the starting X coordinate.
	Left int `json:"left"`
	// Width is the width.
	Width int `json:"width"`
	// Height is the height.
	Height int `json:"height"`
}

Rect is a bounding box describing a rectangle of an image.

type RemoveIDRequest

type RemoveIDRequest struct {

	// ID is the identifier of the source to remove.
	ID string `json:"id"`
}

RemoveIDRequest is the request object for RemoveID calls.

type RemoveIDResponse

type RemoveIDResponse struct {

	// Error is an error message if one occurred.
	Error string `json:"error"`
}

RemoveIDResponse is the response object for RemoveID calls.

type RenameIDRequest

type RenameIDRequest struct {

	// ID is the identifier of the source to rename.
	ID string `json:"id"`
	// Name is the new name to assign to the item matching ID.
	Name string `json:"name"`
}

RenameIDRequest is the request object for RenameID calls.

type RenameIDResponse

type RenameIDResponse struct {

	// Error is an error message if one occurred.
	Error string `json:"error"`
}

RenameIDResponse is the response object for RenameID calls.

type RenameRequest

type RenameRequest struct {

	// From is the original name.
	From string `json:"from"`
	// To is the new name.
	To string `json:"to"`
}

RenameRequest is the request object for Rename calls.

type RenameResponse

type RenameResponse struct {

	// Error is an error message if one occurred.
	Error string `json:"error"`
}

RenameResponse is the response object for Rename calls.

type SimilarFace

type SimilarFace struct {

	// Rect is where the face appears in the image.
	Rect Rect `json:"rect"`
	// SimilarFaces is a list of similar faces.
	SimilarFaces []Face `json:"similar_faces"`
}

SimilarFace is a detected face with similar matching faces.

type SimilarFileRequest

type SimilarFileRequest struct {
	File remototypes.File `json:"file"`
}

SimilarFileRequest is the request object for SimilarFile calls.

func (*SimilarFileRequest) SetFile

func (s *SimilarFileRequest) SetFile(ctx context.Context, filename string, r io.Reader) context.Context

SetFile sets the file for the File field.

type SimilarFileResponse

type SimilarFileResponse struct {
	Faces []SimilarFace `json:"faces"`
	// Error is an error message if one occurred.
	Error string `json:"error"`
}

SimilarFileResponse is the response object for SimilarFile calls.

type SimilarIDRequest

type SimilarIDRequest struct {

	// ID is the identifier of the source to look for similar faces of.
	ID string `json:"id"`
}

SimilarIDRequest is the request object for SimilarID calls.

type SimilarIDResponse

type SimilarIDResponse struct {

	// Faces is a list of similar faces.
	Faces []SimilarFace `json:"faces"`
	// Error is an error message if one occurred.
	Error string `json:"error"`
}

SimilarIDResponse is the response object for SimilarID calls.

type SimilarURLRequest

type SimilarURLRequest struct {
	URL string `json:"url"`
}

SimilarURLRequest is the request object for SimilarURL calls.

type SimilarURLResponse

type SimilarURLResponse struct {
	Faces []SimilarFace `json:"faces"`
	// Error is an error message if one occurred.
	Error string `json:"error"`
}

SimilarURLResponse is the response object for SimilarURL calls.

type TeachFaceprintRequest

type TeachFaceprintRequest struct {
	ID        string `json:"id"`
	Name      string `json:"name"`
	Faceprint string `json:"faceprint"`
}

TeachFaceprintRequest is the request object for TeachFaceprint calls.

type TeachFaceprintResponse

type TeachFaceprintResponse struct {

	// Error is an error message if one occurred.
	Error string `json:"error"`
}

TeachFaceprintResponse is the response object for TeachFaceprint calls.

type TeachFileRequest

type TeachFileRequest struct {

	// ID is an identifier describing the source, for example the filename.
	ID string `json:"id"`
	// Name is the name of the person in the image.
	Name string `json:"name"`
	// File is the image containing the face to teach.
	File remototypes.File `json:"file"`
}

TeachFileRequest is the request object for TeachFile calls.

func (*TeachFileRequest) SetFile

func (s *TeachFileRequest) SetFile(ctx context.Context, filename string, r io.Reader) context.Context

SetFile sets the file for the File field.

type TeachFileResponse

type TeachFileResponse struct {

	// Error is an error message if one occurred.
	Error string `json:"error"`
}

TeachFileResponse is the response object for TeachFile calls.

type TeachURLRequest

type TeachURLRequest struct {

	// ID is an identifier describing the source, for example the filename.
	ID string `json:"id"`
	// Name is the name of the person in the image.
	Name string `json:"name"`
	// URL is the address of the image.
	URL string `json:"url"`
}

TeachURLRequest is the request object for TeachURL calls.

type TeachURLResponse

type TeachURLResponse struct {

	// Error is an error message if one occurred.
	Error string `json:"error"`
}

TeachURLResponse is the response object for TeachURL calls.

Jump to

Keyboard shortcuts

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