This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
public func handleClassification(request: VNRequest, error: Error?) { | |
guard let observations = request.results as? [VNClassificationObservation] | |
else { fatalError("unexpected result type from VNCoreMLRequest") } | |
guard let best = observations.first else { | |
fatalError("classification didn't return any results") | |
} | |
DispatchQueue.main.async { | |
if best.identifier.starts(with: "Unknown") || best.confidence < 0.50 { |
OlderNewer