Skip to content

Latest commit

 

History

History
executable file
·
177 lines (131 loc) · 3.23 KB

prepro.rst

File metadata and controls

executable file
·
177 lines (131 loc) · 3.23 KB

API - Preprocessing

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

pad_sequences process_sequences sequences_add_start_id sequences_get_mask

distorted_images crop_central_whiten_images

Threading

threading_data

Images

  • These functions only apply on a single image, use threading_data to apply multiple threading see tutorial_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

rotation_multi

Crop

crop

crop_multi

Flip

flip_axis

flip_axis_multi

Shift

shift

shift_multi

Shear

shear

shear_multi

Swirl

swirl

swirl_multi

Elastic transform

elastic_transform

elastic_transform_multi

Zoom

zoom

zoom_multi

Brightness

brightness

brightness_multi

Resize

imresize

Normalization

samplewise_norm

featurewise_norm

Channel shift

channel_shift

channel_shift_multi

Noise

drop

Manual transform

transform_matrix_offset_center

apply_transform

projective_transform_by_points

Numpy and PIL

array_to_img

Sequence

More related functions can be found in tensorlayer.nlp.

Padding

pad_sequences

Process

process_sequences

Add Start ID

sequences_add_start_id

Get Mask

sequences_get_mask

Tensor Opt

Note

These functions will be deprecated, see tutorial_cifar10_tfrecord.py for new information.

distorted_images

crop_central_whiten_images