A robust system that combines facial emotion recognition with text sentiment analysis to provide comprehensive emotional insights and personalized recommendations.
-
Text Analysis
- Sentiment classification (positive, negative, neutral)
- Emotion detection (joy, sadness, anger, fear, love, surprise)
- Tweet and general text support
-
Facial Analysis
- Real-time facial emotion detection
- Region-based facial analysis for improved accuracy
- Support for multiple faces in a single image
- Batch processing capabilities
-
AI Recommendations
- Personalized insights using GPT-4
- Context-aware emotional state analysis
- Actionable recommendations based on combined analysis
- Python 3.8+
- TensorFlow 2.x
- Flask
- OpenAI API key
- CUDA-capable GPU (recommended)
pip install -r requirements.txt- Clone the repository:
git clone https://github.com/yourusername/emotion-analysis-system.git
cd emotion-analysis-system- Set up environment variables:
cp .env.example .env
# Add your OpenAI API key to .env- Start the server:
python app.py- Access the web interface at
http://localhost:5000
from tweet_analyzer import TweetAnalyzer
analyzer = TweetAnalyzer()
results = analyzer.analyze_tweet("Your text here")from batch_classifier import BatchImageClassifier
classifier = BatchImageClassifier("path/to/model.h5")
results = classifier.process_image_folder("input_folder", "output_folder").
├── app.py # Main Flask application
├── tweet_analyzer.py # Text analysis module
├── batch_classifier.py # Image analysis module
├── models/ # Pre-trained models
├── templates/ # HTML templates
└── uploads/ # Temporary file storage
- Text Sentiment Analysis: 71% accuracy
- Facial Emotion Recognition: 64% accuracy
- Support for 8 distinct emotions
- Maximum file size: 8MB
- Supported image formats: PNG, JPG, JPEG
- Automatic file cleanup after processing
- GPU memory optimization
Contributions are welcome! Please feel free to submit a Pull Request.
- Fork the repository
- Create your feature branch (
git checkout -b feature/AmazingFeature) - Commit your changes (
git commit -m 'Add some AmazingFeature') - Push to the branch (
git push origin feature/AmazingFeature) - Open a Pull Request
This project is licensed under the MIT License - see the LICENSE file for details.
- TensorFlow team for the deep learning framework
- OpenAI for GPT-4 integration
- Contributors and maintainers
Your Name - bojalil.david@gmail.com Project Link: https://github.com/DavidBo9/EmotiAISourceCode