There’s several tutorials on this site for using ESP32 camera modules like the ESP32-CAM, the ESP-EYE and the TTGO ESP Cameras. To make it easier to find a project, I’ve listed them below with a short summary. Some of the projects just use the camera to capture images or display video. Some have instructions for face detection and recognition. Face detection is generally a lot simpler because the code is only detecting the presence of a face. Face recognition is more complicated and takes more steps to set up because a face has to be first digitally mapped and saved to the module before it can be used later to ‘remember’ a face.
The easiest project to start with and test your camera is the Camera Web Server example because it’s already set up ready to run. In the Arduino IDE it takes 10 minutes and you can test streaming, face detection and face recognition. The Arduino IDE tutorial is here: https://robotzero.one/esp32-cam-arduino-ide/ If you use the Espressif IDF there’s a tutorial here: https://robotzero.one/esp32-camera-module/
Another option if you just want to record images from the camera and not do face detection or recognition is the time lapse tutorial with three options for saving images: https://robotzero.one/time-lapse-esp32-cameras/
Another easy project is controlling a Sonoff with face detection. You don’t need a Sonoff switch. You could send data to another device or just light an LED instead. This tutorial is here: https://robotzero.one/unlock-door-face-detection-sonoff/
Taking things further a tutorial for face recognition where the person’s face is stored permanently on the device. The Camera Web Server example doesn’t save faces so when the ESP32 is restarted the face data is lost. The tutorial https://robotzero.one/esp32-face-door-entry/ explains how to set up the ESP32 to save faces and also use face recognition to control devices like door locks.
A more advanced system is explained in the tutorial https://robotzero.one/esp-who-recognition-with-names/ where names are saved along with the captured face data. After following this tutorial you can send a message to your mobile phone when a face is recognised using Blynk: https://robotzero.one/face-recognition-with-blynk/
Finally another fairly easy tutorial that only works with the TTGO T-Camera with the PIR movement sensor: https://robotzero.one/ttgo-security-camera-pir/ This one guards your beer or chocolate in the fridge by sending photos if anyone opens the fridge door!