From 18fb3d50e1219641a57ce99e8425c2e63e531ca1 Mon Sep 17 00:00:00 2001 From: Katharina Muellek Date: Mon, 3 May 2021 15:56:55 +0200 Subject: [PATCH 1/2] update of depricated init() --- SeeFood-CoreML/ViewController.swift | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/SeeFood-CoreML/ViewController.swift b/SeeFood-CoreML/ViewController.swift index 43b87be..96242a5 100644 --- a/SeeFood-CoreML/ViewController.swift +++ b/SeeFood-CoreML/ViewController.swift @@ -27,7 +27,7 @@ class ViewController: UIViewController, UIImagePickerControllerDelegate, UINavig func detect(image: CIImage) { // Load the ML model through its generated class - guard let model = try? VNCoreMLModel(for: Inceptionv3().model) else { + guard let model = try? VNCoreMLModel(for: MLModel(contentsOf: Inceptionv3.urlOfModelInThisBundle)) else { fatalError("can't load ML model") } From f715a0b440d5f06cc65b50fe3b4cc8905a994b1a Mon Sep 17 00:00:00 2001 From: Katharina Muellek Date: Tue, 8 Jun 2021 16:36:00 +0200 Subject: [PATCH 2/2] update of depricated .init() while complying to offline capabilities --- SeeFood-CoreML/ViewController.swift | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/SeeFood-CoreML/ViewController.swift b/SeeFood-CoreML/ViewController.swift index 96242a5..1a3058b 100644 --- a/SeeFood-CoreML/ViewController.swift +++ b/SeeFood-CoreML/ViewController.swift @@ -27,7 +27,8 @@ class ViewController: UIViewController, UIImagePickerControllerDelegate, UINavig func detect(image: CIImage) { // Load the ML model through its generated class - guard let model = try? VNCoreMLModel(for: MLModel(contentsOf: Inceptionv3.urlOfModelInThisBundle)) else { + guard let mlModel = try? Inceptionv3(configuration: .init()).model, + let model = try? VNCoreMLModel(for: mlModel) else { fatalError("can't load ML model") }