machine
- 64bit ubuntu 18.04LTS
- VMWare Workstation 15 Player
installing pyenv(2021/2/11)
-
refer the steps of https://github.com/thoughtworksarts/EmoPy/blob/master/README.md#environment-setup
-
update and upgrade apt before starting
sudo apt update
sudo apt upgrade
- installing required libs and then you must reboot your machine.
sudo apt install -y build-essential libffi-dev libssl-dev zlib1g-dev liblzma-dev libbz2-dev libreadline-dev libsqlite3-dev git
- install package of pyenv
git clone https://github.com/pyenv/pyenv.git ~/.pyenv`
echo 'export PYENV_ROOT="$HOME/.pyenv"' >> ~/.bashrc`
echo 'export PATH="$PYENV_ROOT/bin:$PATH"' >> ~/.bashrc`
echo 'eval "$(pyenv init -)"' >> ~/.bashrc`
source ~/.bashrc`
- check the version of installed pyenv.
pyenv -v
- install python into virtual environment.
pyenv install 3.6.10
set up for EmoPy
- install required lib.
sudo apt-get install graphviz`
sudo pip3 install virtualenv`
sudo apt-get install python3-venv`
- Create and activate the virtual environment. Run:
pyenv exec python3.6 -m venv venv
- activate virtual environment.
source venv/bin/activate
installing EmoPy
- install via pip or from git
# in case of pip
sudo pip3 install -U pip
sudo pip3 install EmoPy
# in case of git
git clone https://github.com/thoughtworksarts/EmoPy.git
cd EmoPy/
sudo pip3 install -r requirements.txt
run programs
- run
run_all.py
as a test
sudo python3 EmoPy/tests/run_all.py
prog for webcam.
cd EmoPy/EmoPy/examples/
sudo python3 fermodel_example_webcam.py
- you may need to unintall h5py and install other-version
sudo pip3 uninstall h5py
sudo pip3 install h5py==2.10.0
- output is shown.
Capturing image ...
Image written to: image_data/image.jpg
Initializing FER model parameters for target emotions: ['calm', 'anger', 'happiness']
WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/tensorflow/python/framework/op_def_library.py:263: colocate_with (from tensorflow.python.framework.ops) is deprecated and will be removed in a future version.
Instructions for updating:
Colocations handled automatically by placer.
2021-02-12 20:40:55.266811: I tensorflow/core/platform/cpu_feature_guard.cc:141] Your CPU supports instructions that this TensorFlow binary was not compiled to use: AVX2 FMA
2021-02-12 20:40:55.330783: I tensorflow/core/platform/profile_utils/cpu_utils.cc:94] CPU Frequency: 2111995000 Hz
2021-02-12 20:40:55.335114: I tensorflow/compiler/xla/service/service.cc:150] XLA service 0x1f22ed0 executing computations on platform Host. Devices:
2021-02-12 20:40:55.335376: I tensorflow/compiler/xla/service/service.cc:158] StreamExecutor device (0): <undefined>, <undefined>
WARNING:tensorflow:From /usr/local/lib/python3.6/dist-packages/tensorflow/python/ops/math_ops.py:3066: to_int32 (from tensorflow.python.ops.math_ops) is deprecated and will be removed in a future version.
Instructions for updating:
Use tf.cast instead.
anger: 62.6%
calm: 28.7%
happiness: 8.8%