Face Detection with Haar Cascade ClassifiersFace Detection with Haar Cascade Classifiers
- Face Detection: Uses Haar Cascade Classifiers to detect faces in images.
- Real-Time Feedback: Provides immediate feedback on the detection results.
- Image Annotation: Annotates detected faces in the image and returns the processed image.
- Backend: Python (Flask)
- Libraries: OpenCV, NumPy, Base64
.
├── app.py
├── haarcascade_frontalface_default.xml
├── requirements.txt
└── README.md
Prerequisites
- Python 3.6+
- Flask
- OpenCV
- NumPy Instructions :
- Clone the Repository
git clone https://github.com/yourusername/face-detection-haarcascade.git
cd face-detection-haarcascade
- Clone the Repository
- python3 -m venv venv
- source venv/bin/activate
- pip install -r requirements.txt
- Download Haar Cascade XML File
- Ensure the haarcascade_frontalface_default.xml file is in the project directory.
- Start the Flask Server
- python app.py
Create a requirements.txt file with the following content: `
- Flask
- opencv-python-headless
- numpy`
POST /detect_face
Content-Type | Body |
---|---|
application/json |
string |
{ "nis": "12345", "nama": "John Doe", "imageBase64": "data:image/jpeg;base64,/9j/4AAQSkZJRgABAQAAAQABAAD/..." }