แก้ไข

แชร์ผ่าน


Apply Image Transformation

This article describes how to use the Apply Image Transformation component in Azure Machine Learning designer, to modify an input image directory based on a previously specified image transformation.

You need to connect an Init Image Transformation component to specify the transformation, and then you can apply such transformation to the input image directory of the Apply Image Transformation component.

How to use Apply Image Transformation

  1. Add the Apply Image Transformation component to your pipeline. You can find this component under Computer Vision/Image Data Transformation category.

  2. Connect the output of Init Image Transformation to the left-hand input of Apply Image Transformation.

    Note

    Only image transformation generated by Init Image Transformation component is accepted to this component. For other kind of transformation, please connect it to Apply Transformation, otherwise 'InvalidTransformationDirectoryError' will be thrown.

  3. Connect the image directory that you want to transform.

  4. For Mode, specify for what purpose you use input transformation: 'For training' or 'For inference'.

    If you select For training, all transformation you specify in Init Image Transformation will be applied.

    If you select For inference, transformation like creating new samples randomly will be excluded before being applied. This is because transformation operations to create new samples randomly like 'Random horizontal flip' are used for data augmentation in training, which should be removed in inference because inference samples need to be fixed for accurate prediction and evaluation.

    Note

    Transformations which will be excluded in mode For inference are: Random resized crop, Random crop, Random horizontal flip, Random vertical flip, Random rotation, Random affine, Random grayscale, Random perspective, Random erasing.

  5. To apply a image transformation to a new image directory, submit the pipeline.

Component parameters

Name Range Type Default Description
Mode Any Mode (Require user to specify) For what purpose you use input transformation. You should exclude 'Random' transform operations in inference but keep them in training

Expected inputs

Name Type Description
Input image transformation TransformationDirectory Input image transformation
Input image directory ImageDirectory Image directory to be transformed

Outputs

Name Type Description
Output image directory ImageDirectory Output image directory

Next steps

See the set of components available to Azure Machine Learning.