All work

Face Swap Service

Computer vision pipeline that keeps the audio

Role
Personal project
Year
2026
Code
Private repository
frame = face_swapper.get(frame, face, source_face, paste_back=True)
backend/main.py
The swap call, run on every face in every frame

Overview

Upload a reference face and a target video; the service detects the face, swaps it frame by frame, re-encodes the result and merges the original audio back in. A React front end and Docker Compose setup sit around the API.

What I built

Architecture

backend/main.py

Separate image and video endpoints with file type validation.

Hard parts

OpenCV drops audio

OpenCV writes video frames only. The pipeline writes an intermediate silent video, then uses FFmpeg to re-encode it and map the original audio stream back in.

Stack

Known limits