A comprehensive web application for learning sign language using Python Flask, OpenCV, and AI-powered exercise generation. The platform features real-time hand tracking, progress tracking with Firebase, and dynamic exercise generation using Google's Gemini AI.
- Real-time Hand Tracking: Uses OpenCV and MediaPipe for accurate hand gesture recognition
- AI-Powered Exercises: Dynamic exercise generation using Google Gemini AI based on user progress
- Progress Tracking: Firebase backend for storing and tracking user learning progress
- Beautiful UI: Modern, responsive design with intuitive user experience
- Alphabets (A-Z): Learn to sign all 26 letters of the alphabet
- Numbers (0-9): Master number signs from 0 to 9
- Basic Mannerisms: Essential signs like HELLO, THANK YOU, PLEASE, etc.
- Word Building: AI-generated word spelling exercises
- Beginner Level: Sequential learning of alphabets, numbers, and basic mannerisms
- Intermediate Level: Word building exercises with AI-generated words
- Progress-Based: Exercises adapt to user's skill level and learning pace
- Python Flask: Web framework for API and server-side logic
- OpenCV: Computer vision for hand tracking and gesture recognition
- MediaPipe: Hand landmark detection and tracking
- Firebase: Cloud database for user progress and data storage
- Google Gemini AI: AI-powered exercise generation
- HTML5/CSS3: Modern, responsive design
- JavaScript: Interactive UI and real-time updates
- Chart.js: Progress visualization and analytics
- Font Awesome: Beautiful icons and UI elements
- Python 3.8 or higher
- Webcam for hand tracking
- Google Gemini AI API key
- Firebase project and credentials
git clone <repository-url>
cd sign-language-learning-apppip install -r requirements.txt- Copy the environment example file:
cp env_example.txt .env- Edit
.envfile with your API keys:
SECRET_KEY=your-secure-secret-key
GEMINI_API_KEY=your-gemini-api-key
DEBUG=True- Create a Firebase project at Firebase Console
- Enable Firestore Database
- Generate a service account key:
- Go to Project Settings > Service Accounts
- Click "Generate new private key"
- Save the JSON file as
firebase-credentials.jsonin the project root
python app.pyThe application will be available at http://localhost:5000
- Home Page: Overview of features and learning modules
- Start Exercise: Begin your sign language learning journey
- Progress Tracking: Monitor your learning progress and achievements
- Camera Setup: Allow camera access for hand tracking
- Exercise Display: View the current exercise target and instructions
- Hand Recognition: Show the required sign to the camera
- Real-time Feedback: Get instant feedback on your sign accuracy
- Progress Update: Complete exercises to advance your learning
- Level 1: Master alphabets (A-Z)
- Level 2: Learn numbers (0-9)
- Level 3: Practice basic mannerisms
- Level 4: Word building with AI-generated exercises
POST /api/start-exercise: Start a new exercise sessionPOST /api/check-sign: Check recognized sign against current exercisePOST /api/stop-exercise: Stop the current exercise session
GET /api/user-progress/<user_id>: Get user progress data
sign-language-learning-app/
├── app.py # Main Flask application
├── requirements.txt # Python dependencies
├── templates/ # HTML templates
│ ├── index.html # Home page
│ ├── exercise.html # Exercise interface
│ └── progress.html # Progress tracking
├── static/ # Static assets
│ └── js/
│ └── hand_tracking.js # Hand tracking logic
├── firebase-credentials.json # Firebase service account
├── .env # Environment variables
└── README.md # Project documentation
- A: Thumb only
[1, 0, 0, 0, 0] - B: Four fingers up
[0, 1, 1, 1, 1] - C: Thumb, index, middle
[1, 1, 1, 0, 0] - D: Index finger only
[0, 1, 0, 0, 0] - E: Closed fist
[0, 0, 0, 0, 0] - ... and more
- 0: Closed fist
[0, 0, 0, 0, 0] - 1: Index finger only
[0, 1, 0, 0, 0] - 2: Index and middle
[0, 1, 1, 0, 0] - ... and more
- HELLO: Thumb and index
[1, 1, 0, 0, 0] - THANK YOU: Thumb up
[1, 0, 0, 0, 0] - PLEASE: Three fingers
[1, 1, 1, 0, 0] - ... and more
- Update sign patterns in
app.py - Add corresponding finger patterns
- Update the recognition logic
- Edit the
generate_exercise()method inSignLanguageAppclass - Customize the Gemini AI prompts
- Add new exercise types as needed
- Modify CSS styles in HTML templates
- Update JavaScript functionality
- Add new UI components
Camera Access Denied
- Ensure camera permissions are granted
- Check browser security settings
- Try refreshing the page
Firebase Connection Error
- Verify
firebase-credentials.jsonis in the project root - Check Firebase project settings
- Ensure Firestore is enabled
Gemini AI Error
- Verify API key is correct
- Check API quota and limits
- Ensure internet connection
Hand Tracking Issues
- Ensure good lighting conditions
- Keep hands clearly visible to camera
- Check camera resolution and quality
- Fork the repository
- Create a feature branch
- Make your changes
- Add tests if applicable
- Submit a pull request
This project is licensed under the MIT License - see the LICENSE file for details.
- OpenCV community for computer vision tools
- Google for Gemini AI and Firebase services
- MediaPipe team for hand tracking technology
- Font Awesome for beautiful icons
For support and questions:
- Create an issue in the repository
- Check the troubleshooting section
- Review the documentation
Happy Learning! 🎉