You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

mask.py 1.9KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657
  1. """GAN Mask Transforms."""
  2. from transform.gan import ImageTransformGAN
  3. from config import Config as Conf
  4. class CorrectToMask(ImageTransformGAN):
  5. """Correct -> Mask [GAN]."""
  6. def __init__(self, input_index=(-1,), args=None):
  7. """
  8. Correct To Mask constructor.
  9. :param input_index: <tuple> index where to take the inputs (default is (-1) for previous transformation)
  10. :param args: <dict> args parameter to run the image transformation (default use Conf.args)
  11. """
  12. super().__init__(
  13. (args if args is not None else Conf.args)['checkpoints']["correct_to_mask"],
  14. "correct_to_mask",
  15. input_index=input_index,
  16. args=args
  17. )
  18. class MaskrefToMaskdet(ImageTransformGAN):
  19. """Maskref -> Maskdet [GAN]."""
  20. def __init__(self, input_index=(-1,), args=None):
  21. """
  22. Maskref To Maskdet constructor.
  23. :param input_index: <tuple> index where to take the inputs (default is (-1) for previous transformation)
  24. :param args: <dict> args parameter to run the image transformation (default use Conf.args)
  25. """
  26. super().__init__(
  27. (args if args is not None else Conf.args)['checkpoints']["maskref_to_maskdet"],
  28. "maskref_to_maskdet",
  29. input_index=input_index,
  30. args=args
  31. )
  32. class MaskfinToNude(ImageTransformGAN):
  33. """Maskfin -> Nude [GAN]."""
  34. def __init__(self, input_index=(-1,), args=None):
  35. """
  36. Maskfin To Nude constructor.
  37. :param input_index: <tuple> index where to take the inputs (default is (-1) for previous transformation)
  38. :param args: <dict> args parameter to run the image transformation (default use Conf.args)
  39. """
  40. super().__init__(
  41. (args if args is not None else Conf.args)['checkpoints']["maskfin_to_nude"],
  42. "maskfin_to_nude",
  43. input_index=input_index,
  44. args=args
  45. )