<commit_before>

# def crop_image(img, picture_size):
#     """Crops datapoint

#     :param datapoint: Datapoint to transform
#     :param picture_size: Output picture square dimension
#     """
#     w, h = img.size
#     crop_x = #random.randint(0, w - picture_size)
#     crop_y = #random.randint(0, h - picture_size)
#     img = img.crop((crop_x, crop_y, picture_size + crop_x, picture_size + crop_y))    
#     return img

def resize_image(img, picture_size):
    img = datapoint['image']
    width, height = img.size[:2]

    if height>width:
        resized_height = picture_size
        resized_width = round(picture_size*width/height)
    else:  # height<= width:
        resized_height = round(picture_size*height/width)
        resized_width = picture_size

    img = img.resize((resized_width,resized_height), Image.ANTIALIAS)
    #img = img.crop((0, 0, picture_size, picture_size))

    return img

landmarks = resize_landmarks(landmarks, camera_image_size, resized_image_size)
    width, height = camera_image_size[:2]<commit_msg>small update<commit_after>from keras.models import load_model
import argparse

args = argparse.ArgumentParser()
args.add_argument("model_path")
args = args.parse_args()

model = load_model(args.model_path)
print(model.inputs)


def resize_image(img, picture_size):
    img = datapoint['image']
    width, height = img.size[:2]

    if height>width:
        resized_height = picture_size
        resized_width = round(picture_size*width/height)
    else:  # height<= width:
        resized_height = round(picture_size*height/width)
        resized_width = picture_size

    img = img.resize((resized_width,resized_height), Image.ANTIALIAS)
    #img = img.crop((0, 0, picture_size, picture_size))

    return img

landmarks = resize_landmarks(landmarks, camera_image_size, resized_image_size)
    width, height = camera_image_size[:2]
{'fraction_non_alphanumeric': 0.10921683537559936, 'fraction_numerical': 0.005327650506126798, 'mean_word_length': 3.942105263157895, '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}}
{'dir': 'git-commits-cleaned', 'id': '5154085', 'n_tokens_mistral': 639, 'n_tokens_neox': 624, 'n_words': 127}