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:
        return _TransformToAug(tfm_or_aug)

    Wrap Transform into Augmentation.
    Private, used internally to implement augmentations.
    
ControlNet-v1-1-nightly/annotator/oneformer/detectron2/data/transforms/augmentation.py