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.
- 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
.txtlabel files with detected face coordinates following YOLO box format: (id, center_x, center_y, width, height) normalised 0~1.
.
βββ 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