Web-based version of FacePsy for testing facial behavior analysis on desktop.
- Real-time webcam capture
- Face detection using MediaPipe
- Action Unit detection using TensorFlow Lite model
- Head pose estimation
- Eye openness detection
- Smile probability
FacePsy-Web/
├── backend/ # Python FastAPI backend
│ ├── main.py # API server
│ └── requirements.txt
├── frontend/ # Next.js frontend
│ ├── app/
│ │ ├── layout.tsx
│ │ └── page.tsx
│ └── package.json
├── models/ # ML models
│ └── AU_200.tflite # Action Unit detection model
└── README.md
cd backend
# Create virtual environment
python3 -m venv venv
source venv/bin/activate # On Mac/Linux
# or: venv\Scripts\activate # On Windows
# Install dependencies
pip install -r requirements.txt
# Run backend
python main.py
# or: uvicorn main:app --reload --port 8000Backend will run at: http://localhost:8000
cd frontend
# Install dependencies
npm install
# Run development server
npm run devFrontend will run at: http://localhost:3000
- Start the backend first (port 8000)
- Start the frontend (port 3000)
- Open http://localhost:3000 in your browser
- Click "Start Camera" to enable webcam
- Click "Capture & Analyze" or "Auto Capture" to analyze faces
GET /- Health checkPOST /analyze- Analyze uploaded image filePOST /analyze-base64- Analyze base64 encoded image
| Action Unit | Description | Depression Correlation |
|---|---|---|
| AU04 | Brow Lowerer | Often elevated |
| AU15 | Lip Corner Depressor | Associated with sadness |
| AU12 | Lip Corner Puller | Reduced (less smiling) |
| AU01 | Inner Brow Raiser | Can indicate distress |
- Python 3.8+
- Node.js 18+
- Webcam