Commit 55f052

2025-11-28 13:25:31 Kirti: Added Table
Projects/Face Recognation.md ..
@@ 13,24 13,24 @@
## Overview
- Objective
+ #### Objective
* Build a **real-time face recognition system** leveraging AI to identify and verify individuals from live camera feeds.
- Purpose
+ #### Purpose
* Address the increasing need for **secure and automated identity management** across industries such as:
* Security and surveillance
* Access control systems
* Attendance tracking
* Personalized customer services
- Key Features
+ #### Key Features
* Integration of **advanced face recognition models** with a **scalable system architecture**.
* Real-time detection, recognition, and alerting with **millisecond response time**.
* Capability to process and manage **large volumes of video streams** efficiently.
* Focus on **speed, accuracy, and reliability** in recognition results.
* Ensures **data privacy and secure handling** of user information.
- Outcome
+ #### Outcome
* Provides a dependable and intelligent solution for automated face recognition and event management.
## The Problem
@@ 77,9 77,9 @@
APIs Used: Webhooks, REST API via API Gateway
## Project Architecture
- System Architecture Overview
+ ### System Architecture Overview
- External Systems
+ #### External Systems
* '''Cameras (outside system)'''
* Stream video into your system.
@@ 91,54 91,54 @@
----
- Your System Components
+ ### Your System Components
- API Gateway
+ #### API Gateway
* Entry point for external users.
* Handles:
* Authentication
* Throttling
* Request routing
- Camera Streamer
+ #### Camera Streamer
* Ingests live video feed from external cameras.
* Converts/normalizes streams (RTSP/RTMP → internal processing format).
- Face Recognition Service (Core AI Engine)
+ #### Face Recognition Service (Core AI Engine)
* Processes frames from the Camera Streamer.
* Detects and recognizes faces.
* Generates events:
* Match / No Match
* Alerts
- Database
+ #### Database
* Stores:
* User profiles
* Face embeddings
* Recognition logs
* Camera metadata
- Webhook Dispatcher
+ #### Webhook Dispatcher
* Sends recognition results/events back to external systems in real-time.
- Message Queue (Recommended Addition)
+ #### Message Queue (Recommended Addition)
* Decouples:
* Camera Streamer → Face Recognition → Webhook Dispatch
* Ensures:
* Reliability
* Smooth handling of spikes in video frames/events
- Monitoring & Logging
+ #### Monitoring & Logging
* Collects system logs and metrics.
* Tools: Grafana, Kibana, etc.
- Frontend (FE)
+ #### Frontend (FE)
* Connects to the **API Gateway** for user interaction via UI.
----
- Data Flow
+ ### Data Flow
External Cameras → Camera Streamer → Message Queue → Face Recognition Service → Webhook Dispatcher → External Systems
@@ 248,3 248,56 @@
****
+
+
+ Real-time face detection and recognition service that captures video from cameras, detects faces, matches them against a database, and logs all events.
+
+ Image Storage Format
+ Database Table: faces
+
+ | What's Stored | Column Type | Format | Size |
+ | --------------| ------------|-------------------------------------|------------------|
+ | Photos (JPEG) | BYTEA | Raw binary bites | ~50 KB each
+ | Face Encodings| BYTEA | Pickled NumPy array (128 numbers) | ~9 KB each |
+
+ Each person has 3 photos + 3 encodings
+ Photos stored as raw JPEG binary (NOT base64)
+ Encodings stored as pickled NumPy arrays (128-dimensional vectors)
+ Face Recognition Process
+ Library Used: face_recognition (built on dlib)
+
+ How It Works:
+
+ Upload Phase (via API):
+
+
+ Upload Photo → Extract Face → Generate 128 numbers → Store in DB
+ Recognition Phase (real-time):
+
+
+ Camera Frame → Detect Face → Generate 128 numbers → Compare with DB → Match Found? → Log Event
+ Matching:
+
+ Compares 128-number vectors using Euclidean distance
+ Distance < 0.6 = Match
+
+ ✅Confidence = 1 - distance (e.g., 0.3 distance = 70% confidence)
+ Key Components
+ Camera Service - Captures RTSP video streams
+ Face Detection - Finds faces in frames
+ Face Matcher - Compares faces with database (in-memory cache)
+ Database - Stores faces, encodings, and events
+ API - 15 REST endpoints for management
+ Storage Summary
+
+ ✅ Images: Raw JPEG bytes in database
+
+ ✅ Encodings: Pickled 128-number arrays
+
+ ✅ Recognition: face_recognition library (dlib backend)
+
+ ✅ Matching: Vector comparison (Euclidean distance)
+
+ ✅ Performance: In-memory cache, ~99% accuracy
+
+ Bottom Line: Photos stored as binary, converted to 128 numbers for matching using industry-standard face recognition library! 🎯
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9