We provide abundant data augmentation and processing functions by using Numpy, Scipy, Threading and Queue. However, we recommend you to use TensorFlow operation function like tf.image.central_crop
, more TensorFlow data augmentation method can be found here and tutorial_cifar10_tfrecord.py
. Some of the code in this package are borrowed from Keras.
tensorlayer.prepro
threading_data
rotation rotation_multi crop crop_multi flip_axis flip_axis_multi shift shift_multi
shear shear_multi swirl swirl_multi elastic_transform elastic_transform_multi
zoom zoom_multi brightness brightness_multi
imresize
samplewise_norm featurewise_norm
channel_shift channel_shift_multi
drop
transform_matrix_offset_center apply_transform projective_transform_by_points
array_to_img
find_contours pt2map binary_dilation dilation
pad_sequences process_sequences sequences_add_start_id sequences_get_mask
distorted_images crop_central_whiten_images
threading_data
- These functions only apply on a single image, use
threading_data
to apply multiple threading seetutorial_image_preprocess.py
. - All functions have argument
is_random
. - All functions end with multi , usually be used for image segmentation i.e. the input and output image should be matched.
rotation
rotation_multi
crop
crop_multi
flip_axis
flip_axis_multi
shift
shift_multi
shear
shear_multi
swirl
swirl_multi
elastic_transform
elastic_transform_multi
zoom
zoom_multi
brightness
brightness_multi
imresize
samplewise_norm
featurewise_norm
channel_shift
channel_shift_multi
drop
transform_matrix_offset_center
apply_transform
projective_transform_by_points
array_to_img
find_contours
pt2map
binary_dilation
dilation
More related functions can be found in tensorlayer.nlp
.
pad_sequences
process_sequences
sequences_add_start_id
sequences_get_mask
Note
These functions will be deprecated, see tutorial_cifar10_tfrecord.py
for new information.
distorted_images
crop_central_whiten_images