I am building a basic image recognition app in Swift using the Inception v3 Machine Learning model. I dragged and dropped the Inceptionv3.mlmodel inside my project folder and made sure the "Copy items if needed" option was ticked.
Inside the detect function:
func detect(image: CIImage) {
guard let model = try? VNCoreMLModel(for: Inceptionv3().model) else {
fatalError("Loading CoreML Model Failed!")
}
let request = VNCoreMLRequest(model: model) { (request, error) in
guard let results = request.results as? [VNClassificationObservation] else {
fatalError("Model failed to process")
}
if let firstResult = results.first {
self.navigationItem.title = firstResult.identifier
}
}
I get the following message:
Use of unresolved identifier 'Inceptionv3'
Also when I click on the Inceptionv3.mlmodel file on my project browser I get this message:
Interface generation only available with valid target
But I know it should read something like:
Inceptionv3 (Swift generated source)
With a small arrow next to it that allow you to access the class.
Any ideas?