When a xiaomi 15 phone asks to scan your face for phone unlock, it specifically warns that a photo of you may be sufficient to unlock the phone. Not sure how it works with other brands/models, but i don’t think the way they are doing face verification is the right way to do it

Apple's devices use an IR depth scanner, not the camera, and do not expose the data to software.