How abdulrazakzakieh/person-finder works
Project Type & Purpose
• This is a full-stack mobile-client/server application.
• The Flutter-based mobile app (Android, iOS, Web, desktop) serves as the client UI.
• A Python/Flask backend hosts two ML models (YOLOv8-Face for detection, FaceNet for verification) and exposes REST endpoints.
File Structure
• person_finder/… – Flutter project with platform folders (android/, ios/, linux/, macos/, web/, windows/) and lib/ where main.dart, Dart APIs (TargetPageAPI.dart, PersonImageUpload.dart) live.
• Server/ – Python Flask application: app.py defines two endpoints (/upload-person-image, /search), requirements.txt, and the YOLOv8 face-detection weights (yolov8n-face.pt).
Extract Key Architectural Insights from README
• Client uploads “target” image → server computes & stores FaceNet embedding.
• Models run on the cloud or local server; mobile communicates over HTTP (optionally through ngrok for tunneling).
Main Components & Their Relationships
a. Components:
• Mobile Client (Flutter UI & Networking)
• REST API Gateway (Flask app)
• Face Detection Module (YOLOv8-Face in PyTorch)
• Face Verification Module (FaceNet embedding in PyTorch)
• Embedding Store (in-memory or persistent store)
• Network (HTTPS / ngrok tunnel)
b. Interactions/Data Flow:
1. User selects “target” image → Client HTTP POST → /upload-person-image →
REST API computes FaceNet embedding → stores embedding.
2. User selects “search” image → Client HTTP POST → /search →
REST API loads YOLOv8 to detect face bboxes → for each bbox crops face → runs FaceNet → compares embeddings to stored target → picks best match above threshold → returns bbox JSON.
c. Architectural Patterns & Principles:
• Client-Server (RESTful) separation
• Modular ML pipeline (detection → verification)
• Stateless API (except stored embedding)
• Single-responsibility services: detection and verification are distinct modules
d. Key Technologies & Libraries:
• Flutter 3.13.0 (Dart)
• HTTP client (Dart’s http or dio)
• Flask (Python)
• PyTorch (YOLOv8, FaceNet)
• ngrok (for local testing)