'Constructor for KeypointBoxCoder.
Args:
num_keypoints: Number of keypoints to encode/decode.
scale_factors: List of 4 positive scalars to scale ty, tx, th and tw.
In addition to scaling ty and tx, the first 2 scalars are used to scale
the y and x coordinates of the keypoints as well. If set to None, does
not perform scaling.'

def __init__(self, num_keypoints, scale_factors=None):

    self._num_keypoints = num_keypoints
    if scale_factors:
        assert (len(scale_factors) == 4)
        for scalar in scale_factors:
            assert (scalar > 0)
    self._scale_factors = scale_factors
    self._keypoint_scale_factors = None
    if (scale_factors is not None):
        self._keypoint_scale_factors = tf.expand_dims(tf.tile([tf.to_float(scale_factors[0]), tf.to_float(scale_factors[1])], [num_keypoints]), 1)
