A real-time face recognition and gaze-tracking surveillance system with a Tkinter GUI. Built using OpenCV, dlib, and face_recognition, it detects known and unknown individuals, tracks gaze direction, and flags suspicious activity.
- β Save and register known faces via GUI
- Real-time face detection and identification
- Eye gaze tracking using facial landmarks (dlib)
- π¨ Flags and pauses on 5 off-focus gaze violations
- Saves session metadata and violation snapshots
- Tkinter-based GUI for easy control and visualization
- ποΈ Saves frame-by-frame recordings in session folders
- SAVE FACE β Captures and registers a new known face.
- START β Begins surveillance session.
- STOP β Stops surveillance without closing the app.
- RESUME β Manually resumes after 5 gaze-off violations.
- EXIT β Safely closes the app and saves session data.
facedetection/
βββ known_faces/ # saved known faces
β βββ JOHN.jpg
βββ sessions/
β βββ 2025-05-12_1510/
β βββ frame_00001.jpg
β βββ unknown_151202.jpg
β βββ gaze_violation_151310.jpg
β βββ metadata.json
Using pip:
pip install face_recognition dlib opencv-python numpy Pillow Using conda:
conda install -c conda-forge face_recognition dlib opencv numpy pillow Note: You must also download the facial landmarks model.
Place the following file in the same directory as your Python script:
shape_predictor_68_face_landmarks.dat
π Download: https://github.com/davisking/dlib-models/raw/master/shape_predictor_68_face_landmarks.dat
Run the application:
face detect.ipynb