Documentation ¶
Index ¶
- Variables
- func AssignLabel(trainingSet []*ProjectedTrainingMatrix, testFace *algorithm.Matrix, k int, ...) (string, float64)
- func Classify(neighbors []*ProjectedTrainingMatrix) (string, float64)
- func GetIndexesOfKEigenvalues(d []float64, k int) []int
- func NewMix(i int, v float64) *mix
- func Resize(img image.Image) *image.NRGBA
- func SaveImageTo(img *image.Gray16, path string)
- func SetConfigFile(filepath string)
- func StreamToVector(img image.Image) []float64
- func SumPixels(face []float64, width int, height int) float64
- func ToImage(face *algorithm.Matrix) *image.Gray16
- func ToMatrix(path string) *algorithm.Matrix
- func ToPgm(path string) string
- func ToVector(path string) (int, int, []float64)
- type Config
- type CosineDissimilarity
- type Euclidean
- type FaceRecognitionItem
- type FaceRecognitionLib
- func (fl *FaceRecognitionLib) AddUserFace(u *FaceRecognitionItem)
- func (fl *FaceRecognitionLib) FindFace(img *image.Image) ([]*algorithm.Matrix, []string)
- func (fl *FaceRecognitionLib) GetTrainer(featureType string) *Trainer
- func (fl *FaceRecognitionLib) ImportIntoDB(face *facedetector.FaceDetector, user *FaceRecognitionItem) *FaceRecognitionItem
- func (fl *FaceRecognitionLib) MatrixNVectorize(img *image.Image) *algorithm.Matrix
- func (fl *FaceRecognitionLib) NormalizeImageLength()
- func (fl *FaceRecognitionLib) Save()
- func (fl *FaceRecognitionLib) Train(featureType string)
- type FeatureExtraction
- type L1
- type LDA
- type LPP
- type MixArray
- type PCA
- type ProjectedTrainingMatrix
- func FindKNN(trainingSet []*ProjectedTrainingMatrix, testFace *algorithm.Matrix, k int, ...) []*ProjectedTrainingMatrix
- func NewProjectedTrainingMatrix(m *algorithm.Matrix, l string) *ProjectedTrainingMatrix
- func NewSliceProjectedTrainingMatrix(input []*ProjectedTrainingMatrix) []*ProjectedTrainingMatrix
- type Trainer
- type User
Constants ¶
This section is empty.
Variables ¶
View Source
var ( Height = 100 Width = 100 )
View Source
var ( LPPFeatureType = "LPP" PCAFeatureType = "PCA" LDAFeatureType = "LDA" )
View Source
var MAX_FLOAT_VALUE = 10000000.
Functions ¶
func AssignLabel ¶
func Classify ¶
func Classify(neighbors []*ProjectedTrainingMatrix) (string, float64)
func SaveImageTo ¶
func SetConfigFile ¶
func SetConfigFile(filepath string)
func StreamToVector ¶
Types ¶
type Config ¶
type Config struct { FaceDetectionConfigurationFile string `json:"opencvfile"` FaceRecognitionBasePath string `json:"facerecognitionbasepath"` }
func SetAndLoad ¶
func (*Config) GetDataLib ¶
func (*Config) GetFaceRecognitionBasePath ¶
func (*Config) GetTmpDirectory ¶
type CosineDissimilarity ¶
type CosineDissimilarity struct { }
func (*CosineDissimilarity) GetDistance ¶
func (c *CosineDissimilarity) GetDistance(a, b *algorithm.Matrix) float64
type FaceRecognitionItem ¶
func NewFaceRecognitionItem ¶
func NewFaceRecognitionItem() *FaceRecognitionItem
func (*FaceRecognitionItem) DetectFaces ¶
func (fi *FaceRecognitionItem) DetectFaces(images []string) int
func (*FaceRecognitionItem) DetectFacesFromImages ¶
func (fi *FaceRecognitionItem) DetectFacesFromImages(images []image.Image)
func (*FaceRecognitionItem) GetKey ¶
func (fi *FaceRecognitionItem) GetKey() string
type FaceRecognitionLib ¶
type FaceRecognitionLib struct { Items map[string]*FaceRecognitionItem `json:"facerecognition_lib"` MinimalNumOfComponents int Width int Height int }
func GetFaceRecognitionLib ¶
func GetFaceRecognitionLib() *FaceRecognitionLib
func NewFaceRecognitionLib ¶
func NewFaceRecognitionLib() *FaceRecognitionLib
func (*FaceRecognitionLib) AddUserFace ¶
func (fl *FaceRecognitionLib) AddUserFace(u *FaceRecognitionItem)
func (*FaceRecognitionLib) GetTrainer ¶
func (fl *FaceRecognitionLib) GetTrainer(featureType string) *Trainer
func (*FaceRecognitionLib) ImportIntoDB ¶
func (fl *FaceRecognitionLib) ImportIntoDB(face *facedetector.FaceDetector, user *FaceRecognitionItem) *FaceRecognitionItem
func (*FaceRecognitionLib) MatrixNVectorize ¶
func (fl *FaceRecognitionLib) MatrixNVectorize(img *image.Image) *algorithm.Matrix
func (*FaceRecognitionLib) NormalizeImageLength ¶
func (fl *FaceRecognitionLib) NormalizeImageLength()
func (*FaceRecognitionLib) Save ¶
func (fl *FaceRecognitionLib) Save()
func (*FaceRecognitionLib) Train ¶
func (fl *FaceRecognitionLib) Train(featureType string)
type FeatureExtraction ¶
type FeatureExtraction struct { TrainingSet []*algorithm.Matrix Labels []string NumOfComponents int MeanMatrix *algorithm.Matrix W *algorithm.Matrix ProjectedTrainingSet []*ProjectedTrainingMatrix }
func NewFeatureExtraction ¶
func NewFeatureExtraction() *FeatureExtraction
type LPP ¶
type LPP struct {
FeatureExtraction *FeatureExtraction
}
type PCA ¶
type PCA struct {
FeatureExtraction *FeatureExtraction
}
func (*PCA) GetFeature ¶
type ProjectedTrainingMatrix ¶
func FindKNN ¶
func FindKNN(trainingSet []*ProjectedTrainingMatrix, testFace *algorithm.Matrix, k int, computeDistance func(a, b *algorithm.Matrix) float64) []*ProjectedTrainingMatrix
func NewProjectedTrainingMatrix ¶
func NewProjectedTrainingMatrix(m *algorithm.Matrix, l string) *ProjectedTrainingMatrix
func NewSliceProjectedTrainingMatrix ¶
func NewSliceProjectedTrainingMatrix(input []*ProjectedTrainingMatrix) []*ProjectedTrainingMatrix
type Trainer ¶
type Trainer struct { Metric func(a, b *algorithm.Matrix) float64 FeatureType string FeatureExtraction *FeatureExtraction NumOfComponents int K int TrainingSet []*algorithm.Matrix TrainingLabels []string Model []*ProjectedTrainingMatrix }
func NewTrainer ¶
func NewTrainer() *Trainer
func NewTrainerArgs ¶
Click to show internal directories.
Click to hide internal directories.