Real-time Facial Expression & Eye Tracking with AI-Powered Mood Insights
- 7 Emotion Recognition — Happy, Sad, Angry, Surprised, Fearful, Disgusted, Neutral
- Real-time Confidence Scoring — See detection confidence for each emotion
- Visual Progress Bars — Live visualization of all emotion probabilities
- Smooth Transitions — Animated UI updates as expressions change
- Blink Rate Monitoring — Tracks blinks per minute
- Gaze Stability Analysis — Measures how steady your focus is
- Eye State Indicators — Visual feedback for left/right eye open/closed
- EAR-based Detection — Uses Eye Aspect Ratio for accurate tracking
- Local AI Processing — Uses Ollama for privacy-first analysis
- Contextual Insights — Understands emotion + eye data together
- Natural Language Feedback — Conversational mood assessments
- No Cloud Required — Everything runs on your machine
- Rapid Emotion Detection — Catches sudden shifts in expression
- Alert Logging — Keeps history of detected changes
- Visual Notifications — Animated banner alerts
- Timestamped Events — Track when changes occurred
- Duration Tracking — Monitor session length
- Emotion Change Counter — Track expression transitions
- Dominant Emotion — See your most common expression
- Snapshot Capture — Save moments with one click
- Modern web browser (Chrome, Firefox, Edge)
- Webcam access
- (Optional) Ollama for AI analysis
# Clone the repository
git clone https://github.com/yourusername/emotisense.git
cd emotisense
# Open in browser
start index.html # Windows
open index.html # macOS
xdg-open index.html # Linuxnpx http-server . -p 8080
# Then open http://localhost:8080# Install Ollama from https://ollama.ai
ollama run qwen2.5-coder:7b-instruct-q4_K_M- Start Analysis — Click the button and allow camera access
- Face Detection — AI models detect your face and 68 facial landmarks
- Expression Analysis — Neural network classifies your expression
- Eye Tracking — Landmarks track eye openness and gaze
- AI Insights — Local LLM provides contextual mood analysis
| Component | Technology |
|---|---|
| Face Detection | face-api.js |
| Landmarks | 68-point facial landmark model |
| Expressions | Pre-trained expression classifier |
| AI Analysis | Ollama (local LLM) |
| UI Framework | Vanilla JavaScript + CSS3 |
| Fonts | Inter |
Modify these constants in index.html:
// AI Settings
const OLLAMA_URL = 'http://localhost:11434'; // Ollama endpoint
const MODEL = 'qwen2.5-coder:7b-instruct-q4_K_M'; // Model name
const AI_INTERVAL = 3000; // Analysis frequency (ms)| Metric | Description | Normal Range |
|---|---|---|
| Blink Rate | Blinks per minute | 15-20 |
| Gaze Stability | Focus steadiness | High/Med/Low |
| Confidence | Detection certainty | 0-100% |
| Emotion Changes | Expression transitions | Varies |
- Glassmorphism Design — Modern frosted glass effects
- Dark Theme — Easy on the eyes
- Responsive Layout — Works on desktop and tablet
- Smooth Animations — Polished micro-interactions
- Gradient Accents — Violet to pink color scheme
Demo Only — Expression detection is approximate and varies by individual, lighting, and camera quality. This tool is NOT for clinical, diagnostic, or assessment purposes. All processing happens locally — no data is sent to external servers.
MIT License — See LICENSE for details.
Made with ❤️ for the open-source community