Connectivity
GuestGo ↔️ AI service status
Live status between the main GuestGo app and this Render deployment.
Local development mode
Main app expected at http://localhost:5173/
Keep Vite running to confirm bidirectional callbacks.
Render deployment
Connected to https://guest-go.vercel.app/
The AI service is serving production traffic.
Need help? Check logs in Render or contact the GuestGo platform team.
Face Detection Models Used
This service utilizes state-of-the-art machine learning models for accurate face detection and recognition.
YOLOv8 / YOLO11
Primary Detection Model
- Ultralytics YOLO (You Only Look Once) architecture
- Real-time object detection optimized for faces
- Models: YOLOv8n-face, YOLO11n-face (nano variants for efficiency)
- Fallback to general YOLOv8n if face-specific models unavailable
- High accuracy with minimal computational overhead
OpenCV
Image Processing Library
- Computer vision and image processing operations
- Image preprocessing and normalization
- Face region extraction and cropping
- Histogram equalization for feature enhancement
- LBP (Local Binary Pattern) feature extraction
NumPy
Numerical Computing
- Array operations and matrix computations
- Feature vector normalization
- Correlation coefficient calculations
- Similarity metric computations
- Efficient numerical processing
Pillow (PIL)
Image Handling
- Image format conversion and decoding
- Base64 image data processing
- Image resizing and optimization
- Color space conversions (RGB, grayscale)
- Memory-efficient image operations
PyTorch
Deep Learning Framework
- Neural network backend for YOLO models
- Tensor operations and GPU acceleration
- Model inference and prediction
- Optimized for CPU execution in production
- Memory-efficient model loading
Flask
Web Framework
- RESTful API endpoints for face detection
- Image upload and processing endpoints
- CORS support for cross-origin requests
- JSON-based communication
- Production-ready with Gunicorn
Model Selection Strategy
The system uses a hierarchical approach to face detection:
- Primary: Attempts to load YOLO face-specific models (yolov8n-face.pt, yolo11n-face.pt) for optimal accuracy
- Fallback: Uses general YOLOv8n model if face-specific models are unavailable
- Secondary: Falls back to MediaPipe Face Detection if YOLO fails or finds no faces
- Optimization: Models are loaded lazily to conserve memory and startup time
MediaPipe Library & How It Works
MediaPipe provides robust face detection capabilities with real-time performance and high accuracy.
What is MediaPipe?
Google's open-source framework for building multimodal ML pipelines
MediaPipe is a cross-platform framework developed by Google that provides ready-to-use machine learning solutions for various tasks including face detection, pose estimation, hand tracking, and more. It's designed for real-time performance on mobile devices, desktops, and edge devices.
Face Detection Module
-
•
Model Selection: Uses
model_selection=1for faces at various distances (0 for close-range, 1 for full-range) -
•
Confidence Threshold: Configurable
min_detection_confidence(default 0.6) filters weak detections - • BlazeFace Architecture: Lightweight CNN optimized for mobile and edge devices
- • Keypoint Detection: Provides 6 facial landmarks (eyes, nose, mouth, ears) for face alignment
How It Works in This Service
- Image Input: Receives RGB image data (numpy array) from uploaded or captured images
- Detection: MediaPipe processes the image and returns detection results with bounding boxes
- Quality Filtering: Validates face size, position, and completeness before acceptance
- Feature Extraction: Extracts face region for correlation-based comparison
- Verification: Compares extracted features using normalized correlation coefficients
MediaPipe Face Detection Process Flow
Image Preprocessing
Input images are converted to RGB format and optionally resized for optimal processing speed. MediaPipe expects images in RGB color space.
Face Detection Inference
MediaPipe's BlazeFace model analyzes the image using a lightweight convolutional neural network. It detects faces and returns bounding boxes with confidence scores and keypoint coordinates.
Result Processing
The system processes detection results, selecting the best face based on confidence score and position. Bounding boxes are converted from relative coordinates (0-1) to absolute pixel coordinates.
Quality Validation
Validates that detected faces meet quality criteria: minimum area ratio (6% of image), proper positioning (not touching borders), and full-face visibility. This ensures reliable feature extraction.
Feature Extraction & Comparison
Extracted face regions are processed using OpenCV for feature extraction (LBP-based). Features are normalized and compared using correlation coefficients to determine similarity and match status.
Advantages of MediaPipe
- Real-time performance on CPU (no GPU required)
- Lightweight and memory-efficient
- Cross-platform support (Windows, Linux, macOS, mobile)
- Robust to various lighting conditions and angles
- Provides facial landmarks for better face alignment
- Well-optimized for production deployments
Configuration & Usage
mediapipe==0.10.8
import mediapipe as mp
mp.solutions.face_detection.FaceDetection()
detector.process(rgb_image)