Data preprocessing including images, texts.
Images
Tutorial Datasets
Tensorflow
|
|
Keras
|
|
x_train
has the shape(num_samples,32,32,3)
,y_train
has the shape(num_samples,)
There are two choices normalizing between [-1,1] or using (x-mean)/std. We prefer the former when we know different features do not relate to each other. ref
To accomplish this, we’ll first implement a dedicated Python class to align faces using an affine transformation, where affine transformations are used for rotating, scaling, translating, etc. We’ll then create an example driver Python script to accept an input image, detect faces, and align them.
Face Alignment
Face images need alignment preprocessing such that all faces:
- Be centered in the image.
- Be rotated that such the eyes lie on a horizontal line (i.e., the face is rotated such that the eyes lie along the same y-coordinates).
- Be scaled such that the size of the faces are approximately identical.