In order to simplify the tedious process of image annotation, here I use mtcnn face detection algorithm to realize automatic face annotation in video. Generated txt files and image files can be directly used in Labelimg or used as yolov3 dataset. Therefore, I rewrote the main content of test.py.
The following is the original author's description.
pytorch implementation of face detection algorithm MTCNN
Just download the repository and then do this
from src.detector import detect_faces
from src.utils import show_bboxes
from PIL import Image
image = Image.open('images/test3.jpg')
bounding_boxes, landmarks = detect_faces(image)
image = show_bboxes(image, bounding_boxes, landmarks)
image.show()
- pytorch 0.4
- Pillow, numpy
This implementation is heavily inspired by:
- pangyupo/mxnet_mtcnn_face_detection
- https://github.com/kpzhang93/MTCNN_face_detection_alignment
- https://github.com/TropComplique/mtcnn-pytorch
MTCNN: Joint Face Detection and Alignment using Multi-task Cascaded Convolutional Networks.