3 Nb @s>ddlmZmZddljZGdddeZGdddeZdS))DualIAATransformto_tupleNc s6eZdZdZdfd d ZeddZddZZS) IAAAffine2aaPlace a regular grid of points on the input and randomly move the neighbourhood of these point around via affine transformations. Note: This class introduce interpolation artifacts to mask if it has values other than {0;1} Args: p (float): probability of applying the transform. Default: 0.5. Targets: image, mask ffffff??N皙?rreflectF?c sftt|j| | t||d|_t|d|_t|d|_t||_t||d|_ ||_ ||_ ||_ dS)N)xyr) superr__init__dictscalertranslate_percent translate_pxrotateshearordercvalmode) selfrrrrrrrr always_applyp) __class__A/home/ec2-user/SageMaker/lama/saicinpainting/training/data/aug.pyrs    zIAAAffine2.__init__c Cs(tj|j|j|j|j|j|j|j|j S)N) iaaAffinerrrrrrrr)rrrr processor(szIAAAffine2.processorcCsd S) Nrrrrrrrr)rrrrrrrrr)rrrrget_transform_init_args_names5sz(IAAAffine2.get_transform_init_args_namesrr皙r$r) r#NNrr%r rr Fr ) __name__ __module__ __qualname____doc__rpropertyr!r" __classcell__rr)rrrs  rcs6eZdZdZdfd d Zed d ZddZZS)IAAPerspective2aPerform a random four point perspective transform of the input. Note: This class introduce interpolation artifacts to mask if it has values other than {0;1} Args: scale ((float, float): standard deviation of the normal distributions. These are used to sample the random distances of the subimage's corners from the full image's corners. Default: (0.05, 0.1). p (float): probability of applying the transform. Default: 0.5. Targets: image, mask 皙?皙?TF?r r replicatecs4tt|j||t|d|_||_||_||_dS)Ng?)rr,rrr keep_sizerr)rrr1rrrrr)rrrrGs  zIAAPerspective2.__init__cCstj|j|j|j|jdS)N)r1rr)rPerspectiveTransformrr1rr)rrrrr!OszIAAPerspective2.processorcCsdS)Nrr1)rr1r)rrrrr"Ssz-IAAPerspective2.get_transform_init_args_namesr-r.)r3TFr/r rr0) r&r'r(r)rr*r!r"r+rr)rrr,9s   r,)albumentationsrrZimgaug.augmenters augmentersrrr,rrrrs 5