A real-time AI security platform for face recognition, multi-pose enrollment, and attendance logging.
The system combines computer vision and vector search to register people, recognize them from a live camera stream, and maintain attendance records. It also includes an optional security chatbot for querying enrolled people and attendance data.
- Real-time face detection and recognition from webcam video.
- Multi-pose enrollment workflow (10 guided capture steps) with face-quality checks.
- Pose validation using head-pose estimation (pitch, yaw, roll) and facial cues.
- Attendance logging with deduplication for same-day repeated recognitions.
- Admin management APIs and UI for listing/deleting registered persons.
- Optional chatbot endpoint for natural-language queries over enrollment and attendance data.
- Backend:
FastAPI,Uvicorn - Vision:
OpenCV,MediaPipe,keras-facenet(FaceNet),TensorFlow - Vector DB:
ChromaDB - Data storage: CSV files (
persons.csv,attendance.csv) - Frontend: HTML/CSS/JavaScript served as static files
Smart_Security_System/
main.py
requirements.txt
backend/
admin.py
attendance.py
camera.py
chatbot.py
config.py
detection.py
embedding.py
enrollment.py
pose_validation.py
recognition.py
db/
create_chroma_db.py
frontend/
home.html
index.html
chatbot.html
manage_persons.html
script.js
style.css
git clone https://github.com/mak4x13/Smart_Security_System.git
cd Smart_Security_System.git at the end of the URL is optional for GitHub HTTPS cloning; both with and without .git work.
python -m venv venv
venv\Scripts\activate
pip install -r requirements.txtCreate a .env file in the project root.
GROQ_API_KEY=your_key_hereIf you do not use the chatbot, the rest of the system still runs without this key.
uvicorn main:app --host 0.0.0.0 --port 8000Open:
- Home:
http://localhost:8000/ - Dashboard:
http://localhost:8000/dashboard - Chatbot:
http://localhost:8000/chatbot
- Switch dashboard mode to Enrollment.
- Capture guided multi-pose samples (10 stages).
- Confirm enrollment with person metadata.
- Switch to Recognition for live identification.
- Attendance gets logged automatically for recognized identities.
GET /video_feed- MJPEG live streamGET /recognition/live- latest recognition + attendance snapshotPOST /system/mode/{mode}- switchrecognitionorenrollmentPOST /enroll/start- start enrollment sessionPOST /enroll/capture- capture one validated samplePOST /enroll/confirm- finalize enrollmentGET /attendance/today- today attendance recordsGET /admin/persons- list registered personsDELETE /admin/person/{person_id}- delete personPOST /chat- chatbot query
This project is being used for a research workflow focused on improving recognition robustness through multi-pose enrollment:
- Phase 1: real-participant enrollment and logging experiments.
- Phase 2: BIWI dataset-based pose evaluation and benchmarking.
- Camera index defaults to
0inbackend/camera.py. - Runtime data is stored under
backend/db/. - Tune thresholds and detection parameters in
backend/config.pyandbackend/pose_validation.pybased on your camera and environment.
This project is released under the MIT License.