Skip to content

DarkSZChao/Face_Detection

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 
Β 

Repository files navigation

Face Detection & Blurring for Data Anonymization

This repository provides a tool to detect faces in images and save both the processed images and corresponding bounding box annotations. It supports multiple face detection algorithms and can optionally split results based on the number of detected faces.


✨ Features

  • Detect faces using multiple algorithms:
    • S_yolo (custom, trainable)
    • A_retinaface (open-source)
    • B_mtcnn (open-source)
    • D_opencv_caffe (open-source)
    • D_face_recognition (open-source)
  • The prefix letter indicates the performance level of the algorithm, Best to Worst: Sβ†’Aβ†’Bβ†’Cβ†’D
  • Generate .txt label files with detected face coordinates following YOLO box format: (id, center_x, center_y, width, height) normalised 0~1.

πŸ“‚ Project Structure

.
β”œβ”€β”€ algorithms/                   # Implementations of different face detection algorithms
β”‚   └── opencv_caffe              # Model files for opencv caffe
β”‚       └── deploy.prototxt
β”‚       └── res10_300x300_ssd_iter_140000.caffemodel
β”‚   └── yolo                      # Customed YOLO model
β”‚       └── dataset               # Dataset to train YOLO
β”‚       └── runs_best             # Best run with YOLO weights
β”‚       └── dataset_generator.py  # Generate dataset for YOLO training
β”‚       └── yolo_train.py         # YOLO training script
β”‚       └── yolo11n.pt            # Pretrained YOLO model
β”‚       └── yolov8s.pt            # Pretrained YOLO model
β”‚   └── S_yolo.py                 # S-class YOLO algorithm
β”‚   └── A_retinaface.py           # A-class algorithm
β”‚   └── B_mtcnn.py                # B-class algorithm
β”‚   └── D_face_recognition.py     # D-class algorithm
β”‚   └── D_opencv_caffe.py         # D-class algorithm
β”œβ”€β”€ tools/                        # Utility scripts
β”‚   └── image_bug                 # Detect corrupted images
β”‚   └── check_result_matching.py  # Check whether the number of output images matches the input
β”‚   └── dataset_reader.py         # Load subfoldera in the dataset for specific structure
β”‚   └── file_moving.py            # Move files
β”œβ”€β”€ apply_blur.py                 # Script to apply blur effect on images based on the box coordinates
β”œβ”€β”€ dataset_viewer.py             # Script to visualize images and draw boxex
β”œβ”€β”€ main.py                       # Main entry point to run face detection & labeling
β”œβ”€β”€ README.md                     # Project documentation
β”œβ”€β”€ requirements.txt              # Python dependencies
└── .gitignore                    # Git ignore file

About

Face detection and blurring for data anonymization using finetuned YOLO

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages