Converting from MultiArray to Image with CoreML Helpers.

MLBoy
1 min readJun 21, 2020
let’s make images from multiArray.

For converting from MultiArray values what outputs of CoreML model to Image, CoreML Helpers are very convenient.

1, Download CoreMLHelpers files from GitHub page above.

2, Copy CoreMLHelpers files in your Xcode project.

It’s O.K. only files you need.

3, Make CGImage from MultiArray values.

let cgimage = multiArray?.cgImage(min: -1, max: 1, channel: nil, axes: (3,1,2))

If MultiArray values are -1…1 , specify (min: -1, max 1). In other case, if they are 0…255 , specify (min: 0, max 255).

Thanks Mr. Hollance.

Please follow my Twitter. https://twitter.com/JackdeS11 And please clap your hands 👏.

--

--