Privacy-First. GPU-Accelerated. 100% Local.
- π Overview
- β¨ Core Features
- π Getting Started
- π½οΈ Transformation Showcase
- ποΈ System Architecture
- π Technical Benchmark: GPU vs. CPU
- π Validation & Realism Constraints
- ποΈ Slide Presentation Generator
- π Project Architecture
- βοΈ Tuning Configurations
- π€ About the Author
PersonaForge AI is an advanced computer vision engineering project designed to run high-fidelity face transformations entirely on local consumer hardware. By decoupling heavy AI dependencies and implementing a robust Hardware Abstraction Layer, the system dynamically schedules execution between GPU (CUDA-accelerated) and CPU branches.
This project is built for AI engineers, recruiters, and open-source contributors looking to explore high-throughput local inference pipelines without relying on external cloud APIs or exposing private media files.
- π Privacy-First Operations: 100% offline. Zero tracking pixels, zero API calls, and zero external cloud uploads.
- βοΈ Hardware-Aware Execution: A custom initialization engine that detects local environment bindings and dynamically routes frame arrays to CUDA execution providers or CPU fallbacks.
- β‘ In-Memory Streaming (RAM I/O): Bypasses standard disk-writing bottleneck loops by buffering frames in RAM and piping them directly to FFmpeg stdin via standard stream buffers.
- π Facial Identity Consistency: Automatically computes the Cosine Similarity between the source identity embedding and every processed target frame face node to log identity drift statistics.
- π¨ Kernelized Correlation Filter (KCF) Tracking: Reduces expensive facial detection calls (InsightFace inference loops) by 90% by using adaptive KCF tracking blocks on intermediate frames.
To install dependencies, download model weights, set up the FastAPI server, run the Streamlit dashboard, or profile execution providers, please refer to our step-by-step PersonaForge AI Getting Started Guide.
Here is a demo loop showing the input and high-fidelity output alignment:
The application is structured into decoupled frontend presentation, API gateway, and model runtime layers.
The modular pipeline manages frame ingestion, boundary box extraction, model embedding, Poisson blending, and final audio MUXing.
Tip
Why KCF Face Tracking? running face detection models (InsightFace) on every frame is the primary CPU bottleneck. By introducing Kernelized Correlation Filters (KCF) to track boundary boxes across intermediate frames, we avoid calling the heavy detection networks on 9 out of 10 frames, increasing processing throughput by 90% on laptops.
| Metric | π₯ GPU Pipeline (High-Fidelity) | π¨ CPU Pipeline (Optimized) |
|---|---|---|
| Primary Platform | Workstations / Compute Servers | Consumer Laptops / Prototyping |
| Max Target Resolution | Original / 1080p / 4K | 720p (Adaptive Downscale) |
| Enc. Audio MUX Bitrate | 12 Mbps (High Fidelity) | 6 Mbps (Web-Optimized) |
| Edge Blending Mode | Poisson (SeamlessClone) | Direct Feathered Alpha-Paste |
| Face Detection Loop | Frame-by-Frame Precision | KCF Tracker (1-in-10 detection) |
| Execution Performance | ~40 seconds (10s video @ 30fps) | ~110 seconds (10s video @ 30fps) |
To set realistic expectations, we track and report edge cases where face transformation fidelity may drift:
| Scenario | Success Rate | System Pipeline Behavior |
|---|---|---|
| Centric Face Orientation | π’ 99% | Perfect alignment, facial landmark match, and edge blending. |
| Extreme Profile Angle | π‘ 70% | Identity drifts if landmarks or eye vertices are occluded. |
| Low-Light / Film Grain | π‘ 75% | Minor boundary seams may become visible during Poisson cloning. |
| Rapid Head Motion | π΄ 60% | KCF tracker fallback triggers full InsightFace redetection. |
| Multi-Face Crowd Scenes | π’ 90% | Configurable target selection indices (ordered by face area size). |
The codebase includes an automated presentation slide generator utilizing Playwright. This tool compiles our CSS slide design template into 11 premium vertical presentation slides (designed at 1080x1350, exported at 4K-density 2160x2700 for maximum clarity).
- Initialize the virtual environment and install Playwright requirements (see docs/guide.md).
- Execute the python generator script:
python scripts/generate_carousel.py
- Find the rendered slides in the
outputs/carousel/directory.
pipelines/: Contains execution scriptspipeline_gpu.py(CUDA) andpipeline_cpu.py(CPU).config/: Central parameter profilesconfig_cpu.pyandconfig_gpu.py.models/:model_manager.pyhandles model checks, folder creation, and auto-downloads.utils/: Shared functions including the correlation tracking factorytracker_factory.py.scripts/: Automation tools likegenerate_carousel.pyfor rendering social media carousel decks.
Fine-tune execution variables inside config/ profiles:
# config_cpu.py parameters
PROCESS_EVERY_N_FRAMES = 3 # Skip detection frames for performance
TARGET_HEIGHT = 720 # Downscale input target resolution
DET_SIZE = (320, 320) # Bound detector inference size
# config_gpu.py parameters
USE_SEAMLESS_CLONE = True # Enable high-fidelity Poisson cloning
BITRATE = "12M" # Render export bitrate
|
Artificial Intelligence & Data Science Engineer Passionate about computer vision, real-world localized model deployment, and high-performance pipeline architecture. |
- InsightFace for state-of-the-art 2D and 3D face analysis.
- ONNX Runtime for high-performance localized neural network inference.
- FastAPI Framework for serving our local endpoints.
- FFmpeg for specialized video stream demuxing and encoding.
- OpenCV for pixel-level frame manipulation and correlation tracking.
- The open-source computer vision community.
PersonaForge AI β Engineering High-Fidelity Identity



