Face ID is a facial recognition system created by Apple that allows users to unlock their phone but also to pay (Apple Pay) or download applications. Face ID is applied from the iPhone X and has replaced Touch ID because it is safer, in fact, there is only 1 chance in 1 million that another person will unlock your iPhone with Face ID (except for twins), against 1 in 50000 with Touch ID. Don't forget that Face ID is an option that is not mandatory (you can remove it in the settings), the code of your phone still exists and is required if Face ID does not recognize you. Moreover, for the iPhone X only one Face can be entered in the phone against 2 for the newer iPhones.
Face ID is for Apple users, you can have it on your Iphone or your Ipad.
When you have your new Iphone, it asks you if you first want to use Face ID and so enter your face or not, as I said before it's not mandatory. Then if you accept you have to follow what your Iphone indicates you and turn your head to the left, right, top and bottom and after less than 5 min your Face ID is ready. You can keep your glasses while doing it especially if you wear them everyday. The second Face ID developed in the new Iphones is in fact for you to enter your face in different situation for example when you have your glasses and when you take them off.
Face ID technology works by projecting 30000 infrared dots on the user's face with the dot projector, situated next to the front camera. The flood illuminator is an infrared light (invisible for our eyes), thanks to it your phone can detect your face even in the dark. The infrared camera reads the dots and creates a 3D model of your face. Then, this data is stored in "Secure Enclave" (this area is inaccessible) located within the Apple A11 Bionic processor. ( A14 Bionic chip for the iPhone 12 ) .
We could make a low fidelty version of Face ID with p5.js and MobileNet. As it can recognize an image, we could train a prototype to recognize your face among different faces. But this prototype will only tell if yes or no it's you and is not going to unlock your phone.