Comments (5)
It's OK I managed to get it working using the dlib fork which was much easier to set up
from face_morpher.
Yeh, the problem is stasm not finding the openCV lib folder - its looking at /usr/local/lib
. I dont have access to any Windows machine so not sure how to test/fix it. It might be easier to use the dlib
branch: https://github.com/alyssaq/face_morpher/tree/dlib and follow the requirements
section in the readme.
My plan is to eventually switch stasm to dlib.
from face_morpher.
Hi @ollietb stasm expects opencv3 to be installed. This article might help: https://www.learnopencv.com/install-opencv3-on-windows.
Stasm only needs the C++ opencv3 libraries.
A good test to see if opencv3 has been installed successfully is to run one of their examples:
https://docs.opencv.org/3.4.2/dc/d88/Drawing_1_8cpp-example.html
On mac, compiling it would be: g++ test.cpp -lopencv_core -lopencv_imgproc -lopencv_highgui
from face_morpher.
Hey I got the same problem trying to run this in a Anaconda environment. I followed all steps in https://www.learnopencv.com/install-opencv3-on-windows. I can compile the test app they mention (C++ RedEyeRemover), run the python equivalent of it and import cv2 in a python session without any errors. Still I fail to install stasm because of the same error that @ollietb had.
(facemorph) C:\Users\Jonas\Workspace\python\facemorph>python
Python 3.7.2 (default, Jan 2 2019, 17:07:39) [MSC v.1915 64 bit (AMD64)] :: Anaconda, Inc. on win32
Type "help", "copyright", "credits" or "license" for more information.
>>> import cv2
>>> cv2.__version__
'3.4.5'
>>>
Where is stasm looking for these files? It is definitely in the PATH.
from face_morpher.
I'm suffering with the same, related issue? alyssaq/stasm#4
Btw, https://pypi.org/project/facemorpher/ still points to stasm, probably would be good to put a link or a note there to use dlib instead. The problem then is that pip install facemorpher
still uses spasm and yields:
ERROR: Command errored out with exit status 1:
command: 'C:\Users\janka.WISMAIN\AppData\Local\Continuum\anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\JANKA~1.WIS\\AppData\\Local\\Temp\\pip-install-rbm_w60m\\stasm_f40e238c30a04ed0a617b93678af83d7\\setup.py'"'"'; __file__='"'"'C:\\Users\\JANKA~1.WIS\\AppData\\Local\\Temp\\pip-install-rbm_w60m\\stasm_f40e238c30a04ed0a617b93678af83d7\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' bdist_wheel -d 'C:\Users\JANKA~1.WIS\AppData\Local\Temp\pip-wheel-jf_x9y6x'
cwd: C:\Users\JANKA~1.WIS\AppData\Local\Temp\pip-install-rbm_w60m\stasm_f40e238c30a04ed0a617b93678af83d7\
Complete output (32 lines):
running bdist_wheel
running build
running build_py
creating build
creating build\lib.win-amd64-3.7
creating build\lib.win-amd64-3.7\stasm
copying stasm\__init__.py -> build\lib.win-amd64-3.7\stasm
running egg_info
writing stasm.egg-info\PKG-INFO
writing dependency_links to stasm.egg-info\dependency_links.txt
writing requirements to stasm.egg-info\requires.txt
writing top-level names to stasm.egg-info\top_level.txt
reading manifest file 'stasm.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'stasm.egg-info\SOURCES.txt'
creating build\lib.win-amd64-3.7\stasm\data
copying stasm\data\README.txt -> build\lib.win-amd64-3.7\stasm\data
copying stasm\data\haarcascade_frontalface_alt2.xml -> build\lib.win-amd64-3.7\stasm\data
copying stasm\data\haarcascade_mcs_lefteye.xml -> build\lib.win-amd64-3.7\stasm\data
copying stasm\data\haarcascade_mcs_righteye.xml -> build\lib.win-amd64-3.7\stasm\data
copying stasm\data\testface.jpg -> build\lib.win-amd64-3.7\stasm\data
running build_ext
building '_stasm' extension
creating build\temp.win-amd64-3.7
creating build\temp.win-amd64-3.7\Release
creating build\temp.win-amd64-3.7\Release\src
creating build\temp.win-amd64-3.7\Release\src\mod_1
C:\Users\janka.WISMAIN\AppData\Local\Continuum\anaconda3\Library\mingw-w64\bin\gcc.exe -mdll -O -Wall -DMS_WIN64 -I/usr/local/include -I/usr/local/Cellar/opencv/3.4.1_5/include -I/usr/local/include/opencv4 -IC:\Users\janka.WISMAIN\AppData\Local\Continuum\anaconda3\include -IC:\Users\janka.WISMAIN\AppData\Local\Continuum\anaconda3\include -IC:\Users\janka.WISMAIN\AppData\Local\Continuum\anaconda3\lib\site-packages\numpy\core\include -c src\asm.cpp -o build\temp.win-amd64-3.7\Release\src\asm.o -std=c++11
In file included from src\asm.cpp:5:0:
src\stasm.h:33:30: fatal error: opencv2/opencv.hpp: No such file or directory
compilation terminated.
error: command 'C:\\Users\\janka.WISMAIN\\AppData\\Local\\Continuum\\anaconda3\\Library\\mingw-w64\\bin\\gcc.exe' failed with exit status 1
----------------------------------------
ERROR: Failed building wheel for stasm
ERROR: Command errored out with exit status 1:
command: 'C:\Users\janka.WISMAIN\AppData\Local\Continuum\anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\JANKA~1.WIS\\AppData\\Local\\Temp\\pip-install-rbm_w60m\\stasm_f40e238c30a04ed0a617b93678af83d7\\setup.py'"'"'; __file__='"'"'C:\\Users\\JANKA~1.WIS\\AppData\\Local\\Temp\\pip-install-rbm_w60m\\stasm_f40e238c30a04ed0a617b93678af83d7\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\JANKA~1.WIS\AppData\Local\Temp\pip-record-_de8sxwp\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\janka.WISMAIN\AppData\Local\Continuum\anaconda3\Include\stasm'
cwd: C:\Users\JANKA~1.WIS\AppData\Local\Temp\pip-install-rbm_w60m\stasm_f40e238c30a04ed0a617b93678af83d7\
Complete output (32 lines):
running install
running build
running build_py
creating build
creating build\lib.win-amd64-3.7
creating build\lib.win-amd64-3.7\stasm
copying stasm\__init__.py -> build\lib.win-amd64-3.7\stasm
running egg_info
writing stasm.egg-info\PKG-INFO
writing dependency_links to stasm.egg-info\dependency_links.txt
writing requirements to stasm.egg-info\requires.txt
writing top-level names to stasm.egg-info\top_level.txt
reading manifest file 'stasm.egg-info\SOURCES.txt'
reading manifest template 'MANIFEST.in'
writing manifest file 'stasm.egg-info\SOURCES.txt'
creating build\lib.win-amd64-3.7\stasm\data
copying stasm\data\README.txt -> build\lib.win-amd64-3.7\stasm\data
copying stasm\data\haarcascade_frontalface_alt2.xml -> build\lib.win-amd64-3.7\stasm\data
copying stasm\data\haarcascade_mcs_lefteye.xml -> build\lib.win-amd64-3.7\stasm\data
copying stasm\data\haarcascade_mcs_righteye.xml -> build\lib.win-amd64-3.7\stasm\data
copying stasm\data\testface.jpg -> build\lib.win-amd64-3.7\stasm\data
running build_ext
building '_stasm' extension
creating build\temp.win-amd64-3.7
creating build\temp.win-amd64-3.7\Release
creating build\temp.win-amd64-3.7\Release\src
creating build\temp.win-amd64-3.7\Release\src\mod_1
C:\Users\janka.WISMAIN\AppData\Local\Continuum\anaconda3\Library\mingw-w64\bin\gcc.exe -mdll -O -Wall -DMS_WIN64 -I/usr/local/include -I/usr/local/Cellar/opencv/3.4.1_5/include -I/usr/local/include/opencv4 -IC:\Users\janka.WISMAIN\AppData\Local\Continuum\anaconda3\include -IC:\Users\janka.WISMAIN\AppData\Local\Continuum\anaconda3\include -IC:\Users\janka.WISMAIN\AppData\Local\Continuum\anaconda3\lib\site-packages\numpy\core\include -c src\asm.cpp -o build\temp.win-amd64-3.7\Release\src\asm.o -std=c++11
In file included from src\asm.cpp:5:0:
src\stasm.h:33:30: fatal error: opencv2/opencv.hpp: No such file or directory
compilation terminated.
error: command 'C:\\Users\\janka.WISMAIN\\AppData\\Local\\Continuum\\anaconda3\\Library\\mingw-w64\\bin\\gcc.exe' failed with exit status 1
----------------------------------------
ERROR: Command errored out with exit status 1: 'C:\Users\janka.WISMAIN\AppData\Local\Continuum\anaconda3\python.exe' -u -c 'import sys, setuptools, tokenize; sys.argv[0] = '"'"'C:\\Users\\JANKA~1.WIS\\AppData\\Local\\Temp\\pip-install-rbm_w60m\\stasm_f40e238c30a04ed0a617b93678af83d7\\setup.py'"'"'; __file__='"'"'C:\\Users\\JANKA~1.WIS\\AppData\\Local\\Temp\\pip-install-rbm_w60m\\stasm_f40e238c30a04ed0a617b93678af83d7\\setup.py'"'"';f=getattr(tokenize, '"'"'open'"'"', open)(__file__);code=f.read().replace('"'"'\r\n'"'"', '"'"'\n'"'"');f.close();exec(compile(code, __file__, '"'"'exec'"'"'))' install --record 'C:\Users\JANKA~1.WIS\AppData\Local\Temp\pip-record-_de8sxwp\install-record.txt' --single-version-externally-managed --compile --install-headers 'C:\Users\janka.WISMAIN\AppData\Local\Continuum\anaconda3\Include\stasm' Check the logs for full command output.
from face_morpher.
Related Issues (20)
- Averager OpenCV Error: Unsupported format or combination of formats HOT 1
- (face) D:\workspace\face_morpher-master>python facemorpher\morpher.py --src=facebook\1.jpg --dest=facebook\2.jpg --plot Traceback (most recent call last): File "facemorpher\morpher.py", line 34, in <module> from facemorpher import locator ImportError: No module named 'facemorpher'
- How does dlib replace OpenCV
- The problem with inaccurate face detection HOT 2
- No module named 'facemorpher' HOT 2
- How to use face_morpher for face_swap?
- Video morph
- "Invalid HAAR feature" and no face in image error HOT 3
- Fail to install facemorpher on Ubuntu 18.04 HOT 2
- Image RGB array must be uint8 or floating point; found int32 HOT 3
- Preserve .png transparency?
- How to get rid of the black area HOT 1
- dlib RuntimeError: Unable to open `shape_predictor_68_face_landmarks.dat` HOT 1
- Export/save images with high resolution?
- You replaced opencv with dlib?
- ImportError: /home/cqnu/anaconda3/envs/makeup-transfer/lib/python3.7/site-packages/_stasm.cpython-37m-x86_64-linux-gnu.so: undefined symbol: _ZTVN2cv12_OutputArrayE
- Troubleshooting for MacOS 12.3.1+Python3.9.6+OpenCV4.5.5
- How can I replace a face resulted using face_morpher?
- 퍼펙트 데이즈 || 전체 (영화) 2024 KOREAN | 전체 영화 무료 시청~HD 다운로드
- No face in picture
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from face_morpher.