How boobathi-phygit-01/insightface_phytec_board_convertion works
Purpose
Local face-recognition attendance system using TensorFlow Lite models. It captures enrolled face embeddings, performs live camera inference, matches identities against stored embeddings, and records attendance in CSV.
Entry Points
• embedding_capture_tflite.py: enrollment workflow; captures faces and generates known-person embeddings.
• live_inference_tflite.py: live recognition/attendance runtime, likely driven by a webcam feed.
• attendance_system.py: attendance recording/application orchestration.
• tflite_common.py: shared TensorFlow Lite inference and face-processing utilities.
Detection and Recognition Models
The pipeline separates face localization from identity embedding:
• det_500g_640x640_full_quantized.tflite is the quantized 640×640 face detector.
• w600k_mbf_full_quantized.tflite is the quantized face-recognition embedding model.
• tflite_common.py is the architectural boundary for model loading, tensor preparation, inference, and output interpretation used by both enrollment and live recognition.
Enrollment and Identity Store
embedding_capture_tflite.py detects/crops a face, runs the recognition model, and persists its numeric representation with an assigned name:
• known_embeddings.npy stores the enrolled embedding vectors.
• known_names.pkl stores the corresponding identity labels.
This creates an offline local identity database; no remote enrollment service is present.
Live Recognition Flow
live_inference_tflite.py is the operational pipeline:
1. Acquire camera frames.
2. Detect faces using det_500g_640x640_full_quantized.tflite.
3. Generate an embedding per detected face with w600k_mbf_full_quantized.tflite.
4. Compare generated embeddings against known_embeddings.npy.
5. Resolve the matched entry in known_names.pkl.
6. Send recognized identities into attendance handling.
The main control boundary is between real-time vision inference and persistence: inference produces recognized names/confidence-like match results, while attendance logic decides how to record them.
Attendance Persistence
attendance_system.py owns attendance-domain behavior and writes the durable log:
• attendance.csv is the local attendance record.
The CSV is the system’s final output and likely requires duplicate/time handling to avoid repeatedly recording the same continuously visible person.
Runtime and Infrastructure
The repository is a local Python application with TensorFlow Lite model execution and NumPy/Pickle/CSV file persistence. It is designed for on-device or workstation operation with a camera; all models, identity data, and attendance records are repository-local. No server, database, cloud API, or web runtime is represented in the repository.
Main entry points: tflite_common.py TFLite Vision Utilities · live_inference_tflite.py Identity Matching · embedding_capture_tflite.py Embedding Capture · known_embeddings.npy Known Embeddings
Components 11
Enrollment
- Embedding Capture · Enrolls a named person from captured faces.
embedding_capture_tflite.py
Live Recognition
- Live Inference · Runs webcam detection, embedding, and identity matching.
live_inference_tflite.py - Webcam Frames
- Identity Matching · Compares live embeddings with enrolled vectors and resolves names.
live_inference_tflite.py
Local Assets
Repository-local models and persisted data.
- Face Detector · 640×640 face-localization model.
det_500g_640x640_full_quantized.tflite - Face Embedding Model · Produces face identity embeddings.
w600k_mbf_full_quantized.tflite - Known Embeddings · Enrolled face embedding vectors.
known_embeddings.npy - Known Names · Labels aligned with enrolled embeddings.
known_names.pkl - Attendance Log · Durable local attendance output.
attendance.csv
Other components
- TFLite Vision Utilities · Loads models and performs face preprocessing, inference, and output interpretation.
tflite_common.py - Attendance Handler · Applies attendance and duplicate/time recording rules.
attendance_system.py
Connections 12
- Embedding Capture → TFLite Vision Utilities: uses inference utilities
- Embedding Capture → Known Embeddings: writes enrolled vectors
- Embedding Capture → Known Names: writes assigned labels
- TFLite Vision Utilities → Face Detector: loads and runs
- TFLite Vision Utilities → Face Embedding Model: loads and runs
- Webcam Frames → Live Inference: frames
- Live Inference → TFLite Vision Utilities: detects and embeds faces
- Live Inference → Identity Matching: live embeddings
- Known Embeddings → Identity Matching: reference vectors
- Known Names → Identity Matching: identity labels
- Identity Matching → Attendance Handler: recognized identities
- Attendance Handler → Attendance Log: records attendance