This commit is contained in:
Philipp Kranen 2016-11-15 18:04:47 +01:00
Родитель b2e18c05a3
Коммит cb4b03b647
1 изменённых файлов: 5 добавлений и 5 удалений

Просмотреть файл

@ -379,7 +379,7 @@ class ImageDeserializer(Deserializer):
jitterType=jitter_type) jitterType=jitter_type)
@staticmethod @staticmethod
def scale(width, height, channels, interpolations='linear', scaleMode="fill", padValue=-1): def scale(width, height, channels, interpolations='linear', scale_mode="fill", pad_value=-1):
''' '''
Scale transform that can be used to pass to `map_features` for data augmentation. Scale transform that can be used to pass to `map_features` for data augmentation.
@ -389,18 +389,18 @@ class ImageDeserializer(Deserializer):
channels (int): channels of the image channels (int): channels of the image
interpolations (str, default 'linear'): possible values are interpolations (str, default 'linear'): possible values are
'nearest', 'linear', 'cubic', and 'lanczos' 'nearest', 'linear', 'cubic', and 'lanczos'
scaleMode (`str`, default 'center'): 'fill', 'crop' or 'pad'. scale_mode (str, default 'fill'): 'fill', 'crop' or 'pad'.
'fill' - warp the image to the given target size. 'fill' - warp the image to the given target size.
'crop' - resize the image's shorter side to the given target size and crops the overlap. 'crop' - resize the image's shorter side to the given target size and crop the overlap.
'pad' - resize the image's larger side to the given target size, center it and pad the rest 'pad' - resize the image's larger side to the given target size, center it and pad the rest
padValue (`int`, default -1): -1 or int value. The pad value used for the 'pad' mode. pad_value (int, default -1): -1 or int value. The pad value used for the 'pad' mode.
If set to -1 then the border will be replicated. If set to -1 then the border will be replicated.
Returns: Returns:
dict describing the scale transform dict describing the scale transform
''' '''
return dict(type='Scale', width=width, height=height, channels=channels, return dict(type='Scale', width=width, height=height, channels=channels,
interpolations=interpolations, scaleMode=scaleMode, padValue=padValue) interpolations=interpolations, scaleMode=scale_mode, padValue=pad_value)
@staticmethod @staticmethod
def mean(filename): def mean(filename):