Skip to content

Latest commit

 

History

History
57 lines (50 loc) · 1.61 KB

File metadata and controls

57 lines (50 loc) · 1.61 KB

Architecture

This project is a full-stack face swap web application using modern web and AI technologies.

Overview

  • Frontend: React (Vite), face-api.js for face detection, canvas for visualization.
  • Backend: Flask (Python), InsightFace/inswapper for face swapping, OpenCV for image processing.
  • Model: ONNX format, inswapper_128.onnx.

Data Flow

sequenceDiagram
    participant User
    participant Frontend
    participant Backend
    participant Model
    User->>Frontend: Upload target image
    Frontend->>Backend: POST /detect-faces
    Backend->>Model: Detect faces
    Model-->>Backend: Bounding boxes
    Backend-->>Frontend: Face data (boxes, thumbnails)
    User->>Frontend: Upload replacement faces
    Frontend->>Backend: POST /swap
    Backend->>Model: Swap faces
    Model-->>Backend: Swapped image
    Backend-->>Frontend: Swapped image
    Frontend-->>User: Show result
Loading

Deployment Diagram

flowchart TD
    subgraph Frontend
        A[React App] -->|API Calls| B[Browser]
    end
    subgraph Backend
        C[Flask API] --> D[InsightFace/inswapper]
        C --> E[OpenCV]
        C --> F[Swagger UI]
        C --> G[OpenAPI Spec]
    end
    B -->|HTTP| C
    F -->|Docs| G
Loading

API Documentation

Related Docs


For more details, see the README and other docs in this folder.