Connectivity

GuestGo ↔️ AI service status

Live status between the main GuestGo app and this Render deployment.

Environment: Detecting…
Last checked: —
Checking connectivity…

Need help? Check logs in Render or contact the GuestGo platform team.

Step 1 Models & Technologies

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:

  1. Primary: Attempts to load YOLO face-specific models (yolov8n-face.pt, yolo11n-face.pt) for optimal accuracy
  2. Fallback: Uses general YOLOv8n model if face-specific models are unavailable
  3. Secondary: Falls back to MediaPipe Face Detection if YOLO fails or finds no faces
  4. Optimization: Models are loaded lazily to conserve memory and startup time
Step 2 MediaPipe Face Detection

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=1 for 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

  1. Image Input: Receives RGB image data (numpy array) from uploaded or captured images
  2. Detection: MediaPipe processes the image and returns detection results with bounding boxes
  3. Quality Filtering: Validates face size, position, and completeness before acceptance
  4. Feature Extraction: Extracts face region for correlation-based comparison
  5. Verification: Compares extracted features using normalized correlation coefficients

MediaPipe Face Detection Process Flow

1

Image Preprocessing

Input images are converted to RGB format and optionally resized for optimal processing speed. MediaPipe expects images in RGB color space.

2

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.

3

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.

4

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.

5

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

Python Library: mediapipe==0.10.8
Import Statement: import mediapipe as mp
Initialization: mp.solutions.face_detection.FaceDetection()
Processing: detector.process(rgb_image)