def update(self, mean, eigenfaces):
        self.mean = mean
        self.eigenfaces = eigenfaces
        self.eigenfaceCount = len(self.eigenfaces)

        self.subspaceImages = db.get_subspace_images()
        self.subspaceImageWeights = dbut.aggregate_subspaceimage_weights(
            self.subspaceImages)
    def __init__(self):
        self.mean, self.eigenfaces = fm.read_meanface_and_eigenfaces(
            eigenface_count=MAX_EIGENFACE_COUNT)
        self.eigenfaceCount = len(self.eigenfaces)  #get the available count
        print(self.eigenfaceCount)

        self.subspaceImages = db.get_subspace_images()
        self.subspaceImageWeights = dbut.aggregate_subspaceimage_weights(
            self.subspaceImages)

        self.detectionThreshold = 3000
        self.recognizationThreshold = 3600
Example #3
0
from sys import setrecursionlimit
import database_manager as db 
import file_system_manager as fm 
import db_utils as dbut

import pca_manager as pca

if (__name__ == "__main__"):
	setrecursionlimit(10000)

	db.renew_subspaceimages_table()
	mean, eigenfaces = pca.find_meanface_and_eigenfaces()
	print(type(eigenfaces))
	print(mean.shape)
	print(type(mean))
	subspaceImages = db.get_subspace_images()
	subspaceWeights = dbut.aggregate_subspaceimage_weights(subspaceImages)
	temp = range(0, len(subspaceImages))

	for i in range(0, 16):
		image = fm.read_test_image(name = "%s.jpg" % i)
		result = pca.detect_face(image, mean, eigenfaces, dist_threshold = 1500)		
		if (result):
			personID = pca.recognize_face(image, mean, eigenfaces, temp, subspaceImages, subspaceWeights, dist_threshold = 500)		
			print(personID)
	
	db.clean_up()