Built with OpenCV and Python for advanced computer vision applications
|
|
|
|
FACE_DETECTION_PROJECT/
βββ π data/ # Haarcascade XML files
βββ π models/ # Trained/saved AI models
βββ π samples/ # Sample images/videos
βββ π src/ # Python source code
β βββ π face_detection.py
β βββ π simplified_face_detection.py
β βββ π enhanced_face_detection.py
β βββ π enhanced_face_detection_emotion.py
β βββ π face_analyzer.py # Main application
βββ π get_xml_files.py
βββ π requirements.txt
βββ π README.md
βββ π« .gitignore
-
Clone the repository
git clone https://github.com/yourusername/face-analysis-tool.git cd face-analysis-tool -
Install dependencies
pip install opencv-python numpy pillow
-
Optional GUI dependencies (Ubuntu/Debian)
sudo apt-get install python3-tk
python src/face_analyzer.py --mode guiFeatures:
- π±οΈ Point-and-click interface
- π Easy file loading
- π₯ Webcam integration
- βοΈ Real-time settings adjustment
- πΎ One-click save functionality
python src/face_analyzer.py --mode image --input <image_path> [options]Example:
python src/face_analyzer.py --mode image \
--input samples/portrait.jpg \
--output samples/analyzed_portrait.jpg \
--filter cartoon --recognize --orientpython src/face_analyzer.py --mode video [options]Example:
python src/face_analyzer.py --mode video --blur --trackπ‘ Tip: Press
qin the video window to quit
python src/face_analyzer.py --mode batch \
--input <input_directory> \
--output <output_directory> [options]Example:
python src/face_analyzer.py --mode batch \
--input samples/ \
--output processed_batch/ \
--filter sepia --blurπ§ Command Line Arguments
| Option | Values | Description |
|---|---|---|
--mode |
gui, image, video, batch |
Processing mode |
--input |
<path> |
Input file/directory path |
--output |
<path> |
Output file/directory path |
--video_source |
<index> |
Webcam index (default: 0) |
--filter |
none, sepia, bw, cartoon |
Image filter type |
--blur |
- | Enable face blurring |
--recognize |
- | Enable face recognition |
--track |
- | Enable face tracking |
--orient |
- | Auto-correct orientation |
--data-dir |
<path> |
Custom Haar cascade path |
--models-dir |
<path> |
Custom models directory |
π¨ Common Issues & Solutions
β οΈ Warning: Tkinter/Pillow not found
Solution: Install GUI dependencies or use CLI modes
pip install pillow
# Ubuntu/Debian:
sudo apt-get install python3-tkβ Error: Cascade/Model not found
Solution: Verify file paths or use custom directories
python src/face_analyzer.py --data-dir /custom/path --models-dir /model/pathβ Error: Cannot access camera
Solutions:
- Check camera connections and drivers
- Try different video source index:
--video_source 1 - Verify camera permissions
β³ Slow tracking performance
Solutions:
- Switch to KCF tracker (modify code)
- Reduce video resolution
- Close unnecessary applications
We welcome contributions! Please see our Contributing Guidelines for details.
- Fork the repository
- Create a feature branch:
git checkout -b feature-name - Make your changes and test thoroughly
- Submit a pull request with detailed description
| Platform | Status | Python Versions |
|---|---|---|
| πͺ Windows | β Fully Supported | 3.7+ |
| π§ Linux | β Fully Supported | 3.7+ |
| π macOS | β Fully Supported | 3.7+ |
This project is provided for educational purposes only. Please respect privacy and ethical guidelines when using face analysis technology.
π Home β’ π Features β’ πΏ Install β’ π Docs β’ π€ Contribute
Built with β€οΈ for the computer vision community