Пример #1
0
def main():

    selectCascades()

    trainingData = FaceRecognizer.ImageFeatureSet()
    # Call the below method in a loop for every file in the training data set
    processImage('.\\Images\\test.jpg', trainingData)
Пример #2
0
def main():

    selectCascades()

    trainingData = FaceRecognizer.ImageFeatureSet()
    testingData = FaceRecognizer.ImageFeatureSet()
    test = {}
    train = {}
    delta = 2.3
    # Call the below method in a loop for every file in the training data set
    for files in os.walk(
            'C:\\Users\\Marc Nipuna\\Desktop\\Computer-Vision\\Codebase\\TrainingImages\\'
    ):
        for filename in files[2]:
            processImage(
                'C:\\Users\\Marc Nipuna\\Desktop\\Computer-Vision\\Codebase\\TrainingImages\\'
                + str(filename), trainingData, "Training Data")

    # Call the below method for extracting the features of the test image
    print "gonna call test"
    for files in os.walk(
            'C:\\Users\\Marc Nipuna\\Desktop\\Computer-Vision\\Codebase\\TestImage\\'
    ):
        print files
        for filename in files[2]:
            processImage(
                'C:\\Users\\Marc Nipuna\\Desktop\\Computer-Vision\\Codebase\\TestImage\\'
                + str(filename), testingData, "Testing Data")

    print "\n\n\nPrinting the training data: \n******************************\n "
    trainingData.printDataSet("Training Data")

    print "\n\n\nPrinting the test data: \n******************************\n"
    testingData.printDataSet("Testing Data")

    train = trainingData.trainingDataSet
    test = testingData.testDataSet
    #Scoring the test data with the training dataset

    #print "train",train
    #print "test",test

    score = trainingData.scoring(train, test, delta)

    for key_train, value_train in train.iteritems():
        testing(key_train, value_train)
Пример #3
0
def main():
    
    selectCascades()
    
    trainingData = FaceRecognizer.ImageFeatureSet()
    testingData = FaceRecognizer.ImageFeatureSet()

    # Call the below method in a loop for every file in the training data set
    '''for files in os.walk('.\\TrainingImages\\'):
        for filename in files[2]:
            processImage('.\\TrainingImages\\'+str(filename),trainingData,"Training Data")'''

    # Call the below method for extracting the features of the test image
    '''for files in os.walk('.\\TestImage\\'):
        for filename in files[2]:
            processImage('.\\TestImage\\'+str(filename),testingData,"Testing Data")'''
    
    import Files
    reload(Files)
    train = Files.Files('.\\TrainingImages\\')
    for filename in train:
            processImage('.\\TrainingImages\\'+str(filename),trainingData,"Training Data")
            
    test = Files.Files('.\\TestImage\\')
    for filename in test:
            print "NAme",filename
            processImage('.\\TestImage\\'+str(filename),testingData,"Testing Data")
    
        
    
    

    print "\n\n\nPrinting the training data: \n******************************\n "
    trainingData.printDataSet("Training Data")    

    print "\n\n\nPrinting the test data: \n******************************\n"
    testingData.printDataSet("Testing Data")