Post

Replies

Boosts

Views

Activity

Reply to New Vison api - CoreML - "The VNDetectorProcessOption_ScenePrints required option was not found"
I’m encountering the same error with the code below. Interestingly, my previous version, which used VNCoreMLRequest, is working without issues. func makePredictions(for photo: CGImage) async throws -> [ImagePrediction] { guard let imageClassifier = try? MyClassifier(), let imageModelContainer = try? CoreMLModelContainer(model: imageClassifier.model) else { return [] } var request = CoreMLRequest(model: imageModelContainer) request.cropAndScaleAction = .centerCrop let results = try await request.perform(on: photo) guard let observations = results as? [ClassificationObservation] else { return [] } let imagePredictions = observations.map { observation in ImagePrediction( classification: observation.identifier, confidence: observation.confidence ) } return imagePredictions }
Nov ’24