<jupyter_start><jupyter_text>How to crop a face<jupyter_code>CROPPED_IMAGE_HEIGHT = 128
CROPPED_IMAGE_WIDTH = 128

EYE_CENTER_POS = (40, 64)
MOUTH_CENTER_POS = (88, 64)


mouth_center=(int((annotations['mouthleft'][0]+annotations['mouthright'][0])/2.0), int((annotations['mouthleft'][1]+annotations['mouthright'][1])/2.0))

eye_center=(int((annotations['leye'][0]+annotations['reye'][0])/2.0), int((annotations['leye'][1]+annotations['reye'][1])/2.0))

annotations['eye_center'] =eye_center

annotations['mouth_center']=mouth_center

light_cnn_face_cropper=bob.bio.face.preprocessor.FaceCrop(
    cropped_image_size=(CROPPED_IMAGE_HEIGHT, CROPPED_IMAGE_WIDTH),
    cropped_positions={'eye_center': EYE_CENTER_POS, 'mouth_center': MOUTH_CENTER_POS})


normalized_image = light_cnn_face_cropper.crop_face( image, annotations=annotations)<jupyter_output><empty_output>
{'fraction_non_alphanumeric': 0.16416184971098266, 'fraction_numerical': 0.03468208092485549, 'mean_word_length': 11.925373134328359, 'pattern_counts': {'":': 0, '<': 5, '<?xml version=': 0, '>': 5, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'chain_length': '1', 'dir': 'jupyter-structured-clean-dedup', 'id': '379117', 'license': 'BSD-3-Clause', 'n_tokens_mistral': 351, 'n_tokens_neox': 330, 'n_words': 32, 'path': 'doc/faq/.ipynb_checkpoints/facecrop-checkpoint.ipynb', 'repo_name': 'bioidiap/bob.bio.face', 'size': '865'}