Easy-to-manage touch screens
Free, open-source touch screens. Guided USB setup, a drag-and-drop editor and local control. Made for Home Assistant.
Facial expression analysis that suggests food, drinks, ingredients, and fruits.
LifestyleTypeScript · PythonGitHub @rattikasrirat22OnlineOwner unconfirmed
Have you tried it? One tap is enough. No sign-in needed.
No updates detected yet. GitHub releases will appear here.
Owners of public repositories under a personal GitHub account can sign in to verify ownership and manage the introduction themselves. No administrator approval is needed.
Sign in, generate a verification file, and commit it to this repository’s default branch within 30 minutes. Files on other branches or forks do not count. Then check the file below to manage the project without administrator approval. Keep the file to retain your access.
If needed, you will go to sign-in. After signing in, return here and press your chosen verification button again.
Run /nomorevibe verify in your project folder to verify ownership and manage the introduction yourself.
Verify in one minuteAsk about other verification options
Emotion-based food recommendation web application
Translation pending
Taken from the repository README
Loading the full README. The saved excerpt is shown below.
AI-Powered Facial Emotion Recognition & Food Recommendation Web Application
FaceFood is a full-stack web application that analyzes a user's facial expression through their camera, classifies it into one of four supported emotion categories, and recommends food, drinks, ingredients, and fruits suited to that category.Read the full README ↗AI-Powered Facial Emotion Recognition & Food Recommendation Web Application
FaceFood is a full-stack web application that analyzes a user's facial expression through their camera, classifies it into one of four supported emotion categories, and recommends food, drinks, ingredients, and fruits suited to that category.
Food choices are often influenced by mood, but most food-discovery apps ignore that signal entirely. FaceFood explores a different entry point: instead of asking the user what they want, it analyzes their facial expression, classifies it into one of four emotion categories, and surfaces food recommendations mapped to that category — food, drinks, ingredients, and fruit — along with basic nutrition information for each item.
This is a 2-person university project built to explore the full pipeline end-to-end: training and serving a facial emotion recognition model, wiring it into a REST API, and building a camera-based web experience around it.
Camera Feed
→ Face Detection (Haar Cascade)
→ Emotion Classification (ResNet18 + Multi-head Attention)
→ Emotion Category Result
→ Food Recommendation Lookup (Firebase Realtime Database)
→ Nutrition Information Display
FaceFood analyzes facial expressions and classifies them into one of four supported emotion categories: Anger, Happiness, Neutral, and Sadness. That classification result is what drives which food category is recommended — the system does not claim to know a user's actual internal emotional state, only the visual category their expression was classified into.
Next.js Frontend → Flask REST API → Emotion Recognition Model (PyTorch)
→ Firebase Realtime Database (food/menu data)
[Architecture Diagram – to be added]
src/lib/api.ts)./api/analyze, /api/recommendations) exposing the emotion model and recommendation lookups. Also serves a legacy server-rendered UI (templates/) from earlier in the project.GCS_MODEL_BUCKET) — used so the ~48MB weight file doesn't need to be baked into the deploy image or committed to git.Dockerfile built for Google Cloud Run (gunicorn, PORT=8080, .gcloudignore) and a Procfile. The frontend's .gitignore includes Vercel-specific entries, indicating Vercel was used for frontend deployment, but no live URL is present in the repo to confirm the current deployment — [needs user confirmation].Frontend
Backend
AI / Machine Learning
torch, torchvision)Database
firebase-admin SDK)Deployment / Infrastructure
nn.MultiheadAttention (8 heads) applied over the embedding → fully-connected classification head (Linear → BatchNorm → ReLU → Dropout → Linear).Training scripts/notebooks are not part of this repository; only the trained weights, class list, and evaluation artifacts (confusion matrix, training curves) are included.
Evaluated on a held-out test set:
Test Accuracy: ~90.5% Weighted F1-score: ~90.5% (derived from the confusion matrix below — no separate saved classification report exists in the repository)
Confusion Matrix:
Training History (accuracy & loss):
| Home | Analyze / Camera |
|---|---|
docs/screenshots/home.png (not yet added) | docs/screenshots/analyze.png (not yet added) |
| Emotion Result | Food Recommendation |
|---|---|
docs/screenshots/result.png (not yet added) | docs/screenshots/recommendations.png (not yet added) |
| Error State |
|---|
docs/screenshots/error.png (not yet added) |
Screenshots to be added.
FaceFood/
├── backend/ # Flask API, emotion model, Firebase integration
├── frontend/ # Next.js web application
├── DEPLOY_CHECKLIST.md # Internal pre-deploy checklist
└── README.md
Primary API used by the frontend (see backend/app.py):
| Method | Endpoint | Purpose |
|---|---|---|
POST | /api/analyze | Accepts a base64-encoded camera frame, runs face detection + emotion classification, returns the classified emotion category and confidence scores |
POST | /api/recommendations | Returns food/drink/ingredient/fruit recommendations for a given emotion category, pulled from Firebase |
Error responses use a structured { "success": false, "error": { "code", "message" } } shape, with codes including INVALID_REQUEST, INVALID_IMAGE, NO_FACE_DETECTED, MODEL_ERROR, INVALID_EMOTION, DATABASE_ERROR.
The backend also serves a small set of legacy server-rendered routes (/, /analyze, /menu, etc.) from an earlier iteration of the project, alongside the JSON API used by the current Next.js frontend.
Team size: 2 (university project)
My responsibilities:
Frontend implementation was primarily handled by my teammate.
cd frontend
npm install
cp .env.example .env.local
npm run dev
Runs at http://localhost:3000. Requires the backend to be running separately — there is currently no mock-data mode implemented.
cd backend
pip install -r requirements.txt
python app.py
Runs at http://localhost:5000 by default. Requires the trained model weights (backend/models/best_resnet18_attention_emotion.pth) to be present locally, or GCS_MODEL_BUCKET configured to fetch them from Cloud Storage, plus Firebase credentials configured (see Environment Variables below).
Frontend — see frontend/.env.example:
NEXT_PUBLIC_API_BASE_URLNEXT_PUBLIC_API_TIMEOUT_MSBackend — configured via environment variables (no backend/.env.example exists yet; recommended as a follow-up):
FIREBASE_KEY_PATH — path to the Firebase service account credentialsALLOWED_ORIGINS — comma-separated CORS whitelistGCS_MODEL_BUCKET — Cloud Storage bucket to download model weights from, if not present locallyFLASK_SECRET_KEY — Flask session secretFLASK_DEBUG — enables Flask debug mode (defaults to off)No secret values are included here or anywhere in this repository.
Backend: containerized with Docker and built for Google Cloud Run (gunicorn, PORT=8080). Model weights are loaded from Google Cloud Storage at container startup rather than baked into the image.
Frontend: configured for Vercel deployment (inferred from repo .gitignore entries).
Live Demo: [URL to be confirmed]
low-light, distance) exist in the UI but are not yet wired up to real detection logic on either the frontend or backend.low-light/distance client error states to real detection logicFaceFood is an academic/educational project built for a university course/internship portfolio. It is not a clinical or diagnostic tool: it classifies facial expressions into one of four fixed categories and does not diagnose mental health conditions or determine a user's true emotional state. Food recommendations are informational only — not medical, psychological, or nutritional treatment advice.
MIT — see LICENSE.