A Python project using OpenCV and MediaPipe for real-time hand and face detection via webcam.
- Hand Detection: Detection and tracking of up to 4 hands simultaneously
- Face Detection: Face detection with bounding boxes
- Real-time Interface: Live display via webcam
cam.py: Complete version with hand AND face detectioncamera.py: Simplified version with hand detection only
- Python 3.7 or higher
- Connected webcam
# Create virtual environment
python -m venv venv
# Activate virtual environment
venv\Scripts\activate
# Deactivate (when done)
deactivate# Create virtual environment
python3 -m venv venv
# Activate virtual environment
source venv/bin/activate
# Deactivate (when done)
deactivatepip install -r requirements.txtpython cam.pypython camera.py- Press 'a' to quit the application
- Camera window displays in real-time
- OpenCV: Image processing and video capture
- MediaPipe: Hand and face detection
- NumPy: Numerical computations
- Default resolution: 640x480 pixels
- Minimum detection confidence: 0.7
- Minimum tracking confidence: 0.4
- Support for up to 4 hands simultaneously