Core ML's missing utility belt, copy-paste style
A grab-bag of Swift helpers for the sharp edges Apple left around CVPixelBuffer, MLMultiArray, and NMS.

What it does
CoreMLHelpers is a loose collection of Swift files for common Core ML chores: converting images to CVPixelBuffer and back, turning MLMultiArray into something you can actually look at, running non-maximum suppression on bounding boxes, and extracting top-k predictions without writing the same argmax loop for the hundredth time. There’s also an experimental SwiftyMultiArray wrapper that tries to make Apple’s tensor type feel less like a C struct wearing a Swift costume.
The interesting bit The author openly calls it a “hodgepodge” and refuses to package it as SPM, CocoaPods, or Carthage. The intended workflow is almost aggressively old-school: copy the one or two files you need, paste them in, and adapt. This is either liberating or annoying depending on your tolerance for manual dependency hygiene.
Key highlights
- Image ↔
CVPixelBufferconversion utilities MLMultiArrayto image rendering (useful for visualizing segmentation masks or heatmaps)- Top-k, argmax, and other “handy functions” for classification outputs
- Non-maximum suppression for object detection post-processing
- Experimental
SwiftyMultiArraywith numpy-like aspirations - MIT licensed, 2017–2021
Caveats
- Explicitly described as demonstration code you will likely need to customize
- No unit tests (listed in TODO)
MultiArraybugs acknowledged in TODO, with more numpy-like functionality promised but not yet delivered- Last meaningful update appears 2021 based on copyright; may not reflect latest Core ML API changes
Verdict Worth bookmarking if you’re shipping Core ML on iOS and keep rewriting the same pixel-buffer boilerplate. Skip it if you need a polished, versioned dependency with test coverage and active maintenance — this is a reference drawer, not a framework.
Frequently asked
- What is hollance/CoreMLHelpers?
- A grab-bag of Swift helpers for the sharp edges Apple left around CVPixelBuffer, MLMultiArray, and NMS.
- Is CoreMLHelpers open source?
- Yes — hollance/CoreMLHelpers is open source, released under the MIT license.
- What language is CoreMLHelpers written in?
- hollance/CoreMLHelpers is primarily written in Swift.
- How popular is CoreMLHelpers?
- hollance/CoreMLHelpers has 1.4k stars on GitHub.
- Where can I find CoreMLHelpers?
- hollance/CoreMLHelpers is on GitHub at https://github.com/hollance/CoreMLHelpers.