Beispiel #1
0
    def __init__(self,
                 face_detector=CascadeDetector(),
                 tile_size=(128, 128),
                 validate=None,
                 n_iter=1,
                 annotate=False,
                 **kwargs):
        ''' 
        Create an eye locator.  This default implentation uses a 
        cascade classifier for face detection and then SVR for eye
        location. 
        '''
        self.face_detector = face_detector
        self.left_eye = None
        self.right_eye = None
        self.tile_size = tile_size
        self.validate = validate
        self.n_iter = n_iter
        self.annotate = annotate
        self.perturbations = True

        # this object handles pca normalization
        self.normalize = VectorClassifier.VectorClassifier(
            VectorClassifier.TYPE_REGRESSION,
            reg_norm=VectorClassifier.REG_NORM_NONE)

        # point locators that learn to find the eyes.
        self.left_locator = SVMLocator(
            svm_type=SVM.TYPE_NU_SVR, normalization=VectorClassifier.NORM_NONE)
        self.right_locator = SVMLocator(
            svm_type=SVM.TYPE_NU_SVR, normalization=VectorClassifier.NORM_NONE)

        # Number of training images where the face detection did not work.
        self.detection_failures = 0

        self.training_labels = []
Beispiel #2
0
 def createLocators(self, **kwargs):
     ''' Create two point locators that use the methods of interest '''
     self.left_locator = SVMLocator(
         type=SVM.TYPE_NU_SVR, normalization=VectorClassifier.NORM_VALUE)
     self.right_locator = SVMLocator(
         type=SVM.TYPE_NU_SVR, normalization=VectorClassifier.NORM_VALUE)