An open API service indexing awesome lists of open source software.

https://github.com/anshumankansana/emotion-detection-and-facial-recognition

A Python-based AI assistant that performs real-time emotion detection and facial recognition using deep learning. It remembers faces, detects emotions like happy, sad, angry, or tired, and responds with GPT-powered personality through voice. Supports multilingual voice input (Hindi & English) and always replies in English.
https://github.com/anshumankansana/emotion-detection-and-facial-recognition

deepface dotenv emotion-recognition facial-recognition openai opencv python

Last synced: 3 months ago
JSON representation

A Python-based AI assistant that performs real-time emotion detection and facial recognition using deep learning. It remembers faces, detects emotions like happy, sad, angry, or tired, and responds with GPT-powered personality through voice. Supports multilingual voice input (Hindi & English) and always replies in English.

Awesome Lists containing this project

README

          

Absolutely! Here's a complete and professional `README.md` for your project **"Emotion Detection and Facial Recognition"** that you can just copy-paste into your repo:

---

```markdown
# πŸ€– Emotion Detection and Facial Recognition Robot Girl Assistant

This project is a smart virtual assistant with emotional intelligence, facial recognition, and voice interaction. It reacts with sarcastic or caring personality traits based on the user’s emotion and identity, responding both visually and through voice.

> Built using Python, OpenCV, Dlib, FER, Text-to-Speech, and GPT-3.5 (optional).

---

## 🧠 Features

- πŸ” Real-time face detection and recognition
- 😊 Emotion detection using deep learning (FER)
- πŸ’€ Tiredness detection via facial landmarks
- 🎀 Voice input (English + Hindi)
- πŸ”Š Voice replies using Text-to-Speech
- 🧬 GPT-3.5 personality engine (Optional: OpenAI or OpenRouter API)
- 🧠 Memory of known faces and their past emotions
- πŸ’Ύ Persistent memory using `.pkl` files

---

## πŸ“‚ Folder Structure

```

πŸ“ robot girl/
β”œβ”€β”€ face\_emotion\_memory.py # Main assistant file
β”œβ”€β”€ face\_data.pkl # Saved face encodings
β”œβ”€β”€ emotion\_history.pkl # Saved emotional patterns
β”œβ”€β”€ shape\_predictor\_68\_face\_landmarks.dat # Dlib facial landmark model
β”œβ”€β”€ .env # (Optional) Stores your API key
β”œβ”€β”€ .gitignore
└── README.md

````

---

## βš™οΈ Requirements

Install these Python modules:

```bash
pip install -r requirements.txt
````

> If `requirements.txt` is not provided, install manually:

```bash
pip install opencv-python dlib face_recognition numpy scipy pyttsx3 fer SpeechRecognition python-dotenv
```

---

## πŸ› οΈ Setup

1. **Download Dlib's Landmark Model**
Download from [dlib.net/files/shape\_predictor\_68\_face\_landmarks.dat.bz2](http://dlib.net/files/shape_predictor_68_face_landmarks.dat.bz2)
Extract it into the same folder.

2. **Create a `.env` File (Optional if using GPT)**

```
OPENAI_API_KEY=your_openai_or_openrouter_key
# Optional for OpenRouter
OPENAI_API_BASE=https://openrouter.ai/api/v1
```

3. **Run the Assistant**

```bash
python face_emotion_memory.py
```

---

## πŸ§‘β€πŸ’» How it Works

* Detects face β†’ Recognizes user β†’ Detects emotion using FER
* Detects tiredness using Dlib facial landmarks (EAR/MAR)
* Talks back using a smart GPT-based personality
* Speaks responses aloud and listens to user's voice

---

## πŸ—£οΈ Supported Languages

* **Voice input**: Hindi (`hi-IN`) and English (`en-IN`)
* **Voice output**: Always replies in English

---

## ⚠️ Warnings & Tips

* If using GPT, make sure your API key is valid and not expired.
* File `shape_predictor_68_face_landmarks.dat` is \~95MB β€” GitHub recommends using Git LFS.
* Use in well-lit environments for better face detection.

---

---

## πŸ§‘ Author

**Anshuman Kansana**
πŸ“Ž [GitHub Profile](https://github.com/anshumankansana)

---

## πŸ“œ License

This project is open-source and free to use under the [MIT License](LICENSE).

---

## πŸ’‘ Future Ideas

* Add animated 2D/3D avatar (Live2D or VTube Studio)
* Use voice cloning for more human-like responses
* Add chatbot memory for conversation history

```

---

Let me know if you'd like me to:
- Add badges (like Python version, license, etc.)
- Include a sample `.env`
- Create `requirements.txt` automatically for you

Ready to post it on GitHub now πŸ’«
```