title: ARFaceTrackingConfiguration: How to distinguish pictures from real faces?
body: <p>we have several apps in the Store that use <code>ARFaceTrackingConfiguration</code> to detect the users face in iOS devices with FaceID cameras.</p>
  
  <p>As you might have seen, ARKit will also track picture of faces you put in front of your iPad Pro/iPhoneX, as if they were faces. E.g. take a picture from one of <a href="https://apps.apple.com/app/id1463380262" rel="noreferrer">our apps</a> (to replicate one can download&amp;run Apples <a href="https://developer.apple.com/documentation/arkit/tracking_and_visualizing_faces" rel="noreferrer">example app for ARFaceTrackingConfiguration</a>):</p>
  
  <p><a href="https://i.stack.imgur.com/Px6Qh.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/Px6Qh.jpg" alt="FaceMask on Musical Angel"></a></p>
  
  <p>Now I have noticed that internally ARKit treats real faces differently then it does pictures of faces. Because generally (both for <code>ARWorldTrackingConfiguration</code> as well as <code>ARFaceTrackingConfiguration</code>) <code>ARKit</code> tries to match real world sizes and virtual object sizes, i.e. and object that is 10x10cm in your 3D editing software will match a real world object of the same 10x10cm.
  BUT when face-tracking is used, and the phone detects an abnormally sized face (small 4cm wide face as in the picture above or a poster of a person where the face is much bigger) it will scale the FaceGeometry as if the detected face is a normal sized head, i.e. the measurements will be around ~14cm for the head width. All virtual objects will then be scaled accordingly which will make then the wrong size in the real world. C.f. the next picture:</p>
  
  <p><a href="https://i.stack.imgur.com/5kZBm.jpg" rel="noreferrer"><img src="https://i.stack.imgur.com/5kZBm.jpg" alt="Aviator glasses on musical angel"></a> </p>
  
  <p>The glasses 3D model is about 14cm wide, yet they are only presented as a 4cm object.</p>
  
  <p>In comparison, if you put the glasses on a real 3D face, they will be the correct size, on a small persons head (like 12cm) they will be slightly too big, on a big persons head (like 16cm) they will be slightly too small (as they will be their real 14cm in both cases).</p>
  
  <p>I can even see ARKit switching between:</p>
  
  <ol>
  <li><strong>Flat Face-detection using just the camera image</strong></li>
  <li><strong>Face-Detection using the FaceID TrueDepth camera.</strong></li>
  </ol>
  
  <p>which is especially prominent when you hold a baby in front of the app.
  With a babys head, <code>ARKit</code> will first attempt to scale up everything so that the babys head is 14cm wide in the virtual scene and the glasses fit like on an adult.
  Then, usually 1-2s after the head appears in the camera <code>ARFaceTrackingConfiguration</code> will switch from mode (<strong>1</strong>) to mode (<strong>2</strong>) and show the real size of the 3D Object, which leads to supercute pictures of small baby heads with adult sized glasses (not shown here as SO isn't for sharing baby pictures).</p>
  
  <h2>So, now for the question:</h2>
  
  <p>Is there a way of determining whether ARKit is in mode <strong>1</strong> or <strong>2</strong> ?</p>