Tools implemented in bob.bio.caffe_face

Summary

Face Image Feature Extractors

bob.bio.caffe_face.extractor.VGGFeatures([...]) Extract features using the VGG model http://www.robots.ox.ac.uk/~vgg/software/vgg_face/
bob.bio.caffe_face.extractor.LightCNNExtractor([...]) Feature extractor of face images using the LightCNNExtractor Caffe model.

Face Image Preprocessors

Several preprocessors are also available in this package that are recommended to use with the implemented feature extractors in this package: 'face-detect-vgg', 'face-eyes-vgg', 'face-detect-lightcnn', 'face-eyes-lightcnn'.

Detailed API

bob.bio.caffe_face.get_config()[source]

Returns a string containing the configuration information.

class bob.bio.caffe_face.extractor.LightCNNExtractor(end_cnn='eltwise_fc1', model_version='LightenedCNN_C')

Bases: bob.bio.base.extractor.Extractor

Feature extractor of face images using the LightCNNExtractor Caffe model. For more information please see bob.ip.caffe_extractor.LightCNN

end_cnn

str, optional – The name of the layer that you want to use as a feature.

feature_extractor

bob.ip.caffe_extractor.LightCNN – The instance of feature extractor.

model_version

str, optional – Which model to use.

__call__(image)[source]

Extracts features given a gray face image.

Parameters:image (numpy.array) – The gray image. Please see bob.ip.caffe_extractor.LightCNN.__call__ for the required format. For convenience, if the image range is [0,255], it is divided by 255. This assumes that the original image is an int8 image but be careful when relying on this feature.
Returns:The extracted features.
Return type:numpy.array
Raises:ValueError – If the image is not within [0,1] range.
__init__(end_cnn='eltwise_fc1', model_version='LightenedCNN_C')[source]
class bob.bio.caffe_face.extractor.VGGFeatures(feature_layer='fc7')

Bases: bob.bio.base.extractor.Extractor

Extract features using the VGG model http://www.robots.ox.ac.uk/~vgg/software/vgg_face/

Parameters:

feature_layer: The layer to be used as features. Possible values are fc6, fc7 or fc8.

__call__(image) → feature[source]

Extract features

Parameters:

image : 3D numpy.ndarray (floats)
The image to extract the features from.

Returns:

feature : 2D numpy.ndarray (floats)
The extracted features
__init__(feature_layer='fc7')[source]