2
5

More than 3 years have passed since last update.

YOLOFaceで顔検出やーる(Windows10、Python3.6)

Last updated at Posted at 2020-05-05

はじめに

リアルタイムの物体検出アルゴリズムであるYOLOv3の顔検出版であるYOLOFaceをやってみました。CPUでも動くよ。

システム環境

  • Windows10(RTX2080 Max-Q、i7-8750H、RAM16GB)
  • Anaconda 2020.02
  • Python 3.6

導入

yolofaceをクローンします。

yoloface環境を作ります。

$ cd yoloface-master 
$ conda create -n yoloface python=3.6
$ conda activate yoloface
$ pip install -r requirements.txt

yolov3-wider_16000.weightsをダウンロードし、model-weightsフォルダに置きます。

下記のコマンドを実行し、顔検出できるか確認しましょう。samplesフォルダに顔検出したいファイルを入れておきます。

  • 画像の場合
$ python yoloface.py --image samples/outside_000001.jpg --output-dir outputs/

meeting_11_304_yoloface.jpg
outside_000001_yoloface.jpg

かなり精度いいですね!

  • 動画の場合
$ python yoloface.py --video samples/hoshino.mp4 --output-dir outputs/

hoshino_yoloface_Trim.gif

  • ウェブカメラの場合(数値を変えることでカメラデバイスを切り替えられます)
$ python yoloface.py --src 1 --output-dir outputs/

bandicam-2020-05-06-02-55-53-074.gif

リアルタイムに顔検出できました。
お疲れ様でした。

2
5
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
2
5