I tried YOLO Face, which is a face detection version of YOLO v3, which is a real-time object detection algorithm. It also works on the CPU.
Clone yoloface.
Create a yoloface environment.
$ cd yoloface-master
$ conda create -n yoloface python=3.6
$ conda activate yoloface
$ pip install -r requirements.txt
Download yolov3-wider_16000.weights and place it in the model-weights folder.
Execute the following command and check if the face can be detected. Put the file you want to detect face in the samples folder.
--In the case of images
$ python yoloface.py --image samples/outside_000001.jpg --output-dir outputs/
It's pretty accurate!
--For video
$ python yoloface.py --video samples/hoshino.mp4 --output-dir outputs/
--For webcams (you can switch camera devices by changing the numbers)
$ python yoloface.py --src 1 --output-dir outputs/
I was able to detect the face in real time. Thank you for your hard work.
Recommended Posts