facenet

package
v0.0.0-...-21979d2 Latest Latest
Warning

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

Go to latest
Published: Oct 13, 2019 License: MIT Imports: 13 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func CountMean

func CountMean(img [][][]float32) (mean, std float32)

func TensorFromImg

func TensorFromImg(img image.Image) (output *tf.Tensor, err error)

func TensorFromMat

func TensorFromMat(mat gocv.Mat) (output *tf.Tensor, err error)

Types

type Facenet

type Facenet struct {
	FacenetModel    *tf.Graph
	NormalizerGraph *tf.Graph
	FacenetSession  *tf.Session
}

func NewFacenet

func NewFacenet(modelfile string) (facenet Facenet, err error)

func (Facenet) BeginSession

func (fnet Facenet) BeginSession(self *Facenet) (err error)

func (Facenet) Close

func (fnet Facenet) Close(self *Facenet) error

func (Facenet) ExtractFeatures

func (fnet Facenet) ExtractFeatures(tensor *tf.Tensor) ([]float32, error)

run the image through the model to generate embedding

func (Facenet) Normalize

func (fnet Facenet) Normalize(tensor *tf.Tensor) (tensorout *tf.Tensor, err error)

Creates a graph to decode, rezise and normalize an image

func (Facenet) PrepareMat

func (fnet Facenet) PrepareMat(img gocv.Mat) (output *tf.Tensor, err error)

prepares a gocv.Mat with preprocessing before generating embedding, return a tensor containing processed image

func (Facenet) Preprocess

func (fnet Facenet) Preprocess(img image.Image) (output *tf.Tensor, err error)

prepares image with preprocessing before generating embedding, return a tensor containing processed image

Jump to

Keyboard shortcuts

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