I have been reading up on the new Create ML Components documentation, mostly the sample code for 'Counting Human Counting human body action repetitions in a live video feed', which can be found here.
I currently have a body action classifier model built with UIKit/SwiftUI front-end and a relatively complex back-end, but this solution looks far more clean and is 100% SwiftUI - which is a big plus for me.
Based on this sample code and documentation, how would I use my own body action classifier with this sample code? Purely interested and amazed by how lightweight it is and would love to see how a CreateML model could be implemented here.
Hey Doug,
You might try something like:
let model = try MLModel(contentsOf: **your model url**)
let adaptor = try MLModelClassifierAdaptor<Double>(model: model)
let array = MLShapedArray<Double>(**your MLMultiArray**) (see [documentation](https://developer.apple.com/documentation/coreml/mlshapedarray), similar to MLMultiArray).
let results = try await adaptor(array)