Skip to content

36go/face-game

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

11 Commits
 
 
 
 

Repository files navigation

🎭 Real-Time Expression & Gesture Detection

Python OpenCV MediaPipe License

A powerful real-time computer vision application that detects facial expressions and hand gestures using AI

FeaturesInstallationHow It WorksDemoContact


✨ Features

🎭 Facial Expression Detection

  • 😐 Neutral
  • 😊 Smiling
  • 😢 Sad
  • 😠 Angry

👋 Hand Gesture Recognition

  • 👍 Thumbs Up (Animated GIF)
  • 🤝 Hand Clasping
  • ✋ Open/Closed Hands
  • 🎯 Special Gestures

🎵 Interactive Sound Trigger

Open your mouth 3 times rapidly within 2 seconds to:

  • 🔊 Play a sound effect
  • 🎬 Trigger a special 4-second animation

🚀 Installation

Prerequisites

  • 📹 Webcam
  • 💻 Python 3.8 or higher
  • 🖥️ Recommended: Intel i7 11th gen or equivalent
  • 💾 Minimum 8GB RAM

Quick Start

# Clone the repository
git clone https://github.com/36go/face-game.git
cd face-game

# Install dependencies
pip install -r requirements.txt

# Run the application
python main.py

📦 Required Files

File Description
neutral.png Neutral expression image
smile.png Smiling expression image
sad.png Sad expression image
angry.png Angry expression image
jew.png Clasped hands image
nien.png Special gesture image
thumbs_up.gif Thumbs up animation
oi.gif Mouth trigger animation
sound.mp3 Sound effect

🎯 How It Works

🇬🇧 English

The application uses MediaPipe and OpenCV to analyze your webcam feed in real-time:

  1. Face Detection: The system detects your face and analyzes facial landmarks to determine your expression
  2. Hand Tracking: Recognizes hand positions and gestures using 21 hand landmarks
  3. Expression Mapping: Displays corresponding images based on detected expressions and gestures
  4. Interactive Triggers: Special mouth movements trigger sound effects and animations

Controls:

  • Press Q to quit
  • The app opens two windows: Camera (live feed) and Expression (output display)

Gestures:

  • Thumbs Up: Hold thumb up with fingers folded for 0.5 seconds
  • Clasped Hands: Bring both hands together
  • Mouth Trigger: Open mouth 3 times quickly (you'll see debug messages in console)

🇸🇦 العربية

يستخدم التطبيق MediaPipe و OpenCV لتحليل فيديو الكاميرا في الوقت الفعلي:

  1. كشف الوجه: يكتشف النظام وجهك ويحلل معالم الوجه لتحديد تعبيرك
  2. تتبع اليد: يتعرف على مواضع اليد والإيماءات باستخدام 21 نقطة لمعالم اليد
  3. ربط التعبيرات: يعرض الصور المقابلة بناءً على التعبيرات والإيماءات المكتشفة
  4. المحفزات التفاعلية: حركات الفم الخاصة تؤدي إلى تشغيل المؤثرات الصوتية والرسوم المتحركة

التحكم:

  • اضغط Q للخروج
  • يفتح التطبيق نافذتين: الكاميرا (البث المباشر) و التعبير (عرض النتيجة)

الإيماءات:

  • الإبهام لأعلى: ارفع إبهامك مع طي الأصابع لمدة 0.5 ثانية
  • اليدين المتشابكتين: اجمع كلتا يديك معاً
  • محفز الفم: افتح فمك 3 مرات بسرعة (سترى رسائل تصحيح في الكونسول)

🎬 Demo

Expression Detection

The app displays different images based on your facial expressions in real-time.

Hand Gestures

  • Hold a thumbs up gesture to see an animated GIF
  • Clasp your hands together to trigger a special image
  • Other gestures are automatically detected and displayed

Sound Trigger

Open your mouth 3 times within 2 seconds to play a sound and show a 4-second animation!


🛠️ Technical Details

Performance Optimization

  • ⚡ Processes every frame for smooth video
  • 🎯 Uses MediaPipe's lightweight model (complexity=0)
  • 👤 Maximum 1 face detection per frame
  • 📐 640x480 resolution for balanced quality and performance

Dependencies

opencv-python
mediapipe
pillow
numpy
pygame

📱 Contact

👨‍💻 Made By Me | صُنع بواسطتي

تابعوني على حساباتي | Follow Me On My Accounts

Instagram qqsju
Instagram _1zjz

Instagram


📄 License

This project is licensed under the MIT License - see the LICENSE file for details.


🙏 Acknowledgments

  • MediaPipe - Google's ML solution for hand and face detection
  • OpenCV - Computer vision library
  • PyGame - Sound playback functionality

⭐ Star this repo if you found it helpful!

Made with ❤️ by

Instagram Instagram

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages