A real-time camera-based emoji display application that uses MediaPipe to detect your poses and facial expressions, then displays corresponding emojis in a separate window.
- Hand Detection: Raises hands above shoulders → displays hands up emoji 🙌
- Smile Detection: Detects smiling → displays smiling emoji 😊
- Default State: Straight face → displays neutral emoji 😐
- Real-time Processing: Live camera feed with instant emoji reactions
- Added new emoji assets:
jawline.pngand67clashroyale.webp.- These are bundled in the project root and can be used as alternative display images.
- To use them, either replace one of the default image files or extend
emoji_reactor.pyto load additional states.
- Python 3.12 (Homebrew:
brew install python@3.12) - macOS or Windows with a webcam
- Required Python packages (see
requirements.txt)
-
Clone or download this project
-
Create a virtual environment (Python 3.12) and install deps:
# macOS: ensure Python 3.12 is installed brew install python@3.12 # Create and activate a virtual environment python3.12 -m venv emoji_env source emoji_env/bin/activate # Install dependencies pip install -r requirements.txt
-
Ensure you have the emoji images in the project directory:
smile.jpg- Smiling face emojiplain.png- Straight face emojiair.jpg- Hands up emojijawline.png- Jawline-themed emoji asset67clashroyale.webp- 67 Clash Royale-themed emoji asset
-
Run the application:
# Option A: use helper script ./run.sh # Option B: run manually source emoji_env/bin/activate python emoji_reactor.py
-
Two windows will open:
- Camera Feed: Shows your live camera with detection status
- Emoji Output: Displays the corresponding emoji based on your actions
-
Controls:
- Press
qto quit the application - Raise your hands above your shoulders for hands up emoji
- Smile for the smiling emoji
- Keep a straight face for the neutral emoji
- Press
The application uses two MediaPipe solutions:
- Pose Detection: Monitors shoulder and wrist positions to detect raised hands
- Face Mesh Detection: Analyzes mouth shape to detect smiling vs. straight face
- Hands Up (highest priority) - Overrides facial expression detection
- Smiling - Detected when mouth aspect ratio exceeds threshold
- Straight Face - Default state when no smile is detected
- Finger on Jawline - Detected when you flex your jawline with your finger pouch
- 67 Emote - Detected when you move your hands like the 67 meme
Edit the SMILE_THRESHOLD value in emoji_reactor.py:
- Decrease value (e.g., 0.30) if smiles aren't detected
- Increase value (e.g., 0.40) if false positive smiles occur
Replace the image files with your own:
smile.jpg- Your smiling emojiplain.png- Your neutral emojiair.jpg- Your hands up emojijawline.png- Flex your jawline (if you have)67clashroyale.webp- Your 67 meme
- If you see "not authorized to capture video", grant Camera access for your terminal/editor:
- System Settings → Privacy & Security → Camera → enable for Terminal/VS Code/iTerm
- Quit and relaunch the terminal/editor after changing permissions
- Ensure no other app is using the camera
- Try different camera indices by changing
cv2.VideoCapture(0)tocv2.VideoCapture(1)
- Ensure good lighting on your face
- Keep your face clearly visible in the camera
- Adjust
SMILE_THRESHOLDif needed - For hands up detection, make sure your arms are clearly visible
- Uses OpenCV for camera capture and display
- MediaPipe Pose and FaceMesh for detection
- Real-time RGB conversion and landmark detection
opencv-python- Computer vision librarymediapipe- Pose and Face Mesh detectionnumpy- Numerical computing
See requirements.txt for installation and requirements-lock.txt for pinned versions.
MIT License.