Commit c2076ace authored by Tiago de Freitas Pereira's avatar Tiago de Freitas Pereira
Browse files

Cleaning up some unecessary entrypoints

parent ed54bf5b
#!/usr/bin/env python
import bob.bio.base
import bob.ip.gabor
similarity_function = bob.ip.gabor.Similarity("PhaseDiffPlusCanberra", bob.ip.gabor.Transform())
def gabor_jet_similarities(f1, f2):
"""Computes the similarity vector between two Gabor graph features"""
assert len(f1) == len(f2)
return [similarity_function(f1[i], f2[i]) for i in range(len(f1))]
algorithm = bob.bio.base.algorithm.BIC(
# measure to compare two features in input space
comparison_function = gabor_jet_similarities,
# load and save functions
read_function = bob.ip.gabor.load_jets,
write_function = bob.ip.gabor.save_jets,
# Limit the number of training pairs
maximum_training_pair_count = 1000000,
# Dimensions of intrapersonal and extrapersonal subspaces
subspace_dimensions = (20, 20),
multiple_model_scoring = 'max'
)
#!/usr/bin/env python
import bob.bio.face
import math
algorithm = bob.bio.face.algorithm.GaborJet(
# Gabor jet comparison
gabor_jet_similarity_type = 'PhaseDiffPlusCanberra',
multiple_feature_scoring = 'max_jet',
# Gabor wavelet setup
gabor_sigma = math.sqrt(2.) * math.pi,
)
#!/usr/bin/env python
import bob.bio.face
import bob.math
algorithm = bob.bio.face.algorithm.Histogram(
distance_function = bob.math.histogram_intersection,
is_distance_function = False
)
#!/usr/bin/env python
import bob.bio.face
extractor = bob.bio.face.extractor.DCTBlocks(
block_size = 12,
block_overlap = 11,
number_of_dct_coefficients = 45
)
#!/usr/bin/env python
import bob.bio.base
import bob.bio.face
import math
extractor = bob.bio.face.extractor.GridGraph(
# Gabor parameters
gabor_sigma = math.sqrt(2.) * math.pi,
# what kind of information to extract
normalize_gabor_jets = True,
# setup of the fixed grid
node_distance = (8, 8)
)
#!/usr/bin/env python
import bob.bio.face
import math
# feature extraction
extractor = bob.bio.face.extractor.LGBPHS(
# block setup
block_size = 8,
block_overlap = 0,
# Gabor parameters
gabor_sigma = math.sqrt(2.) * math.pi,
# LBP setup (we use the defaults)
# histogram setup
sparse_histogram = True
)
import bob.bio.face
import numpy
preprocessor = bob.bio.face.preprocessor.Base(
color_channel = 'gray',
dtype = numpy.float64
)
#!/usr/bin/env python
import bob.bio.face
# Cropping
CROPPED_IMAGE_HEIGHT = 80
CROPPED_IMAGE_WIDTH = CROPPED_IMAGE_HEIGHT * 4 // 5
# eye positions for frontal images
RIGHT_EYE_POS = (CROPPED_IMAGE_HEIGHT // 5, CROPPED_IMAGE_WIDTH // 4 - 1)
LEFT_EYE_POS = (CROPPED_IMAGE_HEIGHT // 5, CROPPED_IMAGE_WIDTH // 4 * 3)
# define the preprocessor
preprocessor = bob.bio.face.preprocessor.FaceCrop(
cropped_image_size=(CROPPED_IMAGE_HEIGHT, CROPPED_IMAGE_WIDTH),
cropped_positions={'leye': LEFT_EYE_POS, 'reye': RIGHT_EYE_POS}
)
# top left and bottom right positions
TOP_LEFT_POS = (0, 0)
BOTTOM_RIGHT_POS = (CROPPED_IMAGE_HEIGHT, CROPPED_IMAGE_WIDTH)
# define the preprocessor
preprocessor_head = bob.bio.face.preprocessor.FaceCrop(
cropped_image_size=(CROPPED_IMAGE_HEIGHT, CROPPED_IMAGE_WIDTH),
cropped_positions={'topleft': TOP_LEFT_POS, 'bottomright': BOTTOM_RIGHT_POS}
)
#!/usr/bin/env python
import bob.bio.face
# Detects the face and eye landmarks crops it using the detected eyes
preprocessor = bob.bio.face.preprocessor.FaceDetect(
face_cropper = 'face-crop-eyes',
use_flandmark = True
)
# Detects the face amd crops it without eye detection
preprocessor_no_eyes = bob.bio.face.preprocessor.FaceDetect(
face_cropper = 'face-crop-eyes',
use_flandmark = False
)
import bob.bio.face
preprocessor = bob.bio.face.preprocessor.HistogramEqualization(
face_cropper = 'face-crop-eyes'
)
preprocessor_landmark = bob.bio.face.preprocessor.HistogramEqualization(
face_cropper = 'landmark-detect'
)
preprocessor_no_crop = bob.bio.face.preprocessor.HistogramEqualization(
face_cropper = None
)
import bob.bio.face
import numpy
preprocessor = bob.bio.face.preprocessor.INormLBP(
face_cropper = 'face-crop-eyes',
dtype = numpy.float64
)
preprocessor_landmark = bob.bio.face.preprocessor.INormLBP(
face_cropper = 'landmark-detect',
dtype = numpy.float64
)
preprocessor_no_crop = bob.bio.face.preprocessor.INormLBP(
face_cropper = None,
dtype = numpy.float64
)
import bob.bio.face
preprocessor = bob.bio.face.preprocessor.SelfQuotientImage(
face_cropper = 'face-crop-eyes'
)
preprocessor_landmark = bob.bio.face.preprocessor.SelfQuotientImage(
face_cropper = 'landmark-detect'
)
preprocessor_no_crop = bob.bio.face.preprocessor.SelfQuotientImage(
face_cropper = None
)
import bob.bio.face
preprocessor = bob.bio.face.preprocessor.TanTriggs(
face_cropper = 'face-crop-eyes'
)
preprocessor_landmark = bob.bio.face.preprocessor.TanTriggs(
face_cropper = 'landmark-detect'
)
preprocessor_no_crop = bob.bio.face.preprocessor.TanTriggs(
face_cropper = None
)
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment