def get_image_scale(image_size, target_size):
    """
    Calculates the scale of the image to fit the target size.
    `image_size`: The image size as tuple of (w, h)
    `target_size`: The target size as tuple of (w, h).
    :return: The image scale as tuple of (w_scale, h_scale)
    """
    (image_w, image_h) = image_size
    (target_w, target_h) = target_size
    scale = (target_w / float(image_w), target_h / float(image_h))
    return scale