Gaurav Parmar
Gaurav Parmar

Reputation: 41

Error in importing openface

I installed openface using the link

But when i am importing openface in python it is giving an error

./util/align-dlib.py ./home/admin1/Dhoni/ align outerEyesAndNose    ./aligned-images/ --size 96
Traceback (most recent call last):
File "./util/align-dlib.py", line 24, in <module>
import openface
ImportError: No module named openface

Please help me!!!!!

Upvotes: 3

Views: 4961

Answers (3)

Omid
Omid

Reputation: 1

In my case, I was getting the error because

python setup.py install

was not installing it for my virtual environment, despite activating it. I had to run the following to force it to be installed in the venv:

<virtualenv path>/bin/python setup.py install

In Linux, this gives you the path to the python in your venv:

which python

Upvotes: 0

appsdownload
appsdownload

Reputation: 861

If you are on Linux,

  1. Clone the project :https://github.com/cmusatyalab/openface
  2. cd openface
  3. python setup.py install
  4. Then create an empty file named __init__.py inside the openface/ directory
  5. Try running the demo command : ./demos/compare.py images/examples/{lennon*,clapton*}

Note: If the demo fails due to dependency issue, try to install those dependencies. Like in my case I had to install following as well

luarocks install torch
luarocks install nn
luarocks install dpnn

Upvotes: 1

Aditya Deshpande
Aditya Deshpande

Reputation: 2014

Do this in your terminal:

cd /home/your_username/openface

python setup.py install

This should help you.

Upvotes: 0

Related Questions