5
9

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?

More than 3 years have passed since last update.

【超簡単】PythonとOpenCVでリアルタイムに顔認識と表情認識を同時に実行!

Last updated at Posted at 2021-01-01

Screenshot from 2021-01-01 10-14-16.png

準備

参照:[Perception for Autonomous Systems(github)](https://github.com/oarriaga/paz "paz") 環境: ubuntu 20.04 lts corei3 7th ram 16gb

pip3を使ってTensorflow、OpenCV、NumPy、pypazをインストール

sudo pip3 install tensorflow
sudo pip3 install opencv-python
sudo pip3 install numpy
sudo pip3 install pypaz

ソースコードのダウンロード

git clone https://github.com/oarriaga/paz.git

実行

WEBカメラを接続しておいてください。
cd paz
cd examples
cd face_classification
python3 demo.py

これで実行できました!お疲れ様でした!

おまけ

ウィンドウサイズを大きくする

sudo nano demo.py

この行を

player = VideoPlayer((640, 480), pipeline, camera)

以下のように変更

player = VideoPlayer((1152, 864), pipeline, camera)

これでウィンドウサイズが大きくなり見やすくなりました!

最後に

最後まで読んでいただきありがとうございました! 他にもプログラムがexamplesファイルの中にあるので試してみてください!
5
9
1

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
5
9

Delete article

Deleted articles cannot be recovered.

Draft of this article would be also deleted.

Are you sure you want to delete this article?