iosauthenticationarkitapple-visionfacial-identification

Compare faces on device


My users need to be able to authenticate themselves using a picture. So that when they create a account on the phone a picture is selected and saved. When they log in a UIImagePickerController() with .sourceType = .camera should take a picture and compare it to the saved picture.
I've found a possible duplicate Link, but this is very old and not really relevant anymore since the introduction of ARKit and Vision..
I has to be done locally so Amazon Rekognition is unfortunately not option, the same goes for Microsoft Cognitive Services & Google's Cloud Vision API.
The Vision Frameworks has a VNFaceObservation class, that can detect faces, but I don't know how one would compare that to a saved one.


Solution

  • Neither ARKit nor Vision provides data that can be reliably used for user identification or authentication.

    (Also, note each has additional constraints: ARKit provides real-time, 3D, high-fidelity facial mapping and tracking, without semantic labeling, but is available only on devices with the TrueDepth front camera — today, that's just iPhone X. Vision provides 2D location, low-fidelity mapping with semantic labeling, using any source of 2D color-only imagery (that is, it doesn't make use of depth maps), and works on any iOS 11 supported device.)

    If you're looking for ways to authenticate users to your app with Face ID (on iPhone X, and presumably any future Face ID devices), look at the LocalAuthentication framework. (And as a possible bonus, implementing Face ID support gets you Touch ID support on other devices for free.)