How to use hand pose classification?

I have watched the 'Classify hand poses and actions with Create ML' from WWDC2021

I was able to create a model using the Create ML app.

But I am not sure how to use it in my iOS project. The video above misses out several steps.

I have the HandPoseRequest working and can get the MLMultiArray of points. I have added the model file to my project and can create a MLModel instance from it.

But the video above shows:

let handPosePredition = try model.prediction(poses: keypointsMultiArray)

What is the type of model ? How was it created? I cannot find any model type that has a function prediction(poses: MLMultiarray)

Thanks.

Replies

Typically I discovered the answer just after posting this question, incase anyone else has the same question.

Use the Xcode generated class after adding the model file to your project. It then has the prediction function seen in the video.

I was just loading the MLModel using the url to the file before, so I think if you do that you need to do some work to convert from the key points to a MLFeatureProvider.