|
@@ -10,7 +10,10 @@ class SurrogateType(enum.Enum):
|
|
|
MIDDLE = enum.auto()
|
|
|
IMAGE = enum.auto()
|
|
|
|
|
|
+ DEFAULT = MIDDLE
|
|
|
+
|
|
|
def __call__(self, im, w, h, dtype=np.uint8):
|
|
|
+ im = utils.asarray(im)
|
|
|
if self is SurrogateType.BLANK:
|
|
|
return self._blank(im, w, h, dtype=dtype)
|
|
|
|
|
@@ -28,7 +31,7 @@ class SurrogateType(enum.Enum):
|
|
|
return np.zeros((h, w, c), dtype=dtype)
|
|
|
|
|
|
def _image(self, im, w, h, dtype):
|
|
|
- _part_surrogate = resize(utils.asarray(im), (h, w),
|
|
|
+ _part_surrogate = resize(im, (h, w),
|
|
|
mode="constant",
|
|
|
anti_aliasing=True,
|
|
|
preserve_range=True)
|