3

I have faced the issue of real face detection using Vision Framework. I have referred below apple link.

https://developer.apple.com/documentation/vision/tracking_the_user_s_face_in_real_time

I used demo code provided in above link. I see, Camera can detect the face from printed photo or passport photo. It is not real face photo. How can I know if this is not real face in camera using Vision framework?

Andy Jazz
  • 49,178
  • 17
  • 136
  • 220
Dipang
  • 1,111
  • 12
  • 12

3 Answers3

3

You can use https://developer.apple.com/documentation/arkit/arfacegeometry

This will create a 3D mesh of a human face. A 3D mesh will have different values (e.g. vertices , triangleIndices), in its topology compared to a 2D picture.

David Borden
  • 131
  • 3
2

Here is a project link

here I have used camera API for face detection and eye blinking. you can check and customize according to your requirement.

Update: Here is another project for liveness Check using MLKit link

Asif Newaz
  • 557
  • 7
  • 17
1

Vision + RealityKit

Apple Vision framework has been processing "2D requests". It works only with RGB channels. If you need to process 3D surfaces you have to implement LiDAR scanner API, that based on Depth principles. It will allow you to distinguish between a photo and a real face.

I think that Vision + RealityKit is the best choice for you, because you can detect a face (2D or 3D) at first stage in Vision, and then using LiDAR, it's quite easy to find out whether normals of polygonal faces are directed in the same direction (2D surface), or in different directions (3D head).

Andy Jazz
  • 49,178
  • 17
  • 136
  • 220