|
4 | 4 | from typing import Union
|
5 | 5 | from PIL import Image
|
6 | 6 | from collections.abc import Sequence
|
7 |
| -from imgaug import augmenters as iaa |
8 | 7 | import numpy as np
|
9 | 8 |
|
10 | 9 | import torch
|
@@ -36,8 +35,6 @@ def transform_mapping(key, args):
|
36 | 35 | return [PairedRandomRot90(args)]
|
37 | 36 | elif key == 'randomerase':
|
38 | 37 | return [PairedRandomErasing(**args)]
|
39 |
| - elif key == 'changecolor': |
40 |
| - return [ChangeColorSpace(args)] |
41 | 38 | elif key == 'totensor' and args:
|
42 | 39 | return [PairedToTensor()]
|
43 | 40 | else:
|
@@ -66,22 +63,6 @@ def __call__(self, imgs):
|
66 | 63 | return self.to_tensor(imgs)
|
67 | 64 |
|
68 | 65 |
|
69 |
| -class ChangeColorSpace: |
70 |
| - """Pair version of center crop""" |
71 |
| - def __init__(self, to_colorspace): |
72 |
| - self.aug_op = iaa.color.ChangeColorspace(to_colorspace) |
73 |
| - |
74 |
| - def __call__(self, imgs): |
75 |
| - if _is_pair(imgs): |
76 |
| - for i in range(len(imgs)): |
77 |
| - tmpimg = self.aug_op.augment_image(np.array(imgs[i])) |
78 |
| - imgs[i] = Image.fromarray(tmpimg) |
79 |
| - return imgs |
80 |
| - else: |
81 |
| - imgs = self.aug_op.augment_image(np.array(imgs)) |
82 |
| - return Image.fromarray(imgs) |
83 |
| - |
84 |
| - |
85 | 66 | class PairedCenterCrop(tf.CenterCrop):
|
86 | 67 | """Pair version of center crop"""
|
87 | 68 | def forward(self, imgs):
|
|
0 commit comments