I am building a basic pattern recognition application in Swift using the Inception v3 machine learning model. I dragged Inceptionv3.mlmelel inside my project folder and made sure that the option "Copy items if necessary" is checked.
Inside the detection 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:
Using unresolved identifier 'Inceptionv3'
Also, when I click on the Inceptionv3.mlmel file in my project browser, I get this message:
Creating an interface is only available for an acceptable purpose.
But I know that he should read something like:
Inceptionv3 (source with fast generation)
With a small arrow next to it that allows you to access the class.
Any ideas?
source share