face_morpher icon indicating copy to clipboard operation
face_morpher copied to clipboard

dyld: Library not loaded: /usr/local/opt/opencv3/lib/libopencv_stitching.3.2.dylib

Open AndyMBridges opened this issue 7 years ago • 17 comments

Hi guys,

I'm getting the below error every time I attempt to morph, any ideas?

dyld: Library not loaded: /usr/local/opt/opencv3/lib/libopencv_stitching.3.2.dylib Referenced from: /Users/[USERNAME]/sites/face_morpher/facemorpher/bin/stasm_util_osx_cv3 Reason: image not found

Thanks, Andy

AndyMBridges avatar Jul 03 '17 16:07 AndyMBridges

I'm running the following code,

python facemorpher/morpher.py --src=images/corbyn.jpg --dest=images/becks.jpg --plot

AndyMBridges avatar Jul 03 '17 16:07 AndyMBridges

Needs to be bumped from 3.2 to 3.3.

In particular, this will need to be changed: https://github.com/alyssaq/face_morpher/commit/be3aeb1282ca344e80759d032ed772bea7da612f#diff-b8f53f41d03ba03a765393e63c9dc3ee

I think candidates for a replacement for the stasm binary are located here: https://github.com/opencv/opencv/releases

token-cjg avatar Aug 14 '17 09:08 token-cjg

No, that's not right. But something needs to be changed; alternatively one will need to brew install an older version of opencv.

token-cjg avatar Aug 14 '17 09:08 token-cjg

So, is there a solution for this issue?

XiaoWanLINJU avatar Oct 03 '17 19:10 XiaoWanLINJU

Im still on opencv 3.2. Could you try building the stasm binary? Details on how to build it and where to place the binary are listed here: https://github.com/alyssaq/face_morpher#details

alyssaq avatar Oct 04 '17 09:10 alyssaq

I was able to reproduce this issue on opencv3.4. I have updated the binary to support opencv3.4 on MacOS X.

alyssaq avatar Jan 09 '18 11:01 alyssaq

I get the same error with 3.4.

dyld: Library not loaded: /usr/local/opt/opencv/lib/libopencv_stitching.3.4.dylib Referenced from: /Users/petkra/.pyenv/versions/3.5.2/lib/python3.5/site-packages/facemorpher/bin/stasm_util_osx_cv3.4 Reason: image not found Command '['/Users/<username>/.pyenv/versions/3.5.2/lib/python3.5/site-packages/facemorpher/bin/stasm_util_osx_cv3.4', '-f', '/Users/<username>/.pyenv/versions/3.5.2/lib/python3.5/site-packages/facemorpher/data', './faces/face_0.jpg']' returned non-zero exit status -6

peterk avatar Feb 16 '18 08:02 peterk

Me too unfortunately...

renenijman avatar Feb 26 '18 12:02 renenijman

Any idea for a fix?

renenijman avatar Mar 03 '18 12:03 renenijman

What OS, openCV and python versions are you using? What is the command that is failing? Is this from the pip installed facemorpher or git cloned from master branch? Happy to investigate and fix but will need more information to reproduce.

alyssaq avatar Mar 03 '18 18:03 alyssaq

Im on mac, 3.4.1, 3.6.3. python3 facemorperher/average.py ......... running from master branch with pip installed facemorpher I checked my directory and that file isn't there

lunzhang avatar May 01 '18 15:05 lunzhang

I met the same error,have solved it or not?

ChrisInTheRainyMorning avatar May 10 '18 16:05 ChrisInTheRainyMorning

Instead of using the stasm face detector, I used dlib for it. Heres a PR of how https://github.com/alyssaq/face_morpher/pull/39

lunzhang avatar May 10 '18 16:05 lunzhang

I am having a similar issue. I get the following error when I try to run the facemorpher command:

dyld: Library not loaded: /usr/local/opt/opencv/lib/libopencv_text.3.4.dylib Referenced from: /anaconda3/lib/python3.6/site-packages/facemorpher/bin/stasm_util_osx_cv3.4 Reason: image not found

I am on a macOS High Sierra 10.13.4 Python version 3.6.5 OpenCV version 3.4.1 pip-installed facemorpher (exact command: facemorpher --src=BM01_AC.jpg --dest=BM01_FC.jpg --num=12 --plot --alpha)

Any insight into this issue would be greatly appreciated!

gmbrennan avatar May 15 '18 21:05 gmbrennan

@gmbrennan If the exact error is file does not exist. Double check the supplied paths, then you'll need to supply the full image path to --src and --dest.

If the stasm binary doesnt exist in <site-packages>/facemorpher/bin/stasm_util_osx_cv3.4, you can download it from this repo (although it should be there unless I missed something in setup.py). Or, try re-building it for you OS as per the instructions in the readme.

If stasm is erroring, please try dlib as suggested by @lunzhang. There is a working branch called dlib and you'll have to download shape_predictor_68_face_landmarks.dat from http://dlib.net/files and place it in /facemorpher/data/.

alyssaq avatar May 20 '18 09:05 alyssaq

I tried it out in a fresh linux docker container and was able to reproduce the error. The problem was pip installing opencv-python, which installs openCV into site-packages as a single shared object file.

In order to use facemorpher with stasm, openCV has to be installed via homebrew, from source or some installer that retains the opencv libraries.

Ive documented this in the readme. stasm is now pip installable and used in facemorpher-5.0.0.

alyssaq avatar May 28 '18 13:05 alyssaq

I am trying to get this to work on a Mac. (Mojave). i am using the 'origin/dlib' branch. I too get the ...

Referenced from: /usr/local/lib/python3.7/site-packages/_stasm.cpython-37m-darwin.so Reason: image not found

error.

Is the way to solve this to use the opencv@3 version?

I am trying to understand all the comments above, but is this the bottom line? If I somehow get opencv3 hooked up ... will this work? Or did I miss something else?

Thanks for all your hard work.

I now have opencv3 installed. but no luck. I have tried to add all the exports paths listed. I am using opencv 3.4.10. is that ok?

rcolepeterson avatar Apr 19 '20 02:04 rcolepeterson