Commit 7540c089 by Tiago de Freitas Pereira

Merge branch 'p1' into 'master'

Update FaceNet.py -- Add an example preprocessor

See merge request !2
parents 19163493 25af8bfd
Pipeline #15852 failed with stages
in 6 minutes 23 seconds
......@@ -52,6 +52,23 @@ class FaceNet(object):
class FaceNetExtractor(FaceNet, Extractor):
pass
extractor = FaceNetExtractor()
And for a preprocessor you can use::
from bob.bio.face.preprocessor import FaceCrop
# This is the size of the image that this model expects
CROPPED_IMAGE_HEIGHT = 160
CROPPED_IMAGE_WIDTH = 160
# eye positions for frontal images
RIGHT_EYE_POS = (46, 53)
LEFT_EYE_POS = (46, 107)
# Crops the face using eye annotations
preprocessor = FaceCrop(
cropped_image_size=(CROPPED_IMAGE_HEIGHT, CROPPED_IMAGE_WIDTH),
cropped_positions={'leye': LEFT_EYE_POS, 'reye': RIGHT_EYE_POS},
color_channel='rgb'
)
"""
def __init__(self,
......
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