AUGMENTIMAGES Procedure

Getting Started: AUGMENTIMAGES Procedure

(View the complete code for this example.)

The example in this section shows how to use the AUGMENTIMAGES procedure to artificially increase the size of an image data set, by using existing data, before it is used to train a machine learning model.

The following PROC LOADIMAGES statement loads an image from the specified path into the mylib.image data table, which is specified in the OUTPUT statement. The specified path must be relative to the caslib that is associated with the "mylib" libref:

proc loadimages libref=mylib path='path/to/sample.jpg';
   output out=mylib.image;
run;

Figure 1 shows the original image that is loaded into the mylib.image table.

Figure 1: Original Image

Original Image


The following PROC AUGMENTIMAGES statements generate the augmented images by using mutations and resizing the images to a height of 416 pixels and a width of 416 pixels. The output images are stored in the mylib.augmented_images table.

proc augmentimages data=mylib.image;
   mutate darken rotateright fliphorizontal;
   resize width=416 height=416;
   output out=mylib.augmented_images;
run;

You can then use the DISPLAYIMAGES procedure as follows to display the augmented images:

proc displayimages data=mylib.augmented_images;
run;

Figure 2 shows the output of PROC DISPLAYIMAGES.

Figure 2: Augmented Images

Augmented Images


Last updated: March 26, 2026