alyssaq / face_morpher

:angel: Morph faces with Python, Numpy, Scipy
882 stars 233 forks source link

error while loading shared libraries: libopencv_calib3d.so.3.1 #23

Closed bozzmob closed 7 years ago

bozzmob commented 7 years ago

I have installed OpenCV 3.3 with python 3.5 on Ubuntu 16.04.

I cloned the repo. and tried to run the morpher.py, I got the following error. Please can you tell me on how to resolve it?

(cv) ubuntu@ip:~/face_morpher$ python facemorpher/morpher.py --src=examples/ramsa.jpg --dest=examples/trump.jpg --plot
/home/ubuntu/face_morpher/facemorpher/bin/stasm_util_linux_cv3: error while loading shared libraries: libopencv_calib3d.so.3.1: cannot open shared object file: No such file or directory
Traceback (most recent call last):
  File "facemorpher/morpher.py", line 145, in <module>
    args['--alpha'], args['--plot'])
  File "facemorpher/morpher.py", line 130, in morpher
    src_img, src_points = next(images_points_gen)
  File "facemorpher/morpher.py", line 66, in load_valid_image_points
    img, points = load_image_points(path, size)
  File "facemorpher/morpher.py", line 56, in load_image_points
    points = locator.face_points(path)
  File "/home/ubuntu/face_morpher/facemorpher/locator.py", line 55, in face_points
    s = subprocess.check_output(command, universal_newlines=True)
  File "/usr/lib/python3.5/subprocess.py", line 626, in check_output
    **kwargs).stdout
  File "/usr/lib/python3.5/subprocess.py", line 708, in run
    output=stdout, stderr=stderr)
subprocess.CalledProcessError: Command '['/home/ubuntu/face_morpher/facemorpher/bin/stasm_util_linux_cv3', '-f', '/home/ubuntu/face_morpher/facemorpher/data', 'examples/ramsa.jpg']' returned non-zero exit status 127

Tried the same with Averager. Still getting the same error-

(cv) ubuntu@ip:~/face_morpher$ python facemorpher/averager.py --images=imgs/ --out=average.png
/home/ubuntu/face_morpher/facemorpher/bin/stasm_util_linux_cv3: error while loading shared libraries: libopencv_calib3d.so.3.1: cannot open shared object file: No such file or directory
Command '['/home/ubuntu/face_morpher/facemorpher/bin/stasm_util_linux_cv3', '-f', '/home/ubuntu/face_morpher/facemorpher/data', 'imgs/trump.jpg']' returned non-zero exit status 127
bozzmob commented 7 years ago

Fixed it by building the stasm_build.