-
Notifications
You must be signed in to change notification settings - Fork 6
Expand file tree
/
Copy pathparameter.py
More file actions
52 lines (39 loc) · 3.49 KB
/
parameter.py
File metadata and controls
52 lines (39 loc) · 3.49 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
import logging
#Parameter for whole Programm
##################################
train = 1 # 1 = Yes, 0 = No
pickle_data = 1 # 1 = Yes, 0 = No
pickle_filename = 'test.pickle'
search = 1 # 1 = Yes, 0 = No
save_images = 1 # 1 = Yes, 0 = No (for faster computing the saving of images and faces can be deactivated
logger = logging.getLogger('myLogger');
logger.root.setLevel(logging.INFO) # DEBUG, INFO, WARN, ERROR, CRITICAL
""" logging.debug('Debug') #Detailed information, typically of interest only when diagnosing problems.
logging.info('info') #Confirmation that things are working as expected.
logging.warn('warn') #An indication that something unexpected happened, or indicative of some problem in the near future (e.g. disk space low). The software is still working as expected
logging.error('error') #Due to a more serious problem, the software has not been able to perform some function.
logging.critical('critical') A serious error, indicating that the program itself may be unable to continue running."""
#PARAMETER FOR TRAIN
#######################
#Viola-Jones Detection
cascadefile = "haarcascade_frontalface_default.xml" # name of cascadefile for detecting the faces
scaleFactor = 1.1 # Parameter specifying how much the image size is reduced at each image scale. (standard value = 1.1 - http://opencv.itseez.com/modules/objdetect/doc/cascade_classification.html?highlight=cv.haar#cv.HaarDetectObjects)
minNeighbors = 3 # Parameter specifying how many neighbors each candiate rectangle should have to retain it. (standard value = 3 - http://opencv.itseez.com/modules/objdetect/doc/cascade_classification.html?highlight=cv.haar#cv.HaarDetectObjects)
flags = 0 # Mode of operation. Currently the only flag that may be specified is CV_HAAR_DO_CANNY_PRUNING (standard value = 0 - http://opencv.itseez.com/modules/objdetect/doc/cascade_classification.html?highlight=cv.haar#cv.HaarDetectObjects)
min_facesize = (150, 150) # Minimum possible object size. Objects smaller than that are ignored (height and width in pixel)
max_facesize = (800.0,800.0) # facesize will be reduced to that size for performance (hint: number must be decimal)
description_method = 'surf'
#SURF-Description
face_enlargement = 1.2 # enlarge face BEFORE starting SURF (Example: 'None' for no enlargement, '1.5' for enlarge picture with 50 %)
min_features = 50 # only faces with this minimal amount of features will be analysed
hessian_threshold = 300 # Threshold for hessian keypoint detector used in SURF
nOctaves = 3 # Number of pyramid octaves the keypoint detector will use
nOctaveLayers = 8 # Number of octave layers within each octave
#SIFT-Description
# no parameters
#PARAMETER FOR SEARCH
###########################
min_matches = 4 # Number of minimal matches for search. must be at least 4 matches. otherwise system crashes
number_topresults = 4 # show number of topresults
#Matching
bruteforce_threshold = 0.6 # Threshold for Bruteforce Matching