def _transform_to_aug(tfm_or_aug):
    """
    Wrap Transform into Augmentation.
    Private, used internally to implement augmentations.
    """
    assert isinstance(tfm_or_aug, (Transform, Augmentation)), tfm_or_aug
    if isinstance(tfm_or_aug, Augmentation):
        return tfm_or_aug
    else:

        class _TransformToAug(Augmentation):
            def __init__(self, tfm: Transform):
                self.tfm = tfm

            def get_transform(self, *args):
                return self.tfm

            def __repr__(self):
                return repr(self.tfm)

            __str__ = __repr__

        return _TransformToAug(tfm_or_aug)

    Wrap Transform into Augmentation.
    Private, used internally to implement augmentations.
    
video_chat_with_StableLM/models/grit_src/third_party/CenterNet2/detectron2/data/transforms/augmentation.py