Table Of Contents
Table Of Contents


Image Iterators and image augmentation functions

Image processing functions

imdecode(buf, *args, **kwargs) Decode an image to an NDArray.
scale_down(src_size, size) Scales down crop size if it’s larger than image size.
resize_short(src, size[, interp]) Resizes shorter edge to size.
fixed_crop(src, x0, y0, w, h[, size, interp]) Crop src at fixed location, and (optionally) resize it to size.
random_crop(src, size[, interp]) Randomly crop src with size (width, height).
center_crop(src, size[, interp]) Crops the image src to the given size by trimming on all four sides and preserving the center of the image.
color_normalize(src, mean[, std]) Normalize src with mean and std.
random_size_crop(src, size, area, ratio[, …]) Randomly crop src with size.

Image classifiction


ImageIter(batch_size, data_shape[, …]) Image data iterator with a large number of augmentation choices.


CreateAugmenter(data_shape[, resize, …]) Creates an augmenter list.
Augmenter(**kwargs) Image Augmenter base class
SequentialAug(ts) Composing a sequential augmenter list.
RandomOrderAug(ts) Apply list of augmenters in random order
ResizeAug(size[, interp]) Make resize shorter edge to size augmenter.
ForceResizeAug(size[, interp]) Force resize to size regardless of aspect ratio
RandomCropAug(size[, interp]) Make random crop augmenter
RandomSizedCropAug(size, area, ratio[, interp]) Make random crop with random resizing and random aspect ratio jitter augmenter.
CenterCropAug(size[, interp]) Make center crop augmenter.
BrightnessJitterAug(brightness) Random brightness jitter augmentation.
ContrastJitterAug(contrast) Random contrast jitter augmentation.
SaturationJitterAug(saturation) Random saturation jitter augmentation.
HueJitterAug(hue) Random hue jitter augmentation.
ColorJitterAug(brightness, contrast, saturation) Apply random brightness, contrast and saturation jitter in random order.
LightingAug(alphastd, eigval, eigvec) Add PCA based noise.
ColorNormalizeAug(mean, std) Mean and std normalization.
RandomGrayAug(p) Randomly convert to gray image.
HorizontalFlipAug(p) Random horizontal flip.
CastAug([typ]) Cast to float32

Object detection


ImageDetIter(batch_size, data_shape[, …]) Image iterator with a large number of augmentation choices for detection.


CreateDetAugmenter(data_shape[, resize, …]) Create augmenters for detection.
DetBorrowAug(augmenter) Borrow standard augmenter from image classification.
DetRandomSelectAug(aug_list[, skip_prob]) Randomly select one augmenter to apply, with chance to skip all.
DetHorizontalFlipAug(p) Random horizontal flipping.
DetRandomCropAug([min_object_covered, …]) Random cropping with constraints
DetRandomPadAug([aspect_ratio_range, …]) Random padding augmenter.