Skip to content

ishan739/FaceFlux

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

4 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

FaceFlux

Real-time face filters for Android using MediaPipe's 468-point facial landmark detection. Snap on glasses, noses, and more — all tracking your face in live camera preview.


What It Does

FaceFlux overlays AR filters on your face in real time using the device camera. It uses MediaPipe's Face Mesh model to detect 468 precise facial landmarks — and maps filter assets (glasses, noses, accessories) directly onto the right points on your face, frame by frame.

No cloud processing. Everything runs on-device.


Tech Stack

Language Kotlin
Platform Android
Face Tracking MediaPipe Face Mesh (468 landmarks)
Rendering Android Canvas / Custom View
Camera CameraX

How It Works

MediaPipe Face Mesh

MediaPipe's Face Mesh model returns 468 3D landmarks per frame — each one a precise point on the face (eye corners, nose tip, lip edges, cheekbones, etc.). FaceFlux uses specific landmark indices to anchor filter assets to the right anatomical positions.

Camera Frame
     │
     ▼
MediaPipe Face Mesh
     │
     ▼
468 Landmark Points (x, y, z per point)
     │
     ▼
Map assets to landmark positions
(glasses → eye landmarks, nose → tip landmark, etc.)
     │
     ▼
Draw overlay on Canvas → Live Preview

Filter Anchoring

Each filter asset is anchored to specific landmark indices:

Filter Anchored To
Glasses Left eye corner → Right eye corner
Nose Nose tip landmark
Accessories Forehead / chin landmarks

Asset scale and rotation are calculated dynamically per frame — so the filter moves, scales, and rotates naturally as you move your head.


Features

  • Real-time face tracking at camera frame rate
  • Multiple filter types — glasses, noses, accessories
  • Accurate landmark-based anchoring — filters stick to the right face region
  • Fully on-device — no network calls, no latency
  • Works with front camera live preview

Getting Started

Prerequisites

  • Android Studio (latest stable)
  • Android device or emulator with camera support
  • Min SDK: 21+

Run the App

git clone https://github.com/ishan739/FaceFlux.git

Open in Android Studio → Run on device or emulator.

Camera permission is required on first launch.


Project Structure

app/
 └── src/main/
      ├── java/         # Kotlin source — camera, landmark processing, filter rendering
      ├── res/          # Filter assets, layouts
      └── AndroidManifest.xml

Future Scope

  • More filter types — hats, beards, makeup overlays
  • Custom filter import
  • Filter intensity / opacity control
  • Face expression triggers (open mouth → swap filter)
  • Video recording with filters applied

About

Real-time face filters for Android using MediaPipe's 468-point landmark detection. Snap on glasses, noses, and more — all tracking your face in live camera preview.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages