Up to now, I have used VNCoreMLRequest to classify images. Now, to improve performance for classification of multiple images, I want to switch to the batch API. It seems that the Vision framework does not support batches and instead, the MLModel has to be used directly.
However, I am struggling to call the API:
[coreMLModel predictionsFromBatch:<#(nonnull id<MLBatchProvider>)#>
options:<#(nonnull MLPredictionOptions *)#>
error:<#(NSError *__autoreleasing _Nullable * _Nullable)#>]
Does anyone have a code sample, especially on how to set up the MLBatchProvider from a bunch of images?
P.S. Objective-C would be preferred, but Swift code is also welcome :-)