sagemaker/src/handwriting_line_recognition.py [201:209]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
def handwriting_recognition_transform(image, line_image_size):
    '''
    Resize and normalise the image to be fed into the network.
    '''
    image, _ = resize_image(image, line_image_size)
    image = mx.nd.array(image)/255.
    image = (image - 0.942532484060557) / 0.15926149044640417
    image = image.expand_dims(0).expand_dims(0)
    return image
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



sagemaker/src/utils.py [97:106]:
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -
def handwriting_recognition_transform(image, line_image_size):
    '''
    Resize and normalise the image to be fed into the network.
    '''
    image, _ = resize_image(image, line_image_size)

    image = mx.nd.array(image)/255.
    image = (image - 0.942532484060557) / 0.15926149044640417
    image = image.expand_dims(0).expand_dims(0)
    return image
- - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - -



