hollance / YOLO-CoreML-MPSNNGraph

Tiny YOLO for iOS implemented using CoreML but also using the new MPS graph API.
MIT License
929 stars 251 forks source link

Get multiple outputs from MPSNNGraph #73

Open vincent1bt opened 3 years ago

vincent1bt commented 3 years ago

Hello!, Is there a way to get multiple MPSNNImageNode from a MPSNNGraph?

We can use this function to specify multiple result images:

let graph = MPSNNGraph(device: commandQueue.device, resultImages: [...], resultsAreNeeded: &returnImages)

However, to run the graph the function:

graph.executeAsync(withSourceImages: [inputImage]) { (outputImage, error) in ...

Only has one MPSImage output.

And I can only get the first MPSNNImageNode from the resultImages array in the graph.executeAsync function.

Is there a way to get all the MPSNNImageNode from the resultImages array?

hollance commented 3 years ago

I was under the impression that this was possible these days, but I haven't used MPSNNGraph in ages, so I'm not sure how to do it.