This project is a practical experiment comparing two popular face detection models: MTCNN and RetinaFace. The experiment evaluates their performance (speed and accuracy) across various scenarios using the ORL Face Database.
- Benchmarking: Tests both models under 4 different scenarios:
- Single image, single person
- Single image, multiple people (composite)
- Multiple images, single person
- Multiple images, multiple people (composite)
- Visualization: Outputs side-by-side bounding box comparisons.
- Reporting: Generates a detailed JSON results file and a professional
.docxreport.
experiment.py: Main script to run the detection experiment and generate images/JSON.generate_docx.py: Script to generate a Microsoft Word (.docx) report based on the experiment results.experiment_results.md: Markdown summary of the experiment's findings.Dataset/: ORL Face Database images (upscaled for the experiment).experiment_results/: Annotated images and JSON output fromexperiment.py.
Ensure you have Python 3.8+ installed. The dependencies are listed in requirements.txt. Install them using:
pip install -r requirements.txt-
Run the Experiment: Execute the main script to perform face detection and generate results in the
experiment_results/directory:python experiment.py
-
Generate the Report: After running the experiment, run the docx generator to create the final
.docxreport:python generate_docx.py
- MTCNN is significantly faster on CPU and performs excellently on small, controlled datasets like ORL with close-up faces.
- RetinaFace requires padding workarounds for full-frame faces but is generally more robust for crowded, occluded, or complex scenes.