Skip to content

Repository files navigation

Face Recognition: MTCNN vs RetinaFace

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.

Features

  • Benchmarking: Tests both models under 4 different scenarios:
    1. Single image, single person
    2. Single image, multiple people (composite)
    3. Multiple images, single person
    4. Multiple images, multiple people (composite)
  • Visualization: Outputs side-by-side bounding box comparisons.
  • Reporting: Generates a detailed JSON results file and a professional .docx report.

Directory Structure

  • 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 from experiment.py.

Requirements

Ensure you have Python 3.8+ installed. The dependencies are listed in requirements.txt. Install them using:

pip install -r requirements.txt

Usage

  1. Run the Experiment: Execute the main script to perform face detection and generate results in the experiment_results/ directory:

    python experiment.py
  2. Generate the Report: After running the experiment, run the docx generator to create the final .docx report:

    python generate_docx.py

Key Findings

  • 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.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages