Parsing Results from coreml model returning MLMultiArray

I’m loading and running my coreml model fine. I get the results into a “predictions” variable and they come back as a VNObservation with 1 Value. That one value says that it is a VNCoreMLFeatureObservation. It contains a VNObservation, _featureValue, _featureName. The _featureValue contains the MLMultiArray.

I CAN NOT figure out how to get access to the array. No matter what I do it just keep saying the VNObservation has no member featureValue (which is true) but I haven’t been able to find a way to get access.

Note: this all works fine for me in python. Models works, I’m able to properly decode the MLMulti to get my centers, etc.

If more info is needed for some help, let me know.

( I am clearly new to swift…this return handling seems insanely complicated right now :wink: )

ok…so I made it work. Not sure if there is a better way.

        let new_predictions = predictions as? [VNCoreMLFeatureValueObservation]
        let prediction_multi = new_predictions?[0].featureValue.multiArrayValue
        let key = [0,0,0] as [NSNumber]
        let needed_value = prediction_multi?[key]

I put the key just to show that I could access a value within the multi.

If there are any other suggestions let me know.