createML image augmentation

I am currently exploring createML and the MLImageClassifier. I suppose the documentation is not complete, which is hampering my "discovering" of the proper way of adding MLImageClassifier.ModelParameters. I can manage the maxIterations, but not the augmentationOptions... What is the proper way to declare and use that instance variable? And what are the ranges, units, and significance of MLImageClassifier.ImageAugmentationOptions.blur, exposure, flip, noise, rotation and shear?


Many thanks in advance for enlightening me,


David.

Accepted Reply

Hi David,


The ImageAugmentation options conform to the OptionSet protocol. You should be able to specify them like so:


let augmentationOptions = MLImageClassifier.ImageAugmentationOptions.crop

let parameters = MLImageClassifier.ModelParameters(maxIterations: 5,

augmentationOptions: augmentationOptions)


or:


let parameters = MLImageClassifier.ModelParameters(augmentationOptions: [.crop, .exposure])

Replies

Hi David,


The ImageAugmentation options conform to the OptionSet protocol. You should be able to specify them like so:


let augmentationOptions = MLImageClassifier.ImageAugmentationOptions.crop

let parameters = MLImageClassifier.ModelParameters(maxIterations: 5,

augmentationOptions: augmentationOptions)


or:


let parameters = MLImageClassifier.ModelParameters(augmentationOptions: [.crop, .exposure])