Skip to content

About

Emoji Detector/Reactor is a python and CV project that detects your facial expressions and suggests brainrot emojis based on them

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Repository files navigation

🎭 Emoji Reactor

A real-time camera-based emoji display application powered by MediaPipe to detect poses and facial expressions.

Stars Forks Issues License


📖 About

Emoji Reactor is a computer vision application that creates an interactive, real-time emoji reaction experience. It leverages your webcam and the highly efficient MediaPipe framework to detect specific body poses and facial expressions, instantly displaying a corresponding emoji in a separate window. Whether you're smiling, throwing your hands up, or creating custom gestures, Emoji Reactor brings your expressions to life on screen!

✨ Features

  • 🙌 Hand Detection: Raise your hands above your shoulders to display the "hands up" emoji.
  • 😊 Smile Detection: Show your pearly whites to trigger the "smiling" emoji.
  • 😐 Default State: Keep a straight face to maintain a neutral emoji.
  • ⚡ Real-time Processing: Experience zero-lag live camera feed tracking and instant emoji outputs.
  • 🎨 Custom Emojis: Includes custom additions like a jawline emote (jawline.png) and the 67 Clash Royale emote (67clashroyale.webp).

🛠️ Tech Stack

  • Python - Core programming language.
  • OpenCV - High-performance computer vision library for camera capture and display.
  • MediaPipe - Robust machine learning solutions for Pose and Face Mesh detection.
  • NumPy - Fundamental package for numerical computing.

🚀 Getting Started

Follow these steps to get a local copy up and running.

Prerequisites

  • Python 3.12 or newer.
    • macOS (Homebrew): brew install python@3.12
  • A functional webcam.

Installation

  1. Clone the repository:

    git clone https://github.com/sandeepannandi/Emoji-Detector.git
    cd Emoji-Detector
  2. Set up a virtual environment:

    python3.12 -m venv emoji_env
    source emoji_env/bin/activate  # On Windows, use `emoji_env\Scripts\activate`
  3. Install dependencies:

    pip install -r requirements.txt
  4. Prepare Emoji Assets: Ensure the following image assets are present in the project directory:

    • smile.jpg
    • plain.png
    • air.jpg
    • jawline.png
    • 67clashroyale.webp

🎮 Usage

Start the application by running the following command:

# Option A: Using the helper script (macOS/Linux)
./run.sh

# Option B: Running manually
source emoji_env/bin/activate
python emoji_reactor.py

How It Works

Upon launch, two windows will appear:

  1. Camera Feed: Your live view with detection overlays highlighting identified landmarks.
  2. Emoji Output: The blank canvas where your real-time emoji reactions will appear.

Controls:

  • Raise your hands above your shoulders → 🙌
  • Smile → 😊
  • Express other custom gestures like jawline flex or the 67 meme movements!
  • Press q to quit the application gracefully.

Detection Priority Hierarchy

  1. Hands Up - Overrides facial expressions.
  2. Smiling - Activated when the mouth aspect ratio exceeds the defined threshold.
  3. Straight Face - Fallback default state.
  4. Custom Gestures - E.g. Jawline flex, 67 Emote.

⚙️ Customization

Tweak Smile Sensitivity

To fine-tune smile recognition, edit the SMILE_THRESHOLD constant in emoji_reactor.py:

  • Decrease (e.g., 0.30) to make it easier to trigger a smile.
  • Increase (e.g., 0.40) to reduce false positive smile detections.

Swap Image Assets

Easily replace the default images with your own by over-writing the corresponding files (smile.jpg, plain.png, air.jpg, etc.) with files of the exact same name and extension.

🔧 Troubleshooting

macOS Camera Access Denied

If you receive a "Not authorized to capture video" error:

  1. Open System Settings > Privacy & Security > Camera.
  2. Toggle permissions ON for your Terminal / VS Code / iTerm.
  3. Restart your terminal completely.
Detection Issues
  • Visibility: Ensure your face and arms are clearly visible within the frame.
  • Lighting: Bright, even lighting significantly improves detection accuracy.
  • Camera Index: If the app uses the wrong camera, edit emoji_reactor.py and change cv2.VideoCapture(0) to cv2.VideoCapture(1) (or another index).

📄 License

Distributed under the MIT License. See LICENSE for more information.

About

Emoji Detector/Reactor is a python and CV project that detects your facial expressions and suggests brainrot emojis based on them

Topics

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages