symbol.image¶
Image Symbol API of MXNet.
Functions
|
Adjust the lighting level of the input. |
|
Crop an image NDArray of shape (H x W x C) or (N x H x W x C) to the given size. |
|
Defined in src/operator/image/image_random.cc:L195 |
|
Defined in src/operator/image/image_random.cc:L205 |
|
Normalize an tensor of shape (C x H x W) or (N x C x H x W) with mean and standard deviation. |
|
Defined in src/operator/image/image_random.cc:L215 |
|
Defined in src/operator/image/image_random.cc:L246 |
|
Defined in src/operator/image/image_random.cc:L222 |
|
Defined in src/operator/image/image_random.cc:L200 |
|
Defined in src/operator/image/image_random.cc:L210 |
|
Defined in src/operator/image/image_random.cc:L238 |
|
Randomly add PCA noise. |
|
Defined in src/operator/image/image_random.cc:L230 |
|
Resize an image NDArray of shape (H x W x C) or (N x H x W x C) to the given size .. |
|
Converts an image NDArray of shape (H x W x C) or (N x H x W x C) |
-
mxnet.symbol.image.
adjust_lighting
(data=None, alpha=_Null, name=None, attr=None, out=None, **kwargs)¶ Adjust the lighting level of the input. Follow the AlexNet style.
Defined in src/operator/image/image_random.cc:L254
-
mxnet.symbol.image.
crop
(data=None, x=_Null, y=_Null, width=_Null, height=_Null, name=None, attr=None, out=None, **kwargs)¶ Crop an image NDArray of shape (H x W x C) or (N x H x W x C) to the given size. .. rubric:: Example
Defined in src/operator/image/crop.cc:L66
- Parameters
data (Symbol) – The input.
x (int, required) – Left boundary of the cropping area.
y (int, required) – Top boundary of the cropping area.
width (int, required) – Width of the cropping area.
height (int, required) – Height of the cropping area.
name (string, optional.) – Name of the resulting symbol.
- Returns
The result symbol.
- Return type
-
mxnet.symbol.image.
flip_left_right
(data=None, name=None, attr=None, out=None, **kwargs)¶ Defined in src/operator/image/image_random.cc:L195
-
mxnet.symbol.image.
flip_top_bottom
(data=None, name=None, attr=None, out=None, **kwargs)¶ Defined in src/operator/image/image_random.cc:L205
-
mxnet.symbol.image.
normalize
(data=None, mean=_Null, std=_Null, name=None, attr=None, out=None, **kwargs)¶ - Normalize an tensor of shape (C x H x W) or (N x C x H x W) with mean and
standard deviation.
Given mean (m1, …, mn) and std (s:sub:`1, …, sn)` for n channels, this transform normalizes each channel of the input tensor with:
\[ \begin{align}\begin{aligned} output[i] = (input[i] - m\ :sub:`i`\ ) / s\ :sub:`i`\\If mean or std is scalar, the same value will be applied to all channels.\\Default value for mean is 0.0 and stand deviation is 1.0.\end{aligned}\end{align} \]Example
Defined in src/operator/image/image_random.cc:L167
- Parameters
data (Symbol) – Input ndarray
mean (tuple of <float>, optional, default=[0,0,0,0]) – Sequence of means for each channel. Default value is 0.
std (tuple of <float>, optional, default=[1,1,1,1]) – Sequence of standard deviations for each channel. Default value is 1.
name (string, optional.) – Name of the resulting symbol.
- Returns
The result symbol.
- Return type
-
mxnet.symbol.image.
random_brightness
(data=None, min_factor=_Null, max_factor=_Null, name=None, attr=None, out=None, **kwargs)¶ Defined in src/operator/image/image_random.cc:L215
-
mxnet.symbol.image.
random_color_jitter
(data=None, brightness=_Null, contrast=_Null, saturation=_Null, hue=_Null, name=None, attr=None, out=None, **kwargs)¶ Defined in src/operator/image/image_random.cc:L246
- Parameters
data (Symbol) – The input.
brightness (float, required) – How much to jitter brightness.
contrast (float, required) – How much to jitter contrast.
saturation (float, required) – How much to jitter saturation.
hue (float, required) – How much to jitter hue.
name (string, optional.) – Name of the resulting symbol.
- Returns
The result symbol.
- Return type
-
mxnet.symbol.image.
random_contrast
(data=None, min_factor=_Null, max_factor=_Null, name=None, attr=None, out=None, **kwargs)¶ Defined in src/operator/image/image_random.cc:L222
-
mxnet.symbol.image.
random_flip_left_right
(data=None, name=None, attr=None, out=None, **kwargs)¶ Defined in src/operator/image/image_random.cc:L200
-
mxnet.symbol.image.
random_flip_top_bottom
(data=None, name=None, attr=None, out=None, **kwargs)¶ Defined in src/operator/image/image_random.cc:L210
-
mxnet.symbol.image.
random_hue
(data=None, min_factor=_Null, max_factor=_Null, name=None, attr=None, out=None, **kwargs)¶ Defined in src/operator/image/image_random.cc:L238
-
mxnet.symbol.image.
random_lighting
(data=None, alpha_std=_Null, name=None, attr=None, out=None, **kwargs)¶ Randomly add PCA noise. Follow the AlexNet style.
Defined in src/operator/image/image_random.cc:L262
-
mxnet.symbol.image.
random_saturation
(data=None, min_factor=_Null, max_factor=_Null, name=None, attr=None, out=None, **kwargs)¶ Defined in src/operator/image/image_random.cc:L230
-
mxnet.symbol.image.
resize
(data=None, size=_Null, keep_ratio=_Null, interp=_Null, name=None, attr=None, out=None, **kwargs)¶ Resize an image NDArray of shape (H x W x C) or (N x H x W x C) to the given size .. rubric:: Example
Defined in src/operator/image/resize.cc:L71
- Parameters
data (Symbol) – The input.
size (Shape(tuple), optional, default=[]) – Size of new image. Could be (width, height) or (size)
keep_ratio (boolean, optional, default=0) – Whether to resize the short edge or both edges to size, if size is give as an integer.
interp (int, optional, default='1') – Interpolation method for resizing. By default uses bilinear interpolationOptions are INTER_NEAREST - a nearest-neighbor interpolationINTER_LINEAR - a bilinear interpolationINTER_AREA - resampling using pixel area relationINTER_CUBIC - a bicubic interpolation over 4x4 pixel neighborhoodINTER_LANCZOS4 - a Lanczos interpolation over 8x8 pixel neighborhoodNote that the GPU version only support bilinear interpolation(1)
name (string, optional.) – Name of the resulting symbol.
- Returns
The result symbol.
- Return type
-
mxnet.symbol.image.
to_tensor
(data=None, name=None, attr=None, out=None, **kwargs)¶ Converts an image NDArray of shape (H x W x C) or (N x H x W x C) with values in the range [0, 255] to a tensor NDArray of shape (C x H x W) or (N x C x H x W) with values in the range [0, 1]
Example
Defined in src/operator/image/image_random.cc:L92