def get_transform(self, img):
        """
        Instantiate a :class:`Transform` object to be used given the input image.
        Subclasses should implement this method.

        The :class:`ImageAugmentor` often has random policies which generate deterministic transform.
        Any of those random policies should happen inside this method and instantiate
        an actual deterministic transform to be performed.
        The returned :class:`Transform` object should perform deterministic transforms
        through its :meth:`apply_*` method.

        In this way, the returned :class:`Transform` object can be used to transform not only the
        input image, but other images or coordinates associated with the image.

        Args:
            img (ndarray): see notes of this class on the requirements.

        Returns:
            Transform
        """
        # This should be an abstract method
        # But we provide an implementation that uses the old interface,
        # for backward compatibility
        log_once("The old augmentor interface was deprecated. "
                 "Please implement {} with `get_transform` instead!".format(self.__class__.__name__),
                 "warning")

        def legacy_augment_coords(self, coords, p):
            try:
                return self._augment_coords(coords, p)
            except AttributeError:
                pass
            try:
                return self.augment_coords(coords, p)
            except AttributeError:
                pass
            return coords  # this is the old default

        p = None  # the default return value for this method
        try:
            p = self._get_augment_params(img)
        except AttributeError:
            pass
        try:
            p = self.get_augment_params(img)
        except AttributeError:
            pass

        from .transform import BaseTransform, TransformFactory
        if isinstance(p, BaseTransform):  # some old augs return Transform already
            return p

        return TransformFactory(name="LegacyConversion -- " + str(self),
                                apply_image=lambda img: self._augment(img, p),
                                apply_coords=lambda coords: legacy_augment_coords(self, coords, p))

        Instantiate a :class:`Transform` object to be used given the input image.
        Subclasses should implement this method.

        The :class:`ImageAugmentor` often has random policies which generate deterministic transform.
        Any of those random policies should happen inside this method and instantiate
        an actual deterministic transform to be performed.
        The returned :class:`Transform` object should perform deterministic transforms
        through its :meth:`apply_*` method.

        In this way, the returned :class:`Transform` object can be used to transform not only the
        input image, but other images or coordinates associated with the image.

        Args:
            img (ndarray): see notes of this class on the requirements.

        Returns:
            Transform
        
tensorpack/dataflow/imgaug/base.py