datitran / face2face-demo

pix2pix demo that learns from facial landmarks and translates this into a face
https://medium.com/@datitran/face2face-a-pix2pix-demo-that-mimics-the-facial-expression-of-the-german-chancellor-b6771d65bf66
MIT License
1.43k stars 424 forks source link

Error: No module named 'cv2' when generating train data #26

Open brunofrancisco opened 6 years ago

brunofrancisco commented 6 years ago

Hi. I cloned this repo, then created the conda environment from file (Mac OS) and dowloaded the dataSet (angela_merkel_speech.mp4 and shape_predictor_68_face_landmarks.dat). OBS: I placed the both files of the dataSet inside the face2face-demo folder. Finally I run the follow command inside the project folder, but something went wrong.

face2face-demo] $ python generate_train_data.py --file angela_merkel_speech.mp4 --num 400 --landmark-model shape_predictor_68_face_landmarks.dat Traceback (most recent call last): File "generate_train_data.py", line 2, in import cv2 ModuleNotFoundError: No module named 'cv2'

0oshowero0 commented 5 years ago

This is because you don't have opencv library. Try to install it first:

pip install opencv-python

WrathofBhuvan11 commented 5 years ago

I guess you are using pyline Visual code editor... Once there was a report of this error I think you got to change some settings in vs code Or try spyder use Anaconda

Willianflower commented 5 years ago

Maybe you dont activate environment face2face-demo

djebel-amila commented 5 years ago

This is because you don't have opencv library. Try to install it first:

pip install opencv-python

For some reason, the - menpo::opencv3=3.1.0=py35_0 install from environment.yml didn’t work for me either. This pip install solved it, thanks.