SFaceCompare
SFaceCompare copied to clipboard
11.3
I deleted the example and created a project from the scratch. First I initialized the pod with SFaceCompare and installed. Then opened xcworkspace and imported the mlmodel. I added SFaceCompare.prepareData() to AppDelegate (after importing the SFaceCompare) I checked "zombie objects" on the "edit scheme" pane. (Without doing this, I have faced the same issue again) And wrote the below code:
import UIKit
import SFaceCompare
class ViewController: UIViewController {
let image1 = UIImage(named: "a.jpg")
let image2 = UIImage(named: "b.jpg")
override func viewDidLoad() {
super.viewDidLoad()
if ((image1 != nil) && (image2 != nil)) {
let faceComparator = SFaceCompare(on: self.image1!, and: self.image2!)
faceComparator.compareFaces(succes: { results in
print("SAME")
}, failure: { error in
print("DIFFERENT")
})
}
}
}
(the image files were included into project) It worked fine for the first try. But when I re-run the code without shutdown the simulator (at the second run), I received "Thread 3: EXC_BAD_ACCESS (code=1, address=0x8)" in compareFaces.swift at line 100. The output is: _2019-12-17 13:41:31.738746+0300 MyProject[12588:545206] Metal API Validation Enabled objc[12588]: Class _NSZombie_NSMutableIndexSet is implemented in both ?? (0x6000016bc750) and ?? (0x6000016b83f0). One of the two will be used. Which one is undefined. objc[12588]: Class NSZombie_VNImageAnalyzerCompoundRequestGroupingConfigurations is implemented in both ?? (0x6000016b8f00) and ?? (0x6000016b8f30). One of the two will be used. Which one is undefined. (lldb)
If I shutdown the simulator and run the code, it runs perfect. I face this problem on every second run of the code.
What is the possible cause? Is it about the memory management? But the above code is a very simplified of yours. What did I do wrong or different than you? What do you think?
PS: Xcode version : 11.3 Project format : Xcode 11.0-compatible Deployment target : iOS 13.2 Simulator : iPhone 11 Pro Max
Pls check with new 3.1 version