Skip to content
shrenixcodesPublic

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Repository files navigation

DeepFER — Facial Emotion Recognition

DeepFER is a TensorFlow/Keras facial emotion classifier with a CNN baseline, optional MobileNetV2 transfer learning, OpenCV inference, and a Flask interface.

Setup

Use Python 3.11, create a virtual environment, then install dependencies:

python -m venv .venv
.\.venv\Scripts\Activate.ps1
pip install -r requirements.txt

Dataset detection

train.py automatically checks dataset/; if it is not present, it finds the largest ZIP in the project and extracts it. It supports train/<emotion> and test/<emotion> layouts and checks that Angry, Disgust, Fear, Happy, Neutral, Sad, and Surprise are all available. A scan validates image readability and prints a count by split and class before training.

Train

python train.py --model cnn --epochs 50 --batch-size 64
python train.py --model mobilenetv2 --epochs 20

The best checkpoint is models/best_model.keras; plots and metrics are written to artifacts/. TensorBoard logs are under artifacts/tensorboard.

Inference

python predict.py --image path\to\face.jpg
python predict.py --video path\to\input.mp4 --output artifacts\result.mp4
python predict.py --webcam

Video and webcam output overlays the detected face emotion, confidence, and FPS. Press Q to leave webcam mode.

Web app

Train a model first, then run python app.py and open http://localhost:5000. The app has image and video upload views, a live-webcam instruction, result view, /predict, /predict_video, and /health endpoints.

Docker

docker compose up --build

The Docker volume mounts preserve models/ and generated artifacts/.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages